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


Joined: 04 Mar 2004
Posts: 24
Location: Australia

PostPosted: Tue May 18, 2004 5:22 pm   

Multiline trigs
 
Just wondering how its possible to achieve the following

I cast a spell 'aura detection' at a player and receive a list of its 'prots'


You detect Armour of aether and Unstun.

this works fine with the following trig

#TRIGGER {^You detect (*).} {#var suojat %replace(%replace("%1",one)," "," ");#IF (@aurat!="") {p' @aurat has: %replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(%replace(@suojat,Unstun,Uns),Shield of faith,Sof),Unpain,Unp),Protection from evil,Pfe),Soul shield,SS),Force shield,Fsh),Blessing of tarmalen,Bot),Flex shield,Flex),Force absorption,Fab),Toxic dilution,Td),Magic dispersion,Md),Heat reduction,Hr),Frost insulation,Fi),Energy channeling,Ec),Corrosion shield,Cs),Ether boundary,Eb),Infravision,Inf),Blurred image,Blur),Displacement,Disp),Shield of protection,Sop),Iron will,Iw),Invisibility,Invis),Protection from good,Pfg),Earth power,Epow),See invisible,Sinv),Regeneration,Regen),Heavy weight,Hw),See magic,Seemag),Aura of hate,Aoh),Pain threshold,Phold),War ensemble,War),Melodical embracement,Melody).};#var suojat {} {};#var aurat {} {}}


however, sometimes there is many of these prots and it may take 1-3 lines

You detect Shield of detoxification, Shield of protection, Armour of aether, Heat reduction, Unstun, Frost insulation and Force shield.

i want to be able to capture the trig and report back what is captured, regardless of the number of lines. The other difficulty is that the line breaks will of course be varied.

Thanks in advance
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue May 18, 2004 7:48 pm   
 
The only problem seems to be
#IF (@aurat!="")
but of course @aurat probably will always be a nullstring since you set it to a null value and default value every time this trigger fires. You should probably use
#IF (@suojat != "")
instead.
Reply with quote
a5hi5m
Beginner


Joined: 04 Mar 2004
Posts: 24
Location: Australia

PostPosted: Wed May 19, 2004 1:59 am   
 
ahh. I have a another trigger that automatically fills the @aurat variable when i cast the spell initially.

what i want to be able to do is have the tigger respond, regardless of where a newline may occur. I guess its harder to see here, as the initial post didnt show a linebreak anywhere in there. The place of the line break will vary depending on the number of 'prots', and the length of their names.

eg

You detect Frost insulation, Corrosion shield, Psychic sanctuary, Blurred
image, Toxic dilution, Shield of protection, Heat reduction, Energy channeling
and Force absorption.

or
You detect Energy channeling, Psychic sanctuary, Heat reduction, Frost
insulation, Corrosion shield, Force absorption and Toxic dilution.

I have tried changing the line cutter length, with didnt help. Obviously i could remove the . at the end of the trigger however this only captures the first line, not subsequint lines.

Thanks again!
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