Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Fri May 11, 2007 5:05 am   

script specific feedback triggers
 
Is there a shorter way to execute a command midway through a script based on feedback from a mud, other than defining an event or using a standard trigger?
for example i use a heal spell a lot and i'd like to execute a script using it, but only if it works. if it doesnt work i get the feedback "you lost contration casting that spell". If it worked, I get the feedback "you healed"
sooooo
Code:
cast 'heal' jed
put something here to tell if it was successfull or not
north
kill monster

maybe another way to look at it, is some function to to see if a command sent to the mud was successfull or not?
I realize there are ways to do this with triggers or events... just thought I'd check to see if there was a cleaner (easier) way to do it...
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri May 11, 2007 11:44 am   
 
The short answer is triggers are the way to do this.

I'm not sure what other way could be sure. You may be able to check a variable that says whether you were healed or not, but you would still need a trigger to set this variable.

If you think about it, it makes sense. Since your spell and the confirmation text can be so different there's no way for CMUD to tell that it was successful without a trigger. Except perhaps in the rare case where a MUD might push that information to you in a special MXP variable.
_________________
Asati di tempari!
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri May 11, 2007 2:33 pm   
 
I think you are looking for either a command priority system or a priority queue system.

I've been helping progonoi with a priority system that looks like it is either from your mud or one that uses the same engine. So he might be able to help you on a broader scale with your problems if you pm him and explain what you are doing.

More immediately though. You already have a trigger or alias that is sending the nextstep command.

#trigger {You are very weak and about to collapse from your wounds.} {healfailed=1}

#trigger {Your puny magical spell failed, you need more practice.} {healfailed=1}
#trigger {You somehow manage to successfully cast the heal spell.} {healfailed=0}

#if (!@healfailed) {next step} {cast 'heal' jed}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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