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

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

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
 
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


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.
 
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.

Cool elvatoloco. Can you tell me how I have to edit the code to assign the pause function to SPACE?

Many thanks
itraxx
 
it appears this plugin drops the ticks/sec down to like 3-4. anyone else notice this?
 
with the new trinity version .13 with lazyraider (hold left), does we still.this plugin?
 
Updated LetMeDriveCTRL to version 1.1

- Fixed TPS issues. Timwang and Redanon
 
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?
 
sorry for asking but should you folder go in routines or the files in seperate folder ? im a noob :P
 
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.
 
Im here too bump this so people can find it and try it.
 
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:
Awesome!

Could you make it pause when you press CTRL and unpause when you press it again? Thanks!
 
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:
Code:
private Key Mykey = Key.LeftCtrl;
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:
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()   {}

    }

}

Great code, now can you make it a toggle instead of while pressed?
 
Back
Top