|
Wyndle Beginner
Joined: 28 Mar 2007 Posts: 20 Location: < here and there >
|
Posted: Tue Apr 17, 2007 12:28 am
Need help with a pesky trigger |
I'm working on a CircleMUD trying to build and I'm having a bit of trouble getting the room title line to trigger properly. I need to capture some data from it to keep up on the status window.
Code: |
[97004] A Freshly Made Room [ NONE ] [ Inside ] |
I want to capture each of the elements listed into it's own variable, in order it would be:
RoomVnum
RoomTitle
RoomFlags
RoomSector
So far I've tried setting up string lists for the last two but I just have not had any luck getting it to trigger even once and I suspect it is because I'm not using the string lists correctly. Any suggestions for how to do this? |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Tue Apr 17, 2007 2:42 am |
I would stick it all in a database variable they are pretty easy to work with
#TRIGGER {^~[(%d)~] (*) ~[ (*) ~] ~[ (%x) ~]} {
#ADDKEY Room Vnum {%1}
#ADDKEY Room Title {%2}
#ADDKEY Room Flags {%3}
#ADDKEY Room Sector {%4}
}
And in the status window you could expand each item individually using dot notation
@room.title
or by using %expanddb
%expanddb(@Room)
to keep it all on one line
%expanddb(@Room, " ") |
|
|
|
Wyndle Beginner
Joined: 28 Mar 2007 Posts: 20 Location: < here and there >
|
Posted: Tue Apr 17, 2007 11:50 am |
For the most part that worked, but it isn't working 100%
Code: |
[ 1204] The Immortal Board Room [ IND !TEL ] [ Inside ] |
The above does not trigger, and I bet it may have something to do with the ! on the noteleport flag. Any ideas for a workaround on that one? |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Apr 17, 2007 3:55 pm |
Actually, the reason why it didn't trigger was the space before the number: [ 1204].
Nexela's trigger only allowed for [xxxx] and not [ xxx]. You can go about it two ways...
The first way is to create a separate trigger for this one, and change the first line to be
#TRIGGER {^~[%s(%d)~] (*) ~[ (*) ~] ~[ (%x) ~]} {
Or if nothing else follows the same format as your trigger line, you can just replace the first (%d) with (*).
Charneus |
|
|
|
Wyndle Beginner
Joined: 28 Mar 2007 Posts: 20 Location: < here and there >
|
Posted: Tue Apr 17, 2007 4:23 pm |
Yep, that fixed it.
Good thing I didn't put a $ amount after my bet. |
|
|
|
|
|