Newbie question

Posted by Errigour on Thu 12 Jul 2018 12:25 AM — 3 posts, 14,284 views.

USA #0
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 '<'
Amended on Thu 12 Jul 2018 01:31 AM by Errigour
USA #1
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.
Amended on Thu 12 Jul 2018 01:36 AM by Chyort
USA #2
Thanx!