• 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

Lua - Lua Snips and discussion

I did see that it had small buttons, would like to associate an index or recipe id to the button so I can expand and show the recipe items and or select that recipe to make using the button
 
thats pretty cool.

Design wise, i think making a tab bar might be better UI than the series of collapsible headers

My thing is making it work, then making it pretty.. I am still trying to figure out what is the best way to display info and stuff, I also am open to suggestions, of course..

Updated Script status checking..

Code:
local function script_status(p_script_name, p_squelch)
    -- print("passed: ", p_script_name)
    local pid_array = mq.TLO.Lua.PIDs()
    local delimiter = ","
    local pid_table = {};
    for match in (pid_array .. delimiter):gmatch("(.-)" .. delimiter) do
        if match ~= nil then table.insert(pid_table, match); end
    end
    local flag = 0
    local get_pid_name
    if pid_table[1] ~= nil then
        for c = 1, #pid_table do
            get_pid_name = mq.TLO.Lua.Script(pid_table[c]).Name()
            if get_pid_name ~= nil then
                if get_pid_name == p_script_name then
                    flag = 1
                    -- print(get_pid_name, " ", pid_table[c])
                    break
                end
            end
        end
    else
        return nil, nil, nil
    end
    if flag == 1 and mq.TLO.Lua.Script(get_pid_name).ReturnCount() == 0 then
        return mq.TLO.Lua.Script(get_pid_name).PID(),
               mq.TLO.Lua.Script(get_pid_name).ReturnCount(),
               mq.TLO.Lua.Script(get_pid_name).Status()
    end
    return nil, nil, nil
end

Will now return script name, return count, and status based on any matching script running.. no case used
 
This function does the same thing, but also begs the question, why do you need a function to do this?

Code:
local function script_status(p_script_name)
    local script = mq.TLO.Lua.Script(p_script_name)
    if script.ReturnCount() == 0 then
        return script.PID(), script.ReturnCount(), script.Status()
    else
        return nil, nil, nil
    end
end
 
This function does the same thing, but also begs the question, why do you need a function to do this?

Code:
local function script_status(p_script_name)
    local script = mq.TLO.Lua.Script(p_script_name)
    if script.ReturnCount() == 0 then
        return script.PID(), script.ReturnCount(), script.Status()
    else
        return nil, nil, nil
    end
end

I guess it depends on the amount of scripts that are being monitored that would warrant a function or not.. if I do the same thing x amount of times and x is over say 1 then make a function.. everyone's x is different..

Thinking about it, my code could just give a constant spam update of all scripts running.. or do a string.find or match to find related scripts that are pre-pended with something

But, yes I agree my way was over-engineered looking for case matches, so paring it down is apropos.
 
Last edited:
lua script names are no longer case sensitive in latest update just posted today

local script_name = "work"
local script = mq.TLO.Lua.Script(script_name)()


returns nil which would ?should? be (true) bool if found?

but the way that does work is (either case)

local script = mq.TLO.Lua.Script(script_name).Status()
 
Last edited:
What are the desired methods to pass variables to a Lua the was ran by doing (/Lua run)

My list

pass the variables in the command string at execution
write the data and have it read in the script that was run


but is there a third option to globally pass a variable to a running Lua that is not asserted or required?
 
local script_name = "work"
local script = mq.TLO.Lua.Script(script_name)()


returns nil which would ?should? be (true) bool if found?

but the way that does work is (either case)

local script = mq.TLO.Lua.Script(script_name).Status()

i don't really see a use for mq.TLO.Lua.Script(script_name)()
That would print nil if the script is running. or a comma delimited list of return values. neither of which seem useful to me.
 
i don't really see a use for mq.TLO.Lua.Script(script_name)()
That would print nil if the script is running. or a comma delimited list of return values. neither of which seem useful to me.

Fortunately this is not an extinction level event, so we will let it pass.
 
What are the desired methods to pass variables to a lua the was ran by doing (/lua run)

My list

pass the variables in the command string at execution
write the data and have it read in the script that was run


but is there a third option to globally pass a variable to a running lua that is not asserted or required?

you're going to have to describe what you mean by "pass variables to a Lua"

its really no different than /mac
 
So, I know we've discussed that delays of any sort is bad juju in ImGui, but how about /Lua pause ? I can pause it successfully, but when un-pausing it randomly crashes..

I searched for delay and pause and while on this page:


didn't say I couldn't do it..

I also took a gander here..


my current structure

GUI --> required file --> required files


overlay reload? resume maybe?

I am giving this a shot

mq.cmd('/squelch /Lua pause tcg')
mq.cmd('/mqoverlay reload')
mq.cmd('/mqoverlay resume')
 
Last edited:
Still wrapping my head around formats and tables..

1635456781141.png


Would it be preferable to have tables pop out, or have the missing items show up under the recipe or where it is now?
 
Last edited:
It has been quite some time since I have unix'd.. I think whatever you wanted (script, process) to run , you would append & would send it off , freeing up your current process. I apologize for the lack of proper articulation.

but I am guessing the equivalent is within the Lua you mq.cmd('/lua run order 66') the only issue I have with that is being able to control that runaway Lua and return variables from it.
I want to send a status to the GUI about what this Lua is doing. The way I currently accomplish it is via GLOBALs and require, but the GUI is unable to do "other" things..

What am I trying to do:

send a "job" to do while freeing up the main process, I can monitor this job and abort this job, but is there a way to pass or at least see variables from that job? An analogy would be fire and forget , much like a UDP.
-- this job is running a do while or a for next loop.

If only this were a thing..

local result = mq.cmd('/lua run order 66')
 
Last edited:
Should there be an ImGui forum or is it ok to keep the discussion in here?

1635713373773.png

the vslider works great, but the horizontal slide sticks :(

is this correct?

Code:
      l_make_amount, _ = ImGui.SliderInt('##SliderInt'..l_make_amount, l_make_amount, 1, 1000, "%d")
 
Is there 'extended' documentation that explains how to hide the quantity box for an InputInt, and pre-dock to a specific window at the bottom?

1636049756630.png

I'm using PushItemWidth(1) for now.. for that sliver..

I want the slider and the int together on the same line, but want the int to only show - +
 
Last edited:
I am sure some stable genius out there knows this :)

I would like the windows on the left to start all docked to one another..

1636075644488.png
 
I don't think the docking functionality is exposed to Lua yet. Its in flux and changes every update so i am waiting on it to stabilize.
 
When I have the stack window or vendor shopping list window open, things slow down to a crawl. Is there a way to have it not refresh those windows but display them with the data that is currently populated, or am I barking up the wrong tree?

1636253115524.png
 
The issue was trying to look up data from SQL live while displaying a table..

local l_recipe_name = feeder.item_name_lookup(
stack_recipe_item_id)

this line caused all the slowness because it was querying SQLite for info.. I guess I will prepopulate the array prior instead of being lazy :)

also, beating the bejeezus out of the I/O

So why did I do it in the first place, well.. there are 2 recipes that have a "," in them. and the method I was using to extract elements at nth was stripping commas and quotes. So .. lazy.. again.. So I figured if I removed the text I could look it up later.. which is true, just not for ImGui tables..
 
Last edited:
well got that squared away, and added.. more.. the prices are with charisma 550.. I suppose there is a formula, does anyone know it off hand? I would have to get all the prices at low cha.. and then do multipliers to get the accurate number based on a toons current charisma..


1636394264219.png


and to round it out..

1636398183528.png

1636402676499.png

just need to find or hand jam a db with the 4000ish farmed items

so I posit the question is there a file out there that anyone knows of that I can parse that contains the id and/or name of the item ,the zone, mob, and particular action?

1636432923671.png
 
Last edited:
Doubt this really needs to be made into a file but ...

just spams so you can learn a language while doing other things.. Well it is a re-tool of a mac that exists..

Code:
local mq = require('mq')
while true do
    mq.cmd('/gsay "You are learning a brand new language, Feel Special eh?"')
    mq.cmd(
        '  /gsay "Well you shouldnt because you are not learning it fast enough!" ')
    mq.cmd(
        '   /gsay "Do you have any idea how much my mouth is gonna hurt after this?!" ')
    mq.cmd('    /gsay "Study Study Study Hard" ')
    mq.cmd('     /gsay "Practice makes stinkin perfect" ')
    mq.delay(1)
end
 
Doubt this really needs to be made into a file but ...

just spams so you can learn a language while doing other things.. Well it is a re-tool of a mac that exists..

Code:
local mq = require('mq')
while true do
    mq.cmd('/gsay "You are learning a brand new language, Feel Special eh?"')
    mq.cmd(
        '  /gsay "Well you shouldnt because you are not learning it fast enough!" ')
    mq.cmd(
        '   /gsay "Do you have any idea how much my mouth is gonna hurt after this?!" ')
    mq.cmd('    /gsay "Study Study Study Hard" ')
    mq.cmd('     /gsay "Practice makes stinkin perfect" ')
    mq.delay(1)
end
that isn't swapping languages, did you leave some code out?
 
Lua - Lua Snips and discussion

Users who are viewing this thread

Back
Top
Cart