Compile Error: where did I mess up?

Posted by Caelen on Wed 14 Jul 2010 09:04 PM — 5 posts, 18,671 views.

#0
I had a pair of scripts that give me a printed timer for fishing. I wanted to edit them to make myself automatically reel the line in to a certain distance if I overcast.


<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   match="You reel your line in and stop with the hook at * feet."
   send_to="12"
   sequence="100"
  >
  <send>require "wait"

if %1 > 25 then
 Send "reel in"
elseif %1 > 5 then
 wait.make (function ()
 wait.time(60)
 print "REEL IN"
 end)
else
 Send "reel all the way"
end</send>
  </trigger>
  <trigger
   enabled="y"
   expand_variables="y"
   group="Multi Line"
   lines_to_match="2"
   keep_evaluating="y"
   match="You hear a gentle plop as your hook falls into the water about \d+ feet from\nyou\.\Z"
   multi_line="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>require "wait"

if %1 > 25 then
 Send "reel in"
else
 wait.make (function ()
 wait.time(60)
 print "REEL IN"
 end)
end</send>
  </trigger>
</triggers>


I keep getting this message when either one fires.


Compile error
World: Ateraan
Immediate execution
[string "Trigger: "]:3: unexpected symbol near '>'


Where did I mess up?
Amended on Wed 14 Jul 2010 09:08 PM by Caelen
#1
Odd... now it's working after I retyped them...

EDIT

Spoke too soon.

[code]
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="Multi Line"
lines_to_match="2"
keep_evaluating="y"
match="You hear a gentle plop as your hook falls into the water about \d+ feet from\nyou\.\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>require "wait"

if %1 &gt; 25 then
Send "reel in"
else
wait.make (function ()
wait.time(60)
print "REEL IN"
end)
end</send>
</trigger>
</triggers>
[/code]

still isn't working.
Amended on Wed 14 Jul 2010 09:16 PM by Caelen
Australia Forum Administrator #2
Here:


   match="You hear a gentle plop as your hook falls into the water about \d+ feet from\nyou\.\Z"


You haven't designated a wildcard so %1 will be empty, and it will be processing:


if > 25 then
 Send "reel in"
else


You need to put brackets around it like this:


   match="You hear a gentle plop as your hook falls into the water about (\d+) feet from\nyou\.\Z"

Australia Forum Administrator #3
Caelen said:

Odd... now it's working after I retyped them...

This time, though, instead of getting some set of four characters where the > sign is, it copied the > signs correctly...


The XML ouputting converts < to &lt; and > to &gt;

This is normal, it converts back when you paste into the client.
#4
Ah, so that's how it works. () to make a wildcard.

Yep! works now. Thanks!