Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ VBscript
➜ Trigger won't work
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Trinity
(6 posts) Bio
|
| Date
| Fri 10 Mar 2006 01:57 PM (UTC) Amended on Fri 10 Mar 2006 02:08 PM (UTC) by Trinity
|
| Message
| 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<coins>) coins\."
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable "coins", GetVariable ("coins") + %<coins>
Note "You now have " & GetVariable ("coins") & " coins."</send>
</trigger>
</triggers>
EDIT : When I said they didn't work, I meant that nothing happened. No error messages, no notes, nothing. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 10 Mar 2006 06:46 PM (UTC) |
| Message
| | Can you also please post the line from the MUD you are trying to match on? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Trinity
(6 posts) Bio
|
| Date
| Reply #2 on Fri 10 Mar 2006 08:19 PM (UTC) Amended on Fri 10 Mar 2006 08:20 PM (UTC) by Trinity
|
| Message
| 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. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sat 11 Mar 2006 04:39 AM (UTC) |
| Message
| 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\.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | 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.
15,840 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top