• Visit Rebornbuddy
  • [Plugin] Let me drive - Plugin that pauses the bot to allow you to move freely

    Discussion in 'Plugins' started by elvatoloco, Mar 25, 2014.

    1. jearl31

      jearl31 New Member

      Joined:
      Nov 6, 2010
      Messages:
      15
      Likes Received:
      1
      Trophy Points:
      3
      where can i find blank profile?

      sorry still new to DB
       
    2. itraxx

      itraxx New Member

      Joined:
      Feb 2, 2013
      Messages:
      147
      Likes Received:
      0
      Trophy Points:
      0
      Would it be possible to give us the chance to choose the key wich pauses the bot. I would like to assign it to a different key.

      Secondly, would itr be possible to activate/deactivate the pause by keypress like on/off. For example press F5 to activate the pause and press F5 again to resume.

      Thanks
      itraxx
       
    3. elvatoloco

      elvatoloco New Member

      Joined:
      Feb 19, 2010
      Messages:
      62
      Likes Received:
      0
      Trophy Points:
      0

      All are possible, I'm researching them. I would love a toggle, or option to choose your key. Right now, if you edit the CTRL version, you can change it to any modifier key like shift, alt,ctrl.
       
    4. itraxx

      itraxx New Member

      Joined:
      Feb 2, 2013
      Messages:
      147
      Likes Received:
      0
      Trophy Points:
      0
      Cool elvatoloco. Can you tell me how I have to edit the code to assign the pause function to SPACE?

      Many thanks
      itraxx
       
    5. DarkOS

      DarkOS New Member

      Joined:
      Jun 15, 2012
      Messages:
      213
      Likes Received:
      0
      Trophy Points:
      0
      it appears this plugin drops the ticks/sec down to like 3-4. anyone else notice this?
       
    6. net2knight

      net2knight New Member

      Joined:
      Feb 15, 2013
      Messages:
      29
      Likes Received:
      0
      Trophy Points:
      1
      yes,I found this plugin will decrease my db tps from 15 to about 6,
       
    7. Refrakt

      Refrakt New Member

      Joined:
      Dec 18, 2011
      Messages:
      130
      Likes Received:
      0
      Trophy Points:
      0
      with the new trinity version .13 with lazyraider (hold left), does we still.this plugin?
       
    8. Kjin

      Kjin New Member

      Joined:
      Feb 13, 2013
      Messages:
      287
      Likes Received:
      1
      Trophy Points:
      0
      Nope, it got included in Demonbuddy I believe.
       
    9. elvatoloco

      elvatoloco New Member

      Joined:
      Feb 19, 2010
      Messages:
      62
      Likes Received:
      0
      Trophy Points:
      0
      Updated LetMeDriveCTRL to version 1.1

      - Fixed TPS issues. Timwang and Redanon
       
    10. nami69

      nami69 New Member

      Joined:
      Apr 27, 2014
      Messages:
      3
      Likes Received:
      0
      Trophy Points:
      0
      Thanks for the plugin. Love your idea.
      How do I reverse this plugin function to use?
      How can you make the bot to start when I press/hold down CTRL Key?
      So when I am not pressing the CTRL KEY the bot is in stop status.
      Is it possible to change CTRL key to different key such as A?
       
    11. bebbelito

      bebbelito New Member

      Joined:
      Aug 14, 2013
      Messages:
      12
      Likes Received:
      0
      Trophy Points:
      1
      sorry for asking but should you folder go in routines or the files in seperate folder ? im a noob :p
       
    12. GIVEMEANAME

      GIVEMEANAME Active Member

      Joined:
      Dec 17, 2010
      Messages:
      1,533
      Likes Received:
      13
      Trophy Points:
      38

      its built into trinity, you dont need this plugin no more
       
    13. Cr0nJ0b1

      Cr0nJ0b1 New Member

      Joined:
      May 7, 2014
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      I really like this plug-in. I think the trinity version only uses right click, which doesn't work for me since I want to actually play the game while being followed...if possible. For some reason, though the simple follow stops when I use LMD. I would guess that the master stops sending positions or something.
       
    14. SIL3N7

      SIL3N7 Active Member

      Joined:
      Jun 12, 2012
      Messages:
      1,119
      Likes Received:
      11
      Trophy Points:
      38
      Im here too bump this so people can find it and try it.
       
    15. Delagyela

      Delagyela New Member

      Joined:
      Oct 9, 2011
      Messages:
      38
      Likes Received:
      0
      Trophy Points:
      0
    16. icedia004

      icedia004 Member

      Joined:
      May 22, 2014
      Messages:
      102
      Likes Received:
      1
      Trophy Points:
      16
      Very Very Good.

      It is very useful.

      When I try to escape stuck on some area or try to make a some short cut.

      Surely I want AFK. But it is useful when I Front of Keyboard.

      Good! Good! :cool:

      Very thank you,.
       
      Last edited: Sep 27, 2015
    17. SmurfL

      SmurfL New Member

      Joined:
      Sep 20, 2015
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      1
      Awesome!

      Could you make it pause when you press CTRL and unpause when you press it again? Thanks!
       
    18. Elektrozoider

      Elektrozoider Member

      Joined:
      Jun 4, 2015
      Messages:
      114
      Likes Received:
      9
      Trophy Points:
      18
      HI

      The original LetMeDriveCTRL/LazyRaider plugin has some design issues.

      1st: LetMeDriveCTRL can't handle the window on which the CTRL key was pressed, so when you press that key on any other window, the bot will be stopped.
      ......The same happens for LazyRaider when pressing left mouse button on a window, so just doing your common things on your PC it will stop the Bot everytime.
      2st: LetMeDriveCTRL and LazyRaider can't handle multiple instances of Diablo III because the 1st reason.

      LetMeDriveCTRL is very useful, but Lazy Raider is a feature that I really can't understand why exists,
      because if the user needs to stop the bot to perform manual actions on the hero, that means the left mouse button should be free to use properlly on the D3 UI (to click on menus to select options, or to move, etc),
      but since now Lazy Raider handles mouse buttons instead keyboard keys, the Bot resumes when left mouse button is released, then this plugin, in my oppinion, has really any sense.

      In resume, we can say that LetMeDriveCTRL is very useful to pause the Bot to do any thing on the D3 client window using your mouse, and Lazy Raider is the opposite, it's useful to move your hero from a stuck and nothing nore (at least I can't find any other reason to use it) but... hey, you already can go out from a stuck using the mouse button without any plugin (yes, it doesn't stops the bot, it will interfere with the bot movement, but it just need one click) so as I said in my oppinion is very absurd the implementation of Lazy Raider feature, it should handle keys as did it before, no mouse buttons.

      So, if someone want to get back the functionality of LetMeDriveCTRL, with the bugs fixed, with logic improved, and with the key configurable, then you could use the plugin that I developed.

      Note that the key is configurable, yes, but in a hardcoded way on the next variable:
      By default (left)CTRL key is established to stop the Bot, but you can specify any element of the WPF System.Windows.Input.Key enumeration (don't confuse with WinForms System.Windows.Forms.Keys enumeration, that is not compatible).

      Code:
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Linq;
      using System.Runtime.InteropServices;
      using System.Security;
      using System.Windows.Forms;
      using System.Windows;
      using System.Windows.Input;
      using Key = System.Windows.Input.Key;
      
      using Zeta.Bot;
      using Zeta.Bot.Logic;
      using Zeta.Bot.Profile;
      using Zeta.Common;
      using Zeta.Common.Plugins;
      using Zeta.TreeSharp;
      
      namespace LetMeDrive {
      
          internal class SafeNativeMethods {
      
              [DllImport("user32.dll", SetLastError = false)]
              [SuppressUnmanagedCodeSecurity()]
              internal static extern IntPtr GetForegroundWindow();
      
              [DllImport("user32.dll", SetLastError = true)]
              [SuppressUnmanagedCodeSecurity()]
              internal static extern int GetWindowThreadProcessId(IntPtr hwnd, out int pid);
      
              [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
              [SuppressUnmanagedCodeSecurity()]
              internal static extern short GetKeyState(int virtualKey);
      
              internal const int KEY_PRESSED = 0x8000;
          }
      
          public class Logic : IPlugin {
      
              private Key Mykey = Key.LeftCtrl;
      
              public string Author { get { return "Elektro"; } }
              public string Description { get { return "LetMeDrive"; } }
              public string Name { get { return "LetMeDrive " + Version; } }
              public Version Version { get { return new Version(1, 0); } }
              public Window DisplayWindow { get { return null; } }
              public bool Equals(IPlugin other) { return (other.Name == Name) && (other.Version == Version); }
      
              private bool IsPauseRequested() {
      
                  int virtualKey = System.Windows.Input.KeyInterop.VirtualKeyFromKey(this.Mykey);
                  bool keyIsPressed = Convert.ToBoolean(SafeNativeMethods.GetKeyState(virtualKey) & SafeNativeMethods.KEY_PRESSED);
      
                  if (!keyIsPressed) {
                      return false;
      
                  } else {
                      Process[] d3procs = Process.GetProcessesByName(processName: "Diablo III").ToArray();
      
                      if (d3procs.Any()) {
                          try {
                              int[] d3pids = (from p in d3procs select p.Id).ToArray();
                              IntPtr activeWindow = SafeNativeMethods.GetForegroundWindow();
                              int activePid;
                              SafeNativeMethods.GetWindowThreadProcessId(activeWindow, out activePid);
                              Process actideProc = Process.GetProcessById((int)activePid);
                              return d3pids.Contains(actideProc.Id);
                          } catch {
                              return false;
                          }
                      } else {
                          return false;
                      }
                  }
              }
      
              public void OnPulse() {
                 if ((!BotMain.IsPaused && IsPauseRequested()) || BotMain.IsPaused && !IsPauseRequested()) {
                        BotMain.PauseWhile(IsPauseRequested);
                     }
              }
      
              public void OnInitialize() {}
              public void OnEnabled()    {}
              public void OnDisabled()   {}
              public void OnShutdown()   {}
      
          }
      
      }
       
      Last edited: Apr 24, 2016
    19. tata01

      tata01 Member

      Joined:
      Jan 11, 2012
      Messages:
      138
      Likes Received:
      0
      Trophy Points:
      16
      Is it realy working for the actual bot ?
       
    20. Daggo

      Daggo Member

      Joined:
      May 15, 2012
      Messages:
      61
      Likes Received:
      1
      Trophy Points:
      8
      Great code, now can you make it a toggle instead of while pressed?
       

    Share This Page