Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Random error causing trigger to break

Random error causing trigger to break

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Xandler   (52 posts)  Bio
Date Sat 21 Aug 2021 05:08 PM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 21 Aug 2021 08:09 PM (UTC)

Amended on Sat 21 Aug 2021 08:20 PM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,254 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.