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


Joined: 04 Sep 2002
Posts: 21
Location: USA

PostPosted: Tue Sep 02, 2003 2:40 pm   

SK spells held up trigger
 
Here I am again.

Another question on making a capture for Shattered Kingdoms. I have several characters that are casters, when they are sustained, you type in release to see which spells are held. This is the raw look of the info when it comes from the mud.
Code:
 
oOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOo
 o  #  Spell                Casted On            Concentration   o
 o===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===o
 o  1  armor                Yourself             light           o
 o  2  infravision          Yourself             light           o
 o  3  spirit aura          Yourself             light           o
 oOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOoOOOo

I take out spam lines and garbage to reduce screen clutter and in usually looks like this:
Code:

o  1  armor                Yourself             light           o
 o  2  infravision          Yourself             light           o
 o  3  spirit aura          Yourself             light           o

I have been trying to make a trigger to capture the information, to be displayed in buttons on the side of my screen. The buttons I have already made. Thats the easy part.

I want each column to match up with each spells rank. The variables I have been using are @spell1, @casted1, and @concentration1. Each line begins with the number that I would indicate for that spell (armor, Yourself, light). Ultimately @spell1 should equal armor, @casted1 should equal Yourself, and @concentration1 should be light. Sometimes spells have more than one word names, and sometimes what the spell is casted on, comes up as several words, if it is an area-affect. I counted on at least needing 8-10 of them, and have them numbered up to ten, with default values of nill. I use the first line, in the top example (the one that says # Spell, etc.), to reset all the variables in that class. I was hoping someone could help me to complete this project.

E
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Sep 02, 2003 4:21 pm   
 
Use the &nn syntax in the trigger's pattern to capture a fixed number of characters. I can't check right now, but in the past there used to be a bug when saving whatever a pattern of this kind matched. I believe that this bug is fixed now, but like I said, I can't check right now because I don't have zMUD with me in here.

Anyway, you can use the number that the line provides to know into which variable you must save the values and then use the fixed-width pattern to catch the rest. Example:
#TRIGGER {^o%s(%d)%s(&21)(&21)(&16)o$} {#VAR spell%1 {%trim(%2)};#VAR casted%1 {%trim(%3)};#VAR concentration%1 {%trim(%4)}}

%trim is used to remove the extra spaces picked up by the fixed-with pattern.
Reply with quote
EZE
Beginner


Joined: 04 Sep 2002
Posts: 21
Location: USA

PostPosted: Tue Sep 02, 2003 4:42 pm   
 
You rock!

That worked perfectly!

E
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