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 Goto page 1, 2  Next
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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

????
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: Thu Nov 12, 2009 4:30 am   
 
i told you use alarm ... south #alarm {+time} {command} ... and you can put alarms in alarms
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
althea06
Newbie


Joined: 12 Nov 2009
Posts: 1

PostPosted: 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.
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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....
Reply with quote
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Thu Nov 12, 2009 5:54 am   
 
I agree with hadar, use #ALARM
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Thu Nov 12, 2009 12:25 pm   
 
I'd use #TRIGGER if possible. If not, then #ALARM.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Nov 12, 2009 4:56 pm   
 
I would use a multistate trigger.
Reply with quote
Zugg
MASTER


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

PostPosted: 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
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Nov 12, 2009 7:32 pm   
 
I never think of #waitfor. I ought to start using it more.
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: 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.
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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?
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Thu Nov 12, 2009 8:18 pm   
 
maybe #abort ?
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: Fri Nov 13, 2009 4:28 am   
 
Yeah Still Looking For A Way To Cancel threads?

individual or all

.......
Thanks
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Fri Nov 13, 2009 4:41 am   
 
maybe #Noop
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Fri Nov 13, 2009 5:01 am   
 
#stop
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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:)
Reply with quote
Zugg
MASTER


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

PostPosted: 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.
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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?
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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}
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: 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}
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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.....
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: 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.
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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....
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: 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.....
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: 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 Smile) you really should stay away from them.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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