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
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Thu Mar 04, 2010 12:31 am   

Need help getting around the use of the #Waitfor command
 
This is my current use, and works fine, everyone seems to be against the wait and waitfor commands though. Therefore I am looking for a solution.

Code:

<trigger priority="10490" id="1049">
  <pattern>One of the lord's retainers is here keeping an eye on the lord's lands.</pattern>
  <value>#class korerunskill 0
#class korerunswalk 0
#suspend korerunsbot
susp
k retain
#WAITFOR {You hit (%d) times for an average (%d) damage} 8000 {#noop} {k retain}</value>
</trigger>


I dabbled a little with loop expression but just kept spamming myself out.

Thanks in advance!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Mar 04, 2010 2:32 pm   
 
It is not that everyone is against the #wait and #waitfor commands, it is that when you use those commands, you must be aware of the thread issues. For most simple uses, there is no problem. Problems usually arise if you write your code in such a way that a trigger might end up producing multiple threads all waiting for the same thing when you only expected one to run at a time, or when other threads are changing the same variables that your thread is using. These situations can usually be handled as well, if you understand how threads work.

I'm not sure offhand whether your code would have threading problems. If your code is working, go ahead and use it. You might be able to do something similar with a multistate trigger. I take it that sometimes your kill command doesn't actually start the combat you want, so you have to execute it a second time?
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Fri Mar 05, 2010 2:19 am   
 
True, from time to time the command kill so and so will not connect. It may happen only one time, although I have seen it happen 3 times in a row. I tried using a multi-state trigger using Loop Expression, and triggered it off a blank line. This spammed me so bad I just went back to the old way.

One reason why I would like to find a better way is because this way only works one time. If the kill command does not connect 2 times in a row my character will not try a third time.

To comment on the thread issue, I don't even know what a thread is!

Well, thanks again!
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