• 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 - How can write conditions in lua about other lua scripts?

Rare Spawn

Well-known member
Joined
Oct 10, 2022
RedCents
3,282¢
My goal is at the start of mission scripts, I want to pause the Lua script 'overseer', if its not already paused. But at the end of the mission, unpause it if it is running, and is paused.

It appears the TLOs for Lua are pretty skinny in this area, whats the best way to evaluate if a Lua script is running, is paused, or not running?

Thanks!
 
Would issuing the command to stop overseer at the start and then just running it at conclusion work? It's not as elegant as having conditions and if it's not running when you start the mission nothing will break you'll just get the Lua not running message.
 
That would accomplish the goal of not having Overseer pop up mid-mission, but would also require Overseer to run its startup routine again once restarted. I would like to be more efficient and leave a small footprint when possible.

Know of any examples that parse a "/Lua ps"?
 
I mean, I guess you can set something up that does mq.cmdf('/lua pause %s', lua_app_name) on both sides of whatever the app you want to pause it from does.

But I guess the better question is, why? I don't think your footprint is going to really change, especially since overseer mainly runs on a timer if it is active.
 
That would accomplish the goal of not having Overseer pop up mid-mission, but would also require Overseer to run its startup routine again once restarted. I would like to be more efficient and leave a small footprint when possible.

Know of any examples that parse a "/lua ps"?
Dont need to parse the ps

-- pause it
if mq.TLO.Lua.Script('overseer').Status() == 'RUNNING' then
mq.cmd('/lua pause overseer')
end

-- unpause it
if mq.TLO.Lua.Script('overseer').Status() == 'PAUSED' then
mq.cmd('/lua pause overseer')
end
 
Dont need to parse the ps

-- pause it
if mq.TLO.Lua.Script('overseer').Status() == 'RUNNING' then
mq.cmd('/lua pause overseer')
end

-- unpause it
if mq.TLO.Lua.Script('overseer').Status() == 'PAUSED' then
mq.cmd('/lua pause overseer')
end
Oh snap! Thank you! That is not on the wiki yet!

**EDIT - luaninfo was in the wiki, however it said it required a PID, which I understood to be a integer. Submitted a change to indicate "PID or name"
 
Question - How can write conditions in lua about other lua scripts?

Users who are viewing this thread

Back
Top
Cart