Code: namespace Styx.Bot.CustomClasses { /* * TimerLog v1.0 * * Edit logout time: line 33 before you enable plugin * */ using Logic; using System; using Helpers; using Logic.Pathing; using System.Threading; using System.Diagnostics; using Logic.Common.Combat; using Object_Dumping_Enumeration; using CustomCombat.CombatInterface; using Memory_Read_Write_Inject.Lua; using Object_Dumping_Enumeration.WoWObjects; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Xml.Linq; using System.Linq; using System.Net; using System.Windows.Forms; using System.Drawing; using Styx.Plugins.PluginClass; public class AutoLog : HBPlugin { static int logOutAfterMinutes = 1; bool useHearth = true; int logOutAfterMS = logOutAfterMinutes * 60000; private static Stopwatch timer = new Stopwatch(); public override void Pulse() { //Logging.Write("Pulse"); if (!timer.IsRunning) { //Logging.Write("Timer Start"); timer.Reset(); timer.Start(); } if (timer.ElapsedMilliseconds > logOutAfterMS && !ObjectManager.Me.Dead && !ObjectManager.Me.Combat) { //Logging.Write("Timer Elapsed"); if (useHearth) { Logging.Write("Using Hearthstone"); Lua.DoString("UseItemByName(\"Hearthstone\")"); Thread.Sleep(20000); } if (!ObjectManager.Me.Dead && !ObjectManager.Me.Combat) { timer.Stop(); Logging.Write("Quitting WoW!"); Lua.DoString("ForceQuit()"); System.Diagnostics.Process.Start("Shutdown", "-s -t 10"); } } } public override string Name { get { return "TimerLog"; } } public override string Author { get { return "ski"; } } public override Version Version { get { return new Version(1, 0); } } public override bool WantButton { get { return false; } } public override void OnButtonPress() { if (timer.IsRunning) { timer.Stop(); timer.Reset(); } } } }
Alright so I edited it in the Notepad, default was 60000 (which is 166 hours because it's in seconds) to something more manageable then as soon as I start the bot my toon just tries to hearth.
http://www.buddyforum.de/showthread.php?4336-Exit-Timer-(HB1-HB2)&p=50153#post50153 (Test that for me, make sure you download the correct version for the correct version of HB)
60000 is ms. You shouldn't be editing that line. 60000 = 60 seconds. Edit the line; static int logOutAfterMinutes = 1; to be.. static int logOutAfterMinutes = 60; // for 1 hour static int logOutAfterMinutes = 120; // for 2 hours etc