Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Wyndle
Beginner


Joined: 28 Mar 2007
Posts: 20
Location: < here and there >

PostPosted: 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?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: 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, " ")
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Wyndle
Beginner


Joined: 28 Mar 2007
Posts: 20
Location: < here and there >

PostPosted: 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?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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
Reply with quote
Wyndle
Beginner


Joined: 28 Mar 2007
Posts: 20
Location: < here and there >

PostPosted: Tue Apr 17, 2007 4:23 pm   
 
Yep, that fixed it.

Good thing I didn't put a $ amount after my bet.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net