[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Newbie question

Newbie question

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


Posted by Errigour   USA  (32 posts)  [Biography] 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 '<'
[Go to top] top

Posted by Chyort   USA  (58 posts)  [Biography] 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.
[Go to top] top

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


8,790 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]