armypredator (03-19-2023),funplay715 (04-29-2019),Qstxzz (04-24-2019),zpopcorn (04-15-2019)
Hey guys,
Here is a little script I've put together for Division 2. I know some people will find it useful. It's good for other games too. (Not the triggerbot part obviously).
Features:
Adjustable Anti-Recoil - - Adjustable anti-recoil. Can be adjusted on the fly via hotkeys left/right as well as up/down. Anti-recoil also works for triggerbot and autofire modes.
Triggerbot - - Activates when crosshair is red. Works great for rifles if you tweak the recoil and shot timing correctly. YOU MUST CONFIGURE "J" AS A FIRE KEY IN GAME TO USE THE AUTOFIRE/TRIGGERBOT (or edit the script)
Adjustable Autofire - - Press Mouse4 (can be changed in AHK) to automatically fire semi auto weapons. You can press O/Ctrl-O to turn up/down the delay by 25 ms increments. (If you leave the delay at 0, then semi auto weapons will not repeat fire. This is good for full auto weapons combined with triggerbot, because they will automatically stop firing when crosshair is off enemies, and resume firing again if you aim at them without having to take your finger off the key. You need to turn up the duration with O / Ctrl-O if you want to autofire. By default it is full auto.
All 3 of these features are able to be combined
YOU MUST CONFIGURE "J" AS A FIRE KEY IN GAME TO USE THE AUTOFIRE/TRIGGERBOT or rebind it in the script
Controls:
F3: Turn script on and off. Good to use because the anti recoil makes clicking things annoying. (Pretty sure there's actually an easy way to fix that so it auto activates, just haven't yet.)
F4: Toggle "Autofire". By default Mouse4 will only fire when crosshair is red. This switches it to autofire mode.
Mouse-4 Activate Triggerbot/Autofire, depending on if you have "Autofire" BIND J AS ALTERNATE FIRE KEY
Numpad Plus / Numpad Minus: Increase/decrease upwards recoil compensation.
CTRL+Numpad Plus / CTRL+Numpad Minus: Adjust left/right recoil compensation. Very useful for some of the weapons in Division 2.
O / Ctrl+O: Adjust the duration between autofire/triggerbot shots. By default this is at 0, which means that you will not repeat fire (default setting intended for full auto)
Let me know if you guys have any questions or issues, or if you're really desperate for me to change the hotkeys or something.
I have a compiled EXE of this, but I need to find the rules on submitting it since it's just a compiled AHK and triggers online virus scanners with generics. Please let me know if it's okay and I will. I bet most of you guys have AHK installed though.
Enjoy!
Here's a video of it in action. First I use the triggerbot, then the autofire, then I show the recoil by turning it way higher than needed.
https://www.youtube.com/watch?v=tdzBJysFNhg
Code:;##################### ;#=====Commands====# ;##################### SetWorkingDir %A_ScriptDir% #NoEnv #InstallKeybdHook #InstallMouseHook #KeyHistory 0 #UseHook #MaxThreadsPerHotkey 1 #MaxThreads 30 #MaxThreadsBuffer on SendMode Input ListLines, Off PID := DllCall("GetCurrentProcessId") Process, Priority, %PID%, High SendMode Input CoordMode, Pixel, Screen CoordMode, Mouse, Screen ;##################### ;#====Initialization====# ;##################### global _enabled := 0 global _autofire := 0 global _downVal = 2 global _rightVal = 0 global _rampdown = 1 global _shotdelay=0 global _readytofire = 1 global _timerRunning = 0 global crosshairX = global crosshairY = ;#################### ;#=====Hotkeys=====# ;#################### ~F3:: ; Turn script on/off _enabled := ! _enabled _autofire = 0 ShowToolTip("Script Enabled= "_enabled) return ~F4:: ;Change triggerbot to singleshot OR enable autofire if you also turn up duration with o / ctrl-o _autofire := ! _autofire ShowToolTip("Autofire= "_autofire) return ~NumpadAdd:: ; Adds compensation. _downVal := _downVal + 1 ShowToolTip("Downward compensation= " . _downVal) return ~NumpadSub:: ; Substracts compensation. if _downVal > 0 { _downVal := _downVal - 1 ShowToolTip("Downward compensation= " . _downVal) } return ~^NumpadAdd:: ; Adds right adjust _rightVal := _rightVal + 1 ShowToolTip("Right(+)/Left(-)= " . _rightVal) return ~^NumpadSub:: ; Adds left adjust _rightVal := _rightVal - 1 ShowToolTip("Right(+)/Left(-)= " . _rightVal) return ~o:: ; Single shot timer up (zero is always fire) _shotdelay := _shotdelay + 25 ShowToolTip("Single Shot Delay up= " _shotdelay) Return ~^o:: ; Single shot timer down (zero is always fire) if _shotdelay > 0 { _shotdelay := _shotdelay - 25 ShowToolTip("Single Shot Delay down= " _shotdelay) } return ~LButton::lessrecoil() ~XButton1::lessrecoil_triggerbot() ;"XButton1" is mouse 4. If you change this, make sure you replace every XButton1 in the script. ;#################### ;======Functions====== ;#################### lessrecoil() { While GetKeyState("LButton") { sleep 10 if _enabled { ApplyReduction() } sleep 10 } return } ;================== lessrecoil_triggerbot() { While GetKeyState("XButton1") { { if _enabled { if CrosshairCheck() { TryToFire() ApplyReduction() } } } } Send, {j up} sleep 10 _timerRunning = 0 _readytofire = 1 return } ;================== ApplyReduction() { DllCall("mouse_event",uint,1,int,_rightVal,int,_downVal,uint,0,int,0) Sleep 20 DllCall("mouse_event",uint,1,int,_rightVal,int,_downVal,uint,0,int,0) Sleep 20 return } ;================== CrosshairCheck() ; returns as "true" if either autofire, or crosshair is found. { if _autofire = 1 return true else { crosshairX = MouseGetPos, mX, mY x1 :=(mX-35) x2 :=(mX+35) y1:=(mY-15) y2 :=(mY+15) PixelSearch, crosshairX, crosshairY, x1, y1, x2, y2, 0x3636F4, 0, Fast } if crosshairX > 0 ;this will be set to either the x coord of the red found, or "1" if the triggerbot is turned off. { return true } else{ Send, {j up} sleep 10 return false } } ;================== TryToFire() { if _shotdelay = 0 { Send, {j down} return } else { if _readytofire = 1 { Send, {j up} sleep 25 Send, {j down} _readytofire = 0 ShotTimer() return } else { ShotTimer() return } ShotTimer() if _shotdelay > 0 { Send, {j up} ShotTimer() Sleep 20 } else { _readytofire = 1 } } } ;================== ShotTimer() { if _timerRunning = 0 { SetTimer, ShotWait, %_shotdelay% _timerRunning = 1 return } else return ShotWait: SetTimer, ShotWait, Off _timerRunning = 0 _readytofire = 1 return } ;================== ShowToolTip(Text) { ToolTip, %Text% SetTimer, RemoveToolTip, 3000 return RemoveToolTip: SetTimer, RemoveToolTip, Off ToolTip return } ;==================
Last edited by MW_Vortex; 03-31-2019 at 10:53 AM. Reason: edit: Fixed the timing on autofire edit2: added video
armypredator (03-19-2023),funplay715 (04-29-2019),Qstxzz (04-24-2019),zpopcorn (04-15-2019)
Doesn't work, even when I toggle the features on.
It should definitely work, even if it's not perfect. The recoil adjustment is quite simple.
Try using it outside the game, and see if it moves your mouse cursor on the desktop.
By default, if you open that and press F3, then when you press Left-Click, it should make your cursor travel downwards. If that part isn't happening, then your Autohotkey probably isn't working correctly.
The Mouse-4 hotkey by default will not do anything unless there is the color of the red crosshair near your mouse pointer. If you press F4, then it should pop up "Autofire = 1" and then the same recoil from left-click will be applied to mouse-4, even if there is no red detected.
Let me know if you still have issues and I can help you get it working. Running the script as administrator may also help.
Last edited by MW_Vortex; 04-01-2019 at 11:47 AM. Reason: wrong post
Here's a capture of it first off while holding the fire key, and then on, with an UMP. With my (fairly low) sensitivity, I'm toggling (down 12) (left 5) amount of recoil adjustment when I press F3 here: https://www.youtube.com/watch?v=slM2...ature=youtu.be
There's some random left/right recoil that is not compensated for, as you can see. But it greatly helps.
Here is an updated one for that makes the crosshair detection slightly bigger, because I noticed at my resolution some crosshairs were not detected.
It also adds XBOX controller functionality for the autofire/triggerbot part. Press the right stick in (R3) to activate triggerbot, or autofire if F4 is toggled.
It actually works REALLY well on the xbox controller (make sure you still bind J to fire). The recoil reduction on normal (right trigger) shots is not activated in the xbox part of the script. If anyone shows interest I'll see what I can do.
Code:;##################### ;#=====Commands====# ;##################### SetWorkingDir %A_ScriptDir% #NoEnv #InstallKeybdHook #InstallMouseHook #KeyHistory 0 #UseHook #MaxThreadsPerHotkey 1 #MaxThreads 30 #MaxThreadsBuffer on SendMode Input ListLines, Off PID := DllCall("GetCurrentProcessId") Process, Priority, %PID%, High SendMode Input CoordMode, Pixel, Screen CoordMode, Mouse, Screen ;##################### ;#====Initialization====# ;##################### global _enabled := 0 global _autofire := 0 global _downVal = 2 global _rightVal = 0 global _rampdown = 1 global _shotdelay=0 global _readytofire = 1 global _timerRunning = 0 global crosshairX = global crosshairY = ;#################### ;#=====Hotkeys=====# ;#################### ~F3:: ; Turn script on/off _enabled := ! _enabled _autofire = 0 ShowToolTip("Script Enabled= "_enabled) return ~F4:: ;Change triggerbot to singleshot OR enable autofire if you also turn up duration with o / ctrl-o _autofire := ! _autofire ShowToolTip("Autofire= "_autofire) return ~NumpadAdd:: ; Adds compensation. _downVal := _downVal + 1 ShowToolTip("Downward compensation= " . _downVal) return ~NumpadSub:: ; Substracts compensation. if _downVal > 0 { _downVal := _downVal - 1 ShowToolTip("Downward compensation= " . _downVal) } return ~^NumpadAdd:: ; Adds right adjust _rightVal := _rightVal + 1 ShowToolTip("Right(+)/Left(-)= " . _rightVal) return ~^NumpadSub:: ; Adds left adjust _rightVal := _rightVal - 1 ShowToolTip("Right(+)/Left(-)= " . _rightVal) return ~o:: ; Single shot timer up (zero is always fire) _shotdelay := _shotdelay + 25 ShowToolTip("Single Shot Delay up= " _shotdelay) Return ~^o:: ; Single shot timer down (zero is always fire) if _shotdelay > 0 { _shotdelay := _shotdelay - 25 ShowToolTip("Single Shot Delay down= " _shotdelay) } return ~LButton::lessrecoil() ~XButton1::lessrecoil_triggerbot() ;"XButton1" is mouse 4. If you change this, make sure you replace every XButton1 in the script. ~Joy10::lessrecoil_triggerbot_xbox() ;#################### ;======Functions====== ;#################### lessrecoil() { While GetKeyState("LButton") { sleep 10 if _enabled { ApplyReduction() } sleep 10 } return } ;================== lessrecoil_triggerbot() { While GetKeyState("XButton1") { { if _enabled { if CrosshairCheck() { TryToFire() ApplyReduction() } } } } Send, {j up} sleep 10 _timerRunning = 0 _readytofire = 1 return } ;================== lessrecoil_triggerbot_xbox() { While GetKeyState("Joy10") { { if _enabled { if CrosshairCheck() { TryToFire() ApplyReduction() } } } } Send, {j up} sleep 10 _timerRunning = 0 _readytofire = 1 return } ;================== ApplyReduction() { DllCall("mouse_event",uint,1,int,_rightVal,int,_downVal,uint,0,int,0) Sleep 20 DllCall("mouse_event",uint,1,int,_rightVal,int,_downVal,uint,0,int,0) Sleep 20 return } ;================== CrosshairCheck() ; returns as "true" if either autofire, or crosshair is found. { if _autofire = 1 return true else { crosshairX = MouseGetPos, mX, mY x1 :=(mX-45) x2 :=(mX+45) y1:=(mY-20) y2 :=(mY+20) PixelSearch, crosshairX, crosshairY, x1, y1, x2, y2, 0x3636F4, 0, Fast } if crosshairX > 0 ;this will be set to either the x coord of the red found, or "1" if the triggerbot is turned off. { return true } else{ Send, {j up} sleep 10 return false } } ;================== TryToFire() { if _shotdelay = 0 { Send, {j down} return } else { if _readytofire = 1 { Send, {j up} sleep 25 Send, {j down} _readytofire = 0 ShotTimer() return } else { ShotTimer() return } ShotTimer() if _shotdelay > 0 { Send, {j up} ShotTimer() Sleep 20 } else { _readytofire = 1 } } } ;================== ShotTimer() { if _timerRunning = 0 { SetTimer, ShotWait, %_shotdelay% _timerRunning = 1 return } else return ShotWait: SetTimer, ShotWait, Off _timerRunning = 0 _readytofire = 1 return } ;================== ShowToolTip(Text) { ToolTip, %Text% SetTimer, RemoveToolTip, 3000 return RemoveToolTip: SetTimer, RemoveToolTip, Off ToolTip return } ;==================
triggerbot works only for npc?
-F
One thing is, you may want to increase the size of the detection slightly. I left it a bit small.
Also, make sure you set the crosshair opacity to maximum in the game. And increasing the size as well will help.
Please note: Some people were banned using a compiled version of this I made them. You might be safe if you make your own, but,just wanted to let you know.
If you can make this work for controller, id love you I don't use mouse on div 2. I have a modded xbox controller so I have the rapid fire, cant seem to get AHK to detect triggers to make a no recoil function.
- - - Updated - - -
Also, AHK is detected by EAC so.. I use a VM (Cloud PC) so I should be safe.
So all the feature work great! i was just wondering if there is a way to make the triggerbot a little less sensitive or something. this is obviously user error (kinda) but if there is a way to fix it this would be a pretty amazing script. For example while im aiming and i aim past an enemy too fast the script's response time is too slow for it to shoot the target accurately and i end up missing the shot. is there a way to tweak my in game setting or in the script? I guess its probably due to frame rate or something. But do you know what im saying? i know its been a few months since the original post. I hope you see this! thanks!
hello guys can you help me to use the cheat, i've create an .ahk file with autohotkey with your code so in my desktop i have this file .ahk. So i have to put this file one the game file in TD2 ? or i can let this file in my desktop and press f3 in game but nothing appened ? thx
yo will i get banned or is this fine???
Cannot get triggerbot/autofire to work anti-recoil works fine. I am running a high-res monitor, so I tried different res also window and full screen with no sucess. Any help is appreciated thanks in advance!