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
➜ Inventory Triggers.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Mon 02 May 2005 09:06 AM (UTC) |
Message
| Can't quite figure this out. I'd like to have one trigger when I type inventory, to turn on another trigger that captures my inventory. I HOPE I can do it with 1 trigger, simple because I want to send it to a notepad. So here is what my inventory looks like:You are carrying:
( 4) [small ] a combat boomerang
[small ] a bowl of vegetable soup
[medium ] a block of lead
[large ] a spider-silk bag
So, thats an accurate representation of what things will look like. Is there anyway to make the content capture part of the script a single trigger? Or are things to diverse to make it work? The major problem I see is the ( 4) part. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Mon 02 May 2005 09:28 AM (UTC) Amended on Mon 02 May 2005 09:32 AM (UTC) by Flannel
|
Message
| You could always capture on "you are carrying" too (to turn it on).
^ ( {4}|\( ?\d{1,2}\)) \[(small|medium|large) +\] (.*)$
That will match on that line. if you want to get values from it, I suggest you use named wildcards (because of the optionality of the quantity).
Provided, this only works if you can't have triple digits of something (however that ends up being handled) and that small/medium/large are the only combinations.
Edit: Actually, this looks a little cleaner (or at least, more readable at a glance):
^ ( |\( ?\d{1,2}\)) \[(small|medium|large) +\] (.*)$
The only change is the the four spaces instead of ' {4}' (which is the exact same length textwise, and the field looks more obvious at a glance). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Reply #2 on Mon 02 May 2005 09:36 AM (UTC) |
Message
| Well, actually.
The sizes can be:tiny, small, medium, large, huge, giant, massive, immense, monsterous, titanic, collosal.
But that's a minor issue. | Top |
|
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Reply #3 on Mon 02 May 2005 09:39 AM (UTC) |
Message
| Yeah, um, I need the entire line to be a wildcard.
Something like this trigger I have:<triggers>
<trigger
enabled="y"
match="^(.* oocs \'.*\')$"
name="OOCChannel"
regexp="y"
send_to="5"
sequence="100"
>
<send>%1</send>
</trigger>
</triggers>
Ya know what I mean? So I can send all that info to a notepad? Just matching on it is good for highlighting and stuff. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #4 on Mon 02 May 2005 03:10 PM (UTC) Amended on Mon 02 May 2005 03:11 PM (UTC) by Flannel
|
Message
| You can send the entire line using %0 (or the second parameter of your subroutine, if you're using a script file). That way you won't need to have the entire line be a wildcard. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Reply #5 on Tue 03 May 2005 07:37 AM (UTC) Amended on Tue 03 May 2005 07:45 AM (UTC) by David Berthiaume
|
Message
| Interesting, that works just fine. But... Always a but of course. The problem now is I want it append to the notepad, but whenever I type inventory I want it to clear the current notepad. So I don't have a spammy inventory. Eventually I want to make it so that it keeps itself updated.
EDIT: Yeah, of course, I should read the helpfiles first. BEFORE I post requests like that. I figured it out, I just need to have the initiation trigger close the window first, then have the new one open up. | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #6 on Tue 03 May 2005 07:42 AM (UTC) Amended on Tue 03 May 2005 07:50 AM (UTC) by Flannel
|
Message
| So use your first trigger (the 'You are carrying:' line would be appropriate) and send that to the notepad (using SEND not append) and that will clear the notepad.
If you didn't want the "you are carrying" in the notepad, you could just send a null string or whatever other first line you'd prefer (current time for instance).
Triggering on that to turn your other triggers on (instead of using inventory or whatnot) will also allow the trigger series to work independently on your input (if you ever decide to have a timer update it every minute or whatnot, you can just send, and not worry about making sure to catch the alias).
Edit: Closing/reopening is silly, just clear it with a sendtonotepad. Closing/Reopening loses your sizing and stuff. This way you can keep that. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | 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.
20,513 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top