[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Inventory Triggers.

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Inventory Triggers.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Mon 02 May 2005 09:06 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Mon 02 May 2005 09:28 AM (UTC)  quote  ]

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.
[Go to top] top

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Reply #2 on Mon 02 May 2005 09:36 AM (UTC)  quote  ]
Message
Well, actually.

The sizes can be:tiny, small, medium, large, huge, giant, massive, immense, monsterous, titanic, collosal.

But that's a minor issue.
[Go to top] top

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Reply #3 on Mon 02 May 2005 09:39 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #4 on Mon 02 May 2005 03:10 PM (UTC)  quote  ]

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.
[Go to top] top

Posted by David Berthiaume   (202 posts)  [Biography] bio
Date Reply #5 on Tue 03 May 2005 07:37 AM (UTC)  quote  ]

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.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #6 on Tue 03 May 2005 07:42 AM (UTC)  quote  ]

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.
[Go to top] 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.


2,561 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]