Inventory Triggers.

Posted by David Berthiaume on Mon 02 May 2005 09:06 AM — 7 posts, 28,188 views.

#0
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.
USA #1
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).
Amended on Mon 02 May 2005 09:32 AM by Flannel
#2
Well, actually.

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

But that's a minor issue.
#3
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.
USA #4
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.
Amended on Mon 02 May 2005 03:11 PM by Flannel
#5
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.
Amended on Tue 03 May 2005 07:45 AM by David Berthiaume
USA #6
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.