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
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 06, 2003 3:11 pm   

Using two variables, from #cond1 and #cond2, how?
 
I have a conditional trigger like this:

Patter: blablabla (%w) (pattern)
#cond yadayada (%w) (loop line | 5) {#ADDKEY %1 %2}

(I'm not used to writing triggers like this so the statement is most likely wrong, but you get the idea).

So, in this conditional trigger I'm producing two variables. The question is how I store both in the record variable (assuming the conditional trigger fires)?

I have tried above without success (it only stores the variable from the #cond trigger, ignoring the first variable).

What to do?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jun 06, 2003 5:36 pm   
 
Use %t1 and %t2.

Kjata
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Mon Jun 09, 2003 5:20 pm   
 
Well, this is not working as I intended :(

Let me give a brief explanation on what I want to achieve:

Zmud Output
Member Roster for Clan #8, Excession (Court):
No. Name Ranking
-----------------------------------------
[ 1] Dessarin King
[ 2] Syrius King
[ 3] Daussaulit Prince
[ 4] Verwin Princess
[ 5] Ganelon Count
[ 6] *Sapphire Baroness
[ 7] Azurian Countess
[ 8] Altena Courtier
[ 9] Adare Duchess
[ 10] Alyn Princess
[ 11] Lathan Baron

I want to store two values (Name and Clan) in a record variable; like this:

Record Variable
Dessarin | Excession
Syrius | Excession
Daussaulit | Excession

etc...,

To achieve this I have tried following:
State1: ^Member Roster for Clan #%d,%s(%w) {Pattern | 0} {}
State2: ^~[%s%d~]%s(%x) {Loop Lines | 35} {#IF (%begins( %t2, "*")) {#ADDITEM list_clanmember %t1 %right( %t2, 1)} {#ADDITEM list_clanmember %t1 %t2}}

But it doesn't store the values as I want to :(

Any ideas? =)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jun 09, 2003 9:20 pm   
 
#TR ClanRoster {Member Roster for Clan ~#%d, (%w)} {#VAR TempClan %1}
#COND {%d~] ?(%w)} {#ADDK list_clanmember %1 @TempClan} {LoopLines|Param=30}
#AL EndRoster {#STATE ClanRoster 0}

This trigger takes the first word after the clan number as the clan name and uses a variable to store it. The second state then checks the next 30 lines for matching patterns and adds member a member listing for each match. Adjust the number as needed, depending on how large clans are on your MUD. I gave the trigger an ID and included an alias so you can easily return the trigger to the first state when you want to do several clans at once.

The second state (the #COND command) is based on your sample output, with a member-number followed by ], then one space followed by either * or another space, and then a one-word name. I used #ADDKEY which creates a record variable instead of #ADDITEM which creates a list variable.

Provided you are satisfied with my choice of variable, trigger, and alias names, it can all be pasted directly to the command line.

LightBulb
Advanced Member
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Tue Jun 10, 2003 2:14 pm   
 
Is there a way to find out if a trigger, ex post, has an ID and if so, which one?

(Once the trigger is written the ID key kinda disappears)..
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 10, 2003 5:21 pm   
 
Good question. Yes, there is. In the Trigger Editor, the ID is shown on the Options tab.

LightBulb
Advanced Member
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