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
gerojeng
Newbie


Joined: 06 Nov 2004
Posts: 1

PostPosted: Sat Nov 06, 2004 12:11 pm   

How to set a trigger to know wether a cast is succeeded ?
 
[Begin]
if Someone ask you 'bless XXX'
cast 'bless' XXX
Set status = cast

if receive 'cast succeeded!' and status = cast
say 'Finished!!'
status = nothing
else if receive 'ohhhh...,cast failed' and status = cast
say 'Sorry , please ask me to cast again :('
status = nothing
[END]

How do I let the logic above write as a trigger ?
Who can help me ? thx :-)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Nov 06, 2004 1:00 pm   
 
#TRIGGER {(%x) asks you 'bless'} {cast 'bless' %1;#VARIABLE cast 1}
#TRIGGER {cast succeeded!} {#IF @cast=1 {say Finished!!;#VARIABLE cast 0}}
#TRIGGER {ohhhh...,cast failed} {#IF @cast=1 {say Casting failed ask again;#VARIABLE cast 0}}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Sat Nov 06, 2004 2:46 pm   
 
I'd recommend that you put the spell you want to cast into a variable, then if the spell fails, you automatically cast the spell again, and if it then succeeds, THEN stop casting it. That way the person won't have to ask you to cast it again.

so basicallyou make a #variable spell {cast 'bless' %1} then use @spell to cast it. And if the spell fails, you do @spell again. Then once it succeeds, it'll automatically stop casting it. (If you use nexela's code...)
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