|
Zene Beginner
Joined: 10 Jul 2002 Posts: 26 Location: Canada
|
Posted: 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 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Zene Beginner
Joined: 10 Jul 2002 Posts: 26 Location: Canada
|
Posted: 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,
---------- |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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. |
|
|
|
|
|