 |
Celerra7 Novice
Joined: 28 Jan 2010 Posts: 34
|
Posted: 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?? |
|
|
 |
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: 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 |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jul 08, 2011 4:13 pm |
Ralgith is correct...you should be able to use any normal trigger pattern in the #WAITFOR command.
|
|
|
 |
Celerra7 Novice
Joined: 28 Jan 2010 Posts: 34
|
Posted: Mon Jul 11, 2011 3:11 pm |
Perfect! Works great. Thanks for the info.
|
|
_________________ Celerra7
CMUD Pro v3.34, Win7
slothmud.org:6101 |
|
|
 |
|
|