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
➜ Trigger Help
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Virus2796
(3 posts) Bio
|
| Date
| Wed 23 Jul 2003 08:28 AM (UTC) |
| Message
| Ok, I am trying to find a trigger that would match the following....
IS AC/10 (132.00t) 77
Now I have been unable to match that. The reason is that think of...
IS AC/10 (132.00t) 77 and
IS AC/2 (486.00t) 81
apearing right next to each other. I need a way to seperate the ammount of AC/10 (77) from AC/2 (81).
Anyone have any ideas? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Wed 23 Jul 2003 08:35 AM (UTC) |
| Message
| | Can you post your trigger that doesn't work? Find it in the list of triggers, click the "copy" button, and then paste it into a message here. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Virus2796
(3 posts) Bio
|
| Date
| Reply #2 on Wed 23 Jul 2003 08:44 AM (UTC) |
| Message
| To be honest the only thing I have gotten to work is...
<triggers>
<trigger
enabled="y"
match="*IS AC/2 (*)*"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>think %3</send>
</trigger>
</triggers>
The origional Triggered message was..
IS AC/2 (486.00t) 81
Now again the problem with this is if I have 2 side by side... IE
IS AC/2 (486.00t) 81 IS AC/10 (132.00t) 77
it matches
81 IS AC/10 (132.00t) 77
I guess I am just trying to figure out how to just match the number. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Wed 23 Jul 2003 09:09 AM (UTC) |
| Message
| Click on "convert to regular expression" and then fiddle with it to make it match on a number. Something like this:
^.*IS AC/2 \(.*\) (\d+).*$
The \d+ bit means one or more digits. The final .* means zero or more anythings, which would catch the extra one on the end |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Virus2796
(3 posts) Bio
|
| Date
| Reply #4 on Wed 23 Jul 2003 09:43 AM (UTC) |
| Message
| Ok, Im still not getting it to work. I guess I should show you an example of a list I have. If you look at http://btech.virus2796.net/list.bmp youll see what I need to trigger. Now going off that example I am wanting to write a vbscript (once I get teh trigger to work) that will set variables for everything. Something like for example you see the line IS AC/10 (132.00t) <a lot of spaces> 77
I want to eventually save it in a variable called StoresISAC10 with the variable 77. The reason for this is sometimes the number changes, IE if I use some, or if I gain some. What I am looking to do is check a command that shows how much I have gained/lost in teh past 24 hours. Makeing any sense? Ok, so I have the script done, but it all starts with the trigger. I cant seem to get the trigger to run.
Now another problem I am having is we have parts called
'IS AC/10' and then its ammo 'ammo IS AC/10'. Now I need to make triggers for all the parts...blah blah. Any help would be very apreciated. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Wed 23 Jul 2003 09:46 PM (UTC) |
| Message
| This is a start, it matches properly the first one:
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="^.*?IS AC/(\d+) \(.*?\)\s+(\d+).*$"
regexp="y"
send_to="2"
sequence="100"
>
<send>%%1 = %1
%%2 = %2</send>
</trigger>
</triggers>
Your problem is your original post didn't show all the spaces. You need to put [code] and [/code] around parts of the forum posting that you need to preserve their original spacing.
The above will match on:
IS AC/2 (486.00t) 81
IS AC/2 (486.00t) 81 IS AC/10 (132.00t) 77
|
- 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.
18,345 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top