I have an trigger that fires off when a prompt lets me know that my shields are down. I also have an alias that will put all of my shields back up with one command. The problem is that I have to wait 30 seconds to enter the shield up commands due to their cooldown, but sometimes they are knocked down immediately.
I'm trying to build that cooldown into the trigger so that it checks to see if it fired within the last 30 seconds, and doesn't fire if it has. Here's what I've got.
I'm getting this whenever it should trigger though.
I definitely have a 'then' statement in there on line 2 though, so I'm not sure what the problem is.
I'm trying to build that cooldown into the trigger so that it checks to see if it fired within the last 30 seconds, and doesn't fire if it has. Here's what I've got.
<triggers>
<trigger
enabled="y"
match="Your * have been disabled."
send_to="12"
sequence="100"
>
<send>
if %1 = ("shields") then
if lastTriggerTime == nil or os.time () - lastTriggerTime >= 30 then
Send ("shieldbuff")
lastTriggerTime = os.time ()
end -- if 30 seconds are up
end --- if
</send>
</trigger>
</triggers>
I'm getting this whenever it should trigger though.
Compile error
World: Name of Game
Immediate execution
[string "Trigger: "]:2: 'then' expected near '='
I definitely have a 'then' statement in there on line 2 though, so I'm not sure what the problem is.