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
Zene
Beginner


Joined: 10 Jul 2002
Posts: 26
Location: Canada

PostPosted: Wed Jul 10, 2002 1:21 am   

Yet another identify/trigger/db question
 
Hey...i read all the finished scripts and am having some trouble just getting an idea of how i might capture this piece of information in the identify output:

' Class: Raider Barbarian Valkyrie Tracker
' Marauder Ninja Paladin Poliir
' Footpad Monk

Sometimes its one line..sometimes its 3...i'm not sure how i would capture and then put it into the databse.. (just the 3 line part..i understand for 1 lines and other things)
The onyl thing i could think of is just having a trigger for every class and to cause it to add to a string until the very end of the whole alias/trigger combination when it wil add the variable to the key and then to the database..but is there an easier/shorter way of doing this?

Thanks
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jul 10, 2002 3:37 am   
 
There seems to be a preceeding character that makes this easy. I am guessing a blank line ends the listing.

#ALIAS x {#T+ ClassCap;ClassCapped="";#SEND {some command to get the mud to display wanted info}}
#VAR ClassCapped {}
#CLASS ClassCap {disable}
#TRIGGER {^~' (*)$} {ClassCapped=%concat(@ClassCapped," ","%1")}
#TRIGGER {^$} {ClassCapped=%remove("Class: ",@ClassCapped);#T- ClassCap}
#CLASS 0
Reply with quote
Zene
Beginner


Joined: 10 Jul 2002
Posts: 26
Location: Canada

PostPosted: Wed Jul 10, 2002 7:25 am   
 
Ooops..the ' 's aren't their...i just kind of put them to illustrate that there are a few spaces before the actual "Class:". Would it affect it by just taking out the "~'" part? What the full output that i'm trying to capture looks like is this: Name: a blue mask
---------
Keywords: blue mask
Value: 1,000,000 gold

Bonus: - Hit +1 - Damage +3 - Armor Class +10
- Constitution +2


Class: Raider Barbarian Valkyrie Tracker
Marauder Ninja Paladin Poliir
Footpad Monk
Required: Level 90,
----------
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jul 10, 2002 11:17 am   
 
Ah, I see.

#VAR ClassCapped {}
#TRIGGER {^ Class: (*)$} {ClassCapped="%1");#T+ ClassCap}
#CLASS ClassCap {disable}
#TRIGGER {^ (*)$} {#IF (%pos(":","%1")) {#T- ClassCap} {ClassCapped=%concat(@ClassCapped," ","%1")}}
#CLASS 0

Now I am assuming there will not be a blank line, and there will be another line of id data immediately following at all times.
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