I'm looking for a way to Lua natively get and set slider values.
I see question has been approached previously: here, and here.
And there's relevent documentation for window and notify.
I even checked the source: https://github.com/macroquest/macroquest/blob/master/src/main/datatypes/MQ2WindowType.cpp
I would like to be able to grab the slider value directly as this would allow me much greater flexibility.
I may be able to get an interpreted value from the associated label but that would require significant work; changes to data structure; additional data gathering, and the label value may go from 0 to 100, but the slider from 0 to 19, or 0 to 149.
Currently I'm simply stamping the value like using a template regardless of whether or not it already has the correct value.
For checkboxes, I' m able to use
Checkbox
But for sliders, I'm stuck with
Slider Settings
I'm after the Lua function for applying the setting as well as the member which returns the value. I've tried about every possible member combination in the suffix of this statement to no avail:
lua slider statement
Any help appreciated
I see question has been approached previously: here, and here.
And there's relevent documentation for window and notify.
I even checked the source: https://github.com/macroquest/macroquest/blob/master/src/main/datatypes/MQ2WindowType.cpp
I would like to be able to grab the slider value directly as this would allow me much greater flexibility.
I may be able to get an interpreted value from the associated label but that would require significant work; changes to data structure; additional data gathering, and the label value may go from 0 to 100, but the slider from 0 to 19, or 0 to 149.
Currently I'm simply stamping the value like using a template regardless of whether or not it already has the correct value.
For checkboxes, I' m able to use
Checkbox
Lua:
if (mq.TLO.Window('OptionsWindow').Child('OGP_EnvSoundsCheckbox').Checked() ~= desired_value) then
mq.TLO.Window('OptionsWindow').Child('OGP_EnvSoundsCheckbox').LeftMouseUp()
end
Slider Settings
Lua:
mq.cmdf('/notify OptionsWindow OGP_SoundVolumeSlider newvalue ' .. desired_value)
I'm after the Lua function for applying the setting as well as the member which returns the value. I've tried about every possible member combination in the suffix of this statement to no avail:
lua slider statement
Lua:
mq.TLO.Window('OptionsWindow').Child('OGP_SoundVolumeSlider').?
Any help appreciated
Last edited:

