|
nostra Wanderer
Joined: 23 May 2001 Posts: 68 Location: Sweden
|
Posted: 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? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jun 06, 2003 5:36 pm |
Use %t1 and %t2.
Kjata |
|
|
|
nostra Wanderer
Joined: 23 May 2001 Posts: 68 Location: Sweden
|
Posted: 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? =) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
nostra Wanderer
Joined: 23 May 2001 Posts: 68 Location: Sweden
|
Posted: 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).. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
|
|