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
Duindain
Novice


Joined: 14 Feb 2003
Posts: 31
Location: Perth, Australia

PostPosted: Fri Feb 14, 2003 6:59 pm   

location trigger
 
ok i am trying to get a trigger that will cast a location spell at a different target from a list or array working on each target one at a time until sucsess then moving on to the next one
there are three different outputs from the mud
You lost your concentration trying to cast locate object!
when the locate spell works there is no common output different every time cant use that and
Cannot find the target of your spell!
ok this is what ive made
#VAR awq %array( blade, ashes, apron, mountain, mauve, essence, injustice, shadow, demi, conquest, wood titan, forest, hill, bejeweled, cartilage, trident, dolphin, everlasting, serpent, atlantean, ripple, royal, epona, crown, ery, skulls, ward, mid, firin)
recast=0
diblet=0
arraylength=0
#UNTIL (@arraylength = 27) {
c 'locate' %arrget( awq, @diblet)
#wa 3000
#IF ("You lost your concentration trying to cast locate object!") {recast=1}{recast=0}
#IF ("Cannot find the target of your spell!") {recast=0}
#until (@recast=0) {
c 'locate' %arrget( awq, @diblet)
#wa 3000
#IF ("You lost your concentration trying to cast locate object!") {recast=0}{recast=1}
}
#add diblet 1
#add arraylength 1
}
it gets the names from the array fine however it casts every spell twice and the if statements dont seem to be catching the output at all cause it isnt recasting for fails its late heh i could prolly fix this if i sleep for awhile anyway any help is appreciated feel free to show a better way to do this rather than fixing my code to
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Fri Feb 14, 2003 7:18 pm   
 
A couple things: %array is fine, but consider using a string list, they are much more flexible.
Second, #IF doesn't work like a trigger, what your looking for is:

#TRIGGER {You lost your concentration trying to cast locate object!} {recast=1}
#TRIGGER {Cannot find the target of your spell!} {recast = 0}

or something along those lines

--------

moon.icebound.net:9000
Reply with quote
Duindain
Novice


Joined: 14 Feb 2003
Posts: 31
Location: Perth, Australia

PostPosted: Fri Feb 14, 2003 8:09 pm   
 
i got it to work now is fantastic heh damn that took far longer than it should anyway i printed the code of so i wasent squinting at a tiny box in zmud and it took 10mins to fix heh the trigger stuff helped but there was a fair few holes in it to the inner do while was why the repeating and it also could never break out of the inner do while anyway thx
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