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


Joined: 28 Jan 2010
Posts: 34

PostPosted: Fri Jul 08, 2011 2:33 pm   

#WAITFOR with multiple options?
 
I want to do a search through spellbooks. I take a "look" at the books in a drop room, put them in an array, and "examine" them 1 at a time to see if I need to learn anything from it. I want the script to run smoothly - jump immediately to the next book when I get a MUD response regarding the item I just looked at. But the MUD can be choppy at times, so responses might be occasionally delayed (up to 3-4 seconds). I don't want to put a #WAIT 5000 (waiting 5 seconds) for each item. I want to immediately step to the next item off the responses.

#LOOP %numitems(@book_list)
{
;pull a book form the list to examine
#VAR book_temp %pop(@book_list)
Examine @book_temp
;wait for the MUD to return info on the book

** Here is where I want to insert a #WAITFOR command that takes into account the following 4 options:
You can't learn anything from this book yet.
You can't learn anymore by studying this book.
You haven't learnt anything from this book.
You can still learn more from this book.

}


Any suggestions??
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Jul 08, 2011 4:10 pm   
 
Quite awhile ago, before the v3 Beta series of CMUD I wanted to use #WAITFOR with multiple options as well. At that time you couldn't, not sure if that has been fixed yet or not. But if t has, then you would do it just like with a trigger pattern.

#WAITFOR {{option1|option2|option3|option4|etc...}}

If I remember correctly. I've not made anything in over a year though.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Jul 08, 2011 4:13 pm   
 
Ralgith is correct...you should be able to use any normal trigger pattern in the #WAITFOR command.
Reply with quote
Celerra7
Novice


Joined: 28 Jan 2010
Posts: 34

PostPosted: Mon Jul 11, 2011 3:11 pm   
 
Perfect! Works great. Thanks for the info.
_________________
Celerra7
CMUD Pro v3.34, Win7
slothmud.org:6101
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