Trigger won't work

Posted by Trinity on Fri 10 Mar 2006 01:57 PM — 5 posts, 16,568 views.

#0
Okay, I wrote a trigger and it worked fine one day but when I closed MUSH, I forgot to save so it got erased. I rewrote the trigger and it didn't work. I copy and pasted some triggers off the forums that were said to work and did a test trigger and those did not work either. I have enabled triggers and I can't figure out why it won't work. Any ideas?

Also, just in case, this is my trigger.

<triggers>
<trigger
enabled="y"
match="for (?P&lt;coins&gt;) coins\."
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable "coins", GetVariable ("coins") + %&lt;coins&gt;
Note "You now have " &amp; GetVariable ("coins") &amp; " coins."</send>
</trigger>
</triggers>

EDIT : When I said they didn't work, I meant that nothing happened. No error messages, no notes, nothing.
Amended on Fri 10 Mar 2006 02:08 PM by Trinity
Australia Forum Administrator #1
Can you also please post the line from the MUD you are trying to match on?
#2
You sell <item> for <number> coins.

Basically, I want to add up the amount of coins I get after selling a load of stuff.

So I would see..
You sell dagger for 10 coins.
You sell leather armor for 15 coins.

And I want to add up the numbers.
Amended on Fri 10 Mar 2006 08:20 PM by Trinity
Australia Forum Administrator #3
Your match text is:


for (?P<coins>) coins\.


You aren't actually trying to match on a number here. You need something like:


for (?P<coins>\d+) coins\.
#4
Thanks! That worked!