• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Timer for Honorbuddy?

    Discussion in 'Archives' started by gregmaster25, May 1, 2010.

    1. gregmaster25

      gregmaster25 New Member

      Joined:
      Apr 30, 2010
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      Is there a way to get honor buddy to turn off after x amount of hours? Instead of basing it on level
       
    2. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      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();
                  }
              }
      
          }
      }
      
       
    3. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      That's for hb1 btw. Here it is as a straight plugin.
       

      Attached Files:

    4. gregmaster25

      gregmaster25 New Member

      Joined:
      Apr 30, 2010
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      Thank you very very much, I haven't thanked you for all your help today!
       
    5. gregmaster25

      gregmaster25 New Member

      Joined:
      Apr 30, 2010
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      I can't seem to get into the Settings of TimerLog, how do you do that?
       
    6. khurune

      khurune Member

      Joined:
      Jan 15, 2010
      Messages:
      836
      Likes Received:
      4
      Trophy Points:
      18
      Using hb1.331 or beta 7?
       
    7. japjap

      japjap New Member

      Joined:
      Apr 9, 2010
      Messages:
      89
      Likes Received:
      0
      Trophy Points:
      0
      Interesting.. :) I shall investigate!
       
    8. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      Notepad.
      filler
       
    9. gregmaster25

      gregmaster25 New Member

      Joined:
      Apr 30, 2010
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      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.
       
    10. khurune

      khurune Member

      Joined:
      Jan 15, 2010
      Messages:
      836
      Likes Received:
      4
      Trophy Points:
      18
    11. abrie2010

      abrie2010 New Member

      Joined:
      Mar 12, 2010
      Messages:
      356
      Likes Received:
      3
      Trophy Points:
      0
      60,000 seconds is 16.6 hours. not 166 hours.
       
    12. Millz

      Millz Well-Known Member Buddy Store Developer

      Joined:
      Jan 15, 2010
      Messages:
      6,495
      Likes Received:
      223
      Trophy Points:
      63
      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
       

    Share This Page