|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Thu Nov 12, 2009 4:14 am
A Better Way? |
I want to do this but theres gotta be a better way.......
south
#wa 30000
humble king
#wa 60000
fool jester
s
#wa 90000
say id like to take the trollie please
#wa 120000
enter trollie
#wa 150000
sleep
???? |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Thu Nov 12, 2009 4:30 am |
i told you use alarm ... south #alarm {+time} {command} ... and you can put alarms in alarms
|
|
|
|
althea06 Newbie
Joined: 12 Nov 2009 Posts: 1
|
Posted: Thu Nov 12, 2009 4:45 am |
I truly confused on what you have stated. I really want to help you out with this, but I need further clarifications on this.
|
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Thu Nov 12, 2009 5:33 am |
after you go south if you do not humble king the guards throw you out,
after you humble him you gotta wait a few minutes and a jester will come in
after the the jester comes in you have to fool him and wait till he gets angry and walks away
then I can get by him and request a trollie "wich you have to wait for and enter a trollie to the treasure room,
which is like 3 minute ride... and then I was gona sleep after the trollie drops me before I fight the dragon....
Repeating quest, and it take like 20 minute to get thru that...
I just done it like 2000+ times, and would like to just auto thru it.... |
|
|
|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Thu Nov 12, 2009 5:54 am |
I agree with hadar, use #ALARM
|
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Thu Nov 12, 2009 12:25 pm |
I'd use #TRIGGER if possible. If not, then #ALARM.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Nov 12, 2009 4:56 pm |
I would use a multistate trigger.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 12, 2009 5:16 pm |
Actually, rather than waiting a specific amount of time, I'd probably just use the #WAITFOR command to wait for the specific text from the MUD. There isn't anything wrong with using #WAIT commands in CMUD anymore since it became multi-threaded. The only difficulty to watch out for is if you do something that causes multiple scripts to end up running at the same time. For example, if your alias to run this script is called "doquest", then you'll just want to make sure you don't run "doquest" again while a previous one is still running. You can use the #THREAD command to see if one is already running.
But here is what I would do:
Code: |
#ALIAS doquest {
south
#waitfor {the king is here (or whatever the mud says)} 30000
humble king
#waitfor {the jester comes in} 60000
fool jester
s
#waitfor {the trollie arrives} 90000
say id like to take the trollie please
#waitfor {the trollie is here} 120000
enter trollie
#waitfor {time to sleep} 150000
sleep
} |
Also check the numbers. I see that they keep increasing. In my example, the times should be the maximum amount of time you want to wait for the step before aborting the script since the LAST step. And obviously you'll need to fill in the #WAITFOR text with the actual text shown by the MUD that you want to trigger on.
Yes, you can also do this with Multistate triggers. But for something as simple as this example where you are just sending commands to the MUD, CMUD was specifically designed to make this easy using the #WAITFOR command. |
|
Last edited by Zugg on Fri Nov 13, 2009 4:56 pm; edited 1 time in total |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Nov 12, 2009 7:32 pm |
I never think of #waitfor. I ought to start using it more.
|
|
|
|
Josiah.Bruns Apprentice
Joined: 04 Mar 2007 Posts: 103
|
Posted: Thu Nov 12, 2009 8:12 pm |
nested waitfor's can start to get complicated with the brackets and stuff so i like to use seperate events as much as possible.
|
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Thu Nov 12, 2009 8:14 pm |
thanks ZUGG that was the command I was looking for..
works perfectly
Also is tehre a way to diaable/cancel all threads? |
|
|
|
Josiah.Bruns Apprentice
Joined: 04 Mar 2007 Posts: 103
|
Posted: Thu Nov 12, 2009 8:18 pm |
maybe #abort ?
|
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 4:28 am |
Yeah Still Looking For A Way To Cancel threads?
individual or all
.......
Thanks |
|
|
|
Josiah.Bruns Apprentice
Joined: 04 Mar 2007 Posts: 103
|
Posted: Fri Nov 13, 2009 4:41 am |
maybe #Noop
|
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Fri Nov 13, 2009 5:01 am |
#stop
|
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 6:09 am |
Scripting Useing #waitfor
If you disable a class, does it disable the thread? Can You Pause or Suspspend A Thread? Restart?
How Do ?YOU Control The Different Threads via manage
Thread Help Is not newb freindly
The #waitfor help file is perfect tho:) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Nov 13, 2009 4:57 pm |
Once a thread is running, disabling the class does *not* disable the thread. You can suspect a thread with #SUSPEND and resume it with #RESUME and stop it with #STOP
I agree that *nested* Waitfors can get complicated, but in the case discussed in this post, they are not nested so they are exactly the situation that #waitfor was designed to handle. |
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 5:07 pm |
how do you point to that thread? like #suspend thread 1?
can You #supsend thread all?
and does #stop thread can it ?
lol I jsut did #stop 1 and crashed it:P
is there a way to view independant threads? where there at, what there doing? |
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 5:34 pm |
can you make 2 triggers in one?
like Pattern
#waitfor {(You trip over a Rattlesnake.)%or(You step on a Rattlesnake.)} 30000 {search bushes} {thrash bushes} |
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Fri Nov 13, 2009 6:00 pm |
Use alternation in the pattern for #waitfor.
Code: |
#waitfor {You {trip over|step on} a Rattlesnake.} 30000 {search bushes} {thrash bushes} |
|
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 6:14 pm |
I was actully only just the rattlesnake as example there not acctully 2 matching matching patterns like that.....
|
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Fri Nov 13, 2009 6:17 pm |
It's still the case that alternation in the pattern will let you match different lines of text, letting you have 'two triggers in one' like you put it.
|
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 7:43 pm |
how do you point to that thread? like #suspend thread 1?
can You #supsend thread all?
and does #stop thread can it ?
lol I jsut did #stop 1 and crashed it:P
is there a way to view independant threads? where there at, what there doing?
also related, I was researching a little, and was wandering if the #section command could be usefull at all.... |
|
|
|
daemoan.vermillious Apprentice
Joined: 28 Feb 2009 Posts: 135 Location: Chico, Ca
|
Posted: Fri Nov 13, 2009 8:02 pm |
yeah why does cmud freeze\lag when Iam clearing the threads, kinda annoying, I have to force close it and reopen.....
|
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Fri Nov 13, 2009 9:37 pm |
daemoan.vermillious wrote: |
how do you point to that thread? like #suspend thread 1?
can You #supsend thread all?
and does #stop thread can it ?
|
There's no built in way to get a list of all active threads other than doing #THREAD and triggering off the list it shows I suppose. If you need to stop a thread from another script make sure you name your thread and then you can do "#stop %threadid(<thread name here>)".
daemon.varmillious wrote: |
lol I jsut did #stop 1 and crashed it:P |
Thread 1 is the main thread, and is among other things, your connection to the mud. You should basically never stop thread 1.
daemon.varmillious wrote: |
is there a way to view independant threads? where there at, what there doing? |
#thread by itself will show you a list of all active threads.
daemon.varmillious wrote: |
also related, I was researching a little, and was wandering if the #section command could be usefull at all.... |
If you have threads that are modifying global variables then #section is useful.
Why are you trying to mess with threads directly at all by the way? You shouldn't have to if all you're doing is #waitfor's and such. Zugg specifically designed things so using those commands lets you ignore the threads underneath. As you can see, threads can get complicated and if you don't know what you're doing with them (and no offense, that appears to be the case ) you really should stay away from them. |
|
|
|
|
|