• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Lua ImGUI and Checkbox toggle

Joined
Nov 23, 2006
RedCents
935¢
Wanting to add an interface to the OutAssist and was wondering if anyone could share some insights into how checkbox is handled?

Currently I use the below code and it works for toggling ReturnToCamp variable true and false, but it will set the variable on every redraw.. Is that the right way to do it?

Would like to add a print(String.format("Return to camp set to: %s", returnToCamp)), but in the below code it will just spam the console window.

Lua:
        chkReturnToCamp = ImGui.Checkbox('Return to camp after combat',chkReturnToCamp)
        ImGui.SameLine()
        HelpMarker(string.format('Returning to camp will use mq2nav to navigate back to where the script was first executed. \n X:%s Y:%s Z:%s ',cordX, cordY, cordZ ))

        if chkReturnToCamp then
            returnToCamp = true
        else
            returnToCamp = false 
        end
 
could you maybe do something like:

Lua:
if chkReturnToCamp and not returnToCamp then
        returnToCamp = true
        print(String.format("Return to camp set to: %s", returnToCamp))
elseif not chkReturnToCamp and returnToCamp then
        returnToCamp = false
        print(String.format("Return to camp set to: %s", returnToCamp))
end
 
Question - Lua ImGUI and Checkbox toggle

Users who are viewing this thread

Back
Top
Cart