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


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Fri Feb 21, 2003 6:41 pm   

Multi Line Triggers
 
Ok, if the mud outputs:

You fire LargeLaser at Alpha Lynx [zg] - BTH: 2 Roll: 9
You hit for 8 points of damage in the Right Leg

I want a var (di_zg_rl) to equal 8

If I get:
You fire LargeLaser at Alpha Spider [ra] - BTH: 2 Roll: 11
You hit for 8 points of damage in the Left Leg

I want a var (di_ra_ll) to equal 8


Now the problem I am having is that I dont know how to make a multi line trigger. I was thinknig to do 2 triggers liek the following:

#TR {^You fire %w at * ~[(%w)~] - BTH: %d Roll: %d$} {target_id = %1}

then a second trigger
#TR {^You hit for (%d) points of damage in the ({Right Leg|Left Leg|Left Arm|Right Arm})$} {#VAR di_{@target_id}_%1}

(Not sure if that was right syntaxed, but thats a moot point.)

The problem is that first of all it can be coded better. Second is that what if I shoot multiple targets and get the following output all at once....

You fire LargeLaser at Alpha Lynx [zg] - BTH: 2 Roll: 7
You hit for 8 points of damage in the Right Leg
You fire MediumLaser at Alpha Spider [ra] - BTH: 3 Roll: 5
You hit for 5 points of damage in the Left Leg
Alpha Spider [ra]'s Left Leg has been destroyed!
You fire MediumLaser at Alpha Lynx [zg] - BTH: 2 Roll: 3
You hit for 5 points of damage in the Left Arm
You fire MediumLaser at Alpha Spider [ra] - BTH: 3 Roll: 8
You hit for 5 points of damage in the Head

Then the trigger will work too slowly and the variables will get mixed up. Please help.

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 21, 2003 7:16 pm   
 
#TR {You fire * at * ~[(%w)~] *$You hit for (%d) points of damage in the Right Leg} {#VAR di_%1_rl %2}
#TR {You fire * at * ~[(%w)~] *$You hit for (%d) points of damage in the Left Leg} {#VAR di_%1_ll %2}

LightBulb
Advanced Member
Reply with quote
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Fri Feb 21, 2003 8:40 pm   
 
Didnt work

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Feb 22, 2003 1:22 am   
 
Works when I test it.

LightBulb
Advanced Member
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Feb 22, 2003 7:41 am   
 
See here for similar other scripts that track damage.

Ton Diening
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