What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Plugin pause question.

Megser

Well-Known Member
Joined
Apr 17, 2010
Messages
1,389
Reaction score
73
Okay, so. What I would like the plugin to do is to stop injecting/pulsing or what you call it after executing a command. Thread.Sleep doesn't work the way I want since it stops the bot completely.

For example, I need to clear a target so I put in the plugin:

Lua.DoString("RunMacroText('/cleartarget')");
(Here I want it to pause 12 seconds, but still HB should execute)


Thanks in advance.
 
insert a timer, something like:
private static Stopwatch Timer = new Stopwatch();

if (Timer.Elapsed.TotalSeconds < 12)
return;
 
Thanks for your help but I can't get it to work, I get this error:


PHP:
[16:26:09:018] Plugin from C:\Users\Andre\Desktop\Fr?schi fr?sch\Plugins\Shak questing.cs could not be compiled! Compiler errors:
[16:26:09:018] File: Shak questing.cs Line: 78 Error: Det gick inte att hitta typ- eller namnomr?desnamnet Stopwatch (saknas ett using-direktiv eller en sammans?ttningsreferens?)

Here's a somewhat translation:

PHP:
[16:26:09:018] Plugin from C:\Users\Andre\Desktop\Fr?schi fr?sch\Plugins\Shak questing.cs could not be compiled! Compiler errors:
[16:26:09:018] File: Shak questing.cs Line: 78 Error: Could not locate type- or namearea Stopwatch (is a using-direktiv missing or a structure reference?)

Code looks like this:

PHP:
<-- all normal stuff up here -->
        private static LocalPlayer Me { get { return ObjectManager.Me; } }
        private static Stopwatch Timer = new Stopwatch();
        bool IsAttached27964 = false;
        #region List
... -->

PHP:
#region Quest 27771
    if (Me.QuestLog.GetQuestById(27771) != null && !Me.QuestLog.GetQuestById(27771).IsCompleted)
            {
                while (Me.QuestLog.GetQuestById(27771) != null && !Me.QuestLog.GetQuestById(27771).IsCompleted)
                {
						Lua.DoString("RunMacroText('/cleartarget')");
						if (Timer.Elapsed.TotalSeconds < 12)
						return;
                }
            }
 
Back
Top