Soandso2
Well-known member
- Joined
- Mar 13, 2023
- RedCents
- 937¢
So, one of the benefits of using Lua instead of old macroscript is that you can run multiple luas at the same time. Are there any drawbacks to this? Does running 10 separate luas for one toon decrease performance in any significant way? Or can you run hundreds of luas on a reasonable modern computer before things start to bog down?
This little Lua (not tested as I just wrote it) runs on its own. The same toon has other luas running at the same time, doing other stuff.
[CODE lang="Lua" title="ShoutBellow"]local bellow = true
while true do
if target.PctHP > 20 then
if me.AltAbilityReady("Boastful Bellow")() and bellow then
mq.cmd("/alt act 199")
bellow = false
mq.delay(5000)
end
if me.AltAbilityReady("Boastful Bellow")() and not bellow then
mq.cmd("/alt act 8201")
bellow = true
mq.delay(5000)
end
end
end[/CODE]
Why do I do this? Well, if this snippet is part of a larger Lua, the delays halts everything, including things that do not need to halt. But as a Lua that runs on its own and only does exactly what it does, a delay in the loop does not matter. This might be a "crude" approach, but is easy to make work.
Edit: keep in mind that this question does not regard the example lua as such. Just wether it is good or bad practice to "make a new lua for every new thing you come up with" rather than putting everything into the same script.
This little Lua (not tested as I just wrote it) runs on its own. The same toon has other luas running at the same time, doing other stuff.
[CODE lang="Lua" title="ShoutBellow"]local bellow = true
while true do
if target.PctHP > 20 then
if me.AltAbilityReady("Boastful Bellow")() and bellow then
mq.cmd("/alt act 199")
bellow = false
mq.delay(5000)
end
if me.AltAbilityReady("Boastful Bellow")() and not bellow then
mq.cmd("/alt act 8201")
bellow = true
mq.delay(5000)
end
end
end[/CODE]
Why do I do this? Well, if this snippet is part of a larger Lua, the delays halts everything, including things that do not need to halt. But as a Lua that runs on its own and only does exactly what it does, a delay in the loop does not matter. This might be a "crude" approach, but is easy to make work.
Edit: keep in mind that this question does not regard the example lua as such. Just wether it is good or bad practice to "make a new lua for every new thing you come up with" rather than putting everything into the same script.
Last edited:


