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
➜ General
➜ help some help with syntax
help some help with syntax
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Drahcir
(3 posts) Bio
|
Date
| Mon 01 Dec 2008 05:15 AM (UTC) |
Message
| Im trying to make a trigger for a stat roller.
matching the following text:
1) 9
2) 14
3) 8
4) 15
5) 9
6) 9
7) 14
[k to keep, q to quit, h for help, or enter for more choices]:
Here is my code:
<triggers>
<trigger
enabled="y"
lines_to_match="7"
match="(?x) ^1\)s*(?P<str>\d+)\n 2\)s*(?P<dex>\d+)\n 3\)s*(?P<con>\d+)\n 4\)s*(?P<int>\d+)\n 5\)s*(?P<wis>\d+)\n 6\)s*(?P<cha>\d+)\n 7\)s*(?P<lck>\d+)\n \n$"
multi_line="y"
regexp="y"
sequence="100"
>
<send>
total = %<str> + %<dex> + %<con> + %<int> + _
%<wis> + %<cha> + %<lck>
if %<str> < 14 or _
%<dex> < 14 or _
%<con> < 14 or _
%<int> < 14 or _
%<wis> < 14 or _
%<cha> < 14 or _
%<lck> < 14 then
ColourNote "white", "blue", "stats too low"
Send "enter"
else
ColourNote "white", "blue", "accepted stats"
Send "k"
</send>
</trigger>
</triggers>
My trigger is not even firing. I have checked a few of the posts here, but i think the main problem i have is the lines that I have to match:
1) ...
2) ...
Please help,
Thanks | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Mon 01 Dec 2008 06:11 AM (UTC) |
Message
| My first reaction is that spaces are \s not just s, so your s* will match zero or more of the letter "s", not spaces.
Also, what is the maximum stat? If the maximum is 14, and you want all 14s, you might be waiting a few centuries for that to come up. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Drahcir
(3 posts) Bio
|
Date
| Reply #2 on Mon 01 Dec 2008 06:27 AM (UTC) |
Message
| 18 is the maximum stats
I just want to see if the trigger fires.
i changed the code to:
changing to \s+ to signify 1 or more spaces
<triggers>
<trigger
enabled="y"
lines_to_match="7"
match="(?x) ^1\)\s+(?P<str>\d+)\n 2\)\s+(?P<dex>\d+)\n 3\)\s+(?P<con>\d+)\n 4\)\s+(?P<int>\d+)\n 5\)\s+(?P<wis>\d+)\n 6\)\s+(?P<cha>\d+)\n 7\)\s+(?P<lck>\d+)\n \n$"
multi_line="y"
regexp="y"
sequence="100"
>
<send>
total = %<str> + %<dex> + %<con> + %<int> + _
%<wis> + %<cha> + %<lck>
if %<str> < 14 or _
%<dex> < 14 or _
%<con> < 14 or _
%<int> < 14 or _
%<wis> < 14 or _
%<cha> < 14 or _
%<lck> < 14 then
ColourNote "white", "blue", "stats too low"
Send "enter"
else
ColourNote "white", "blue", "accepted stats"
Send "k"
</send>
</trigger>
</triggers>
still not firing
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #3 on Mon 01 Dec 2008 08:13 PM (UTC) |
Message
| You have too many \n at the end of the trigger match. I took one out and it matched.
Also, you need to change it to "send to script" (at present it sends all that script stuff to the world).
Also, you need EndIf to wrap up your If statement. |
- 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.
14,128 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top