[string "Trigger: "]:1: unexpected symbol near '<'

Posted by Rabbi on Wed 13 Jul 2016 09:11 PM — 3 posts, 15,827 views.

#0
Hi all, I'm getting back into MUDing after a long time, and trying to write the simplest trigger is driving me crazy.

My trigger works, and I get the correct output, but before the correct output I get the following:

Error:

Error number: 0
Event:        Compile error
Description:  [string "Trigger: "]:1: unexpected symbol near '<'
Called by:    Immediate execution


Sample Input:
<641/641hp 14/14sp 207/207ep 345xp>


Trigger:

  <trigger
   enabled="y"
   group="Colorize"
   match="&lt;* * * *&gt;"
   omit_from_output="y"
   script="Prompt"
   send_to="12"
   sequence="100"
  >
  <send>%0</send>
  </trigger>


Lua:

function Prompt (name, text, wildcards)
    Tell ("<")
    ColourTell("yellow", "black", wildcards[1] .. " ")
    ColourTell("cyan", "black", wildcards[2] .. " ")
    ColourTell("magenta", "black", wildcards[3] .. " ")
    ColourTell("grey", "black", wildcards[4])
    Tell (">")
end


If I create the following trigger instead it works fine:

  <trigger
   enabled="y"
   expand_variables="y"
   group="Colorize"
   keep_evaluating="y"
   match="&lt;* * * *&gt;"
   omit_from_output="y"
   send_to="12"
   sequence="100"
  >
  <send>Tell ("&lt;")
ColourTell("yellow", "black", "%1" .. " ")
ColourTell("cyan", "black", "%2" .. " ")
ColourTell("magenta", "black", "%3" .. " ")
ColourTell("grey", "black", "%4")
Tell ("&gt;")</send>
  </trigger>

But I'd prefer to keep this stuff in an external file instead of having the code live in my triggers. I have no idea why this is happening and it's been driving me nuts! Any help is appreciated.

Version: Getting the same results on version 5.01 and 4.94.
Amended on Wed 13 Jul 2016 09:19 PM by Rabbi
Australia Forum Administrator #1

  <send>%0</send>


You are sending the matching text to the script engine. Omit the %0 there. Since you are calling your own function you don't need to set it to "send to script".

Send to "world" will do.
#2
Thank you so much for your VERY quick reply. It's much appreciated!