Post your tips here. I'll start with what I've figured out the hard way. My tips apply to OrderBot. Infinite loops Wrap everything you want to execute infinitely in a <While Condition="True"> tag. This is more reliable than trusting OrderBot to loop over your (for instance) Gather tags over and over again. Arbitrary code execution You can execute (some) arbitrary code in the Condition property of the WaitWhile tag. When the code terminates, the ScriptExecutor will assume the Condition was met. For instance, I'm running an infinite loop to check for unspoiled mining nodes in a certain zone, but I only want to check once a minute so I'm not wasting CPU cycles. I accomplish this with the following tag: <WaitWhile Condition="Thread.Sleep(60000)" /> I imagine you could drop a class in a plugin folder and invoke a fully-qualified method this way, but I haven't tried it. It's certainly easier than any other approach to arbitrary code execution that I've found.
I get that you are trying to help people, but honestly you would have just confused a large section of this bots users with what you wrote, not to mention how you are handling a sleep or timer effect is not the best way to do so. Also, your While Condition = True is right, theres a good amount of things that it will 'break' when using it with gathering from my experiences.
Quick clarification. The condition argument actually returns void, which means it wasn't met. WaitWhile continues to run until the condition returns something that evaluates to false. I'm pretty sure the rebornbuddy ui gets suspended if you call sleep on the main thread, meaning you can't even hit stop in the bot window. This is potentially harmful and should be avoided. To execute arbitrary c# code, you can use the runcode tag: Code: <Profile> <KillRadius>50</KillRadius> <CodeChunks> <CodeChunk Name="CastReturn"> <![CDATA[ ChatManager.SendChat("/generalaction Return"); ]]> </CodeChunk> </CodeChunks> <Order> <RunCode Name="CastReturn" /> </Order> </Profile>
Didn't know about it. I haven't been able to find a reference for supported tags. WaitWhile seems to continue waiting provided the Condition continues to return True. This is demonstrated in multiple profiles. What I have provided shows that not only will WaitWhile stop waiting if either False or Void is returned. I suspect it will stop waiting if anything other than True is returned. I haven't had a problem stopping the bot with this profile running. Works just fine.
Would be good to get all the different tags listed in a thread though, OrderBot seems to have 100s of features at this point.