Random error causing trigger to break

Posted by Xandler on Sat 21 Aug 2021 05:08 PM — 2 posts, 10,267 views.

#0
Okay, so I have this trigger here that just randomly decides to break and I can't figure out why


<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   group="mobstomove"
   match="You let everyone know that you're ready."
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>  if @ppl &lt;= 60 then
Send ("--")
Execute ("tranquil")
Send ("power up")
Send ("power up")
Send ("power up")
Send ("power up")
Send ("sense @target")
 else
  
  if @pki &lt;= 25 then
Send ("--")
Execute ("tranquil")
Send ("Swallow senzu")
Send ("sense @target")
 else

  if @fatigue &gt;= 50 then
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("drink 99.bottle")
Send ("sense @target")
else
Send ("sense @target")
end
end
end</send>
  </trigger>
</triggers>

The error I get is:

Compile error
World: Dragonball Evolution
Immediate execution
[string "Trigger: "]:18: unexpected symbol near '>='


The thing with is it will work nearly 95% of the time even when that line is true, then it will just suddenly throw that error when that line is true or even when it's false. I just don't understand what's going on. It doesn't break all the time, just randomly and I've used the >= sign in other triggers and they all work properly. What am I missing?
Australia Forum Administrator #1
Probably fatigue has a space or something non-numeric (or nothing at all) in it. Check that you only put numbers into fatigue.

If it's from a trigger it might have a comma in it (eg. 1,500). When you capture fatigue make sure it is only digits, and remove any commas.

As a debugging technique, as soon as the trigger fails, and you can see that line 18 is the one with @fatigue in it, use the configuration window to see what value is in the fatigue variable.