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 ➜ Lua ➜ Newbie question

Newbie question

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


Posted by Errigour   USA  (32 posts)  Bio
Date Thu 12 Jul 2018 12:25 AM (UTC)

Amended on Thu 12 Jul 2018 01:31 AM (UTC) by Errigour

Message
Hey sorry whys this printing an error?


if %1 == "Someone"
then
  Send("cast 'detect invisibility'")
  Send("reply I couldn't see you.")
else
  Send("tell %1 sanc sf armor bless aid talon reg str gs inf full pulse fly ww invis or just tell me spellup for a full spellup")
end


Here's the error
[string "Trigger: "]:1: unexpected symbol near '<'
Top

Posted by Chyort   USA  (58 posts)  Bio
Date Reply #1 on Thu 12 Jul 2018 01:30 AM (UTC)

Amended on Thu 12 Jul 2018 01:36 AM (UTC) by Chyort

Message
you need ""'s around your variable.

As for the reason, i admit to guessing here... but without the ""'s... it is trying to compare the number "Someone" to the string "Someone" and it doesn't match.

the ""'s make it string to string and it functions.


(my test trigger and resulting output)

<triggers>
  <trigger
   enabled="y"
   match="Roj says '*'"
   send_to="12"
   sequence="100"
  >
  <send>if "%1" == "Someone"
then
  Note("cast 'detect invisibility'")
  Note("reply I couldn't see you.")
else
  Note("tell %1 sanc sf armor bless aid talon reg str gs inf full pulse fly ww invis or just tell me spellup for a full spellup")
end</send>
  </trigger>
</triggers>



Roj says 'tester'
tell tester sanc sf armor bless aid talon reg str gs inf full pulse fly ww invis or just tell me spellup for a full spellup

Roj says 'Someone'
cast 'detect invisibility'
reply I couldn't see you.
Top

Posted by Errigour   USA  (32 posts)  Bio
Date Reply #2 on Thu 12 Jul 2018 01:34 AM (UTC)
Message
Thanx!
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.


10,204 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.