Quote Originally Posted by BLURREDDOGE View Post
Run with Windowed (Borderless) to see the GUI.
Run at 1920x1080 for the Triggerbot to work best (how I designed it)

(The script creates a Hidden text file at the script directory to store the recoil-reduce number, this can be viewed and edited by checking the "Hidden items" box in the View section of the File Explorer)



To run this script you need AutoHotkey: https://autohotkey.com/
1. Copy the script
2. Create a text file anywhere, open it in a text editor
3. Paste the copied code in
4. Save the file as any_name_you_want_here.ahk
5. Run the script
- Only Tested on Windows 10


Keys:
- 5: Enable Triggerbot
- Up Arrow: Enable recoil-reduce
- NumpadSub: Decrease recoil-reduce number (The - on the keypad/numpad)
- NumpadAdd: Increase recoil-reduce number (The + on the keypad/numpad)



Triggerbot Preview (00:57):

Recoil Reduce Preview (00:39):



Script:
Code:
#NoEnv
#SingleInstance, Force
#Persistent
#MaxThreadsPerHotkey, 10
#InstallKeybdHook
#KeyHistory, 0
#UseHook
Process, Priority,, High
ListLines, Off
SetBatchLines, -1
SetWorkingDir %A_ScriptDir%
SetWinDelay, -1
SetMouseDelay, 0
SetKeyDelay, 1, 2
SendMode Input
OnExit DoBeforeExit


;GUI variables
recoil_offset  := 8
counter_a      := 0
counter_b      := 0
recoil_status  := "Disabled"
trigger_status := "Disabled"

if (FileExist("TD.txt"))
{
	FileRead, readfile, TD.txt
	if ((readfile < 100) AND (readfile > -100))
	{
		recoil_offset := readfile
	}
	else if (ErrorLevel)
	{
		recoil_offset := 8
	}
}
else
{
	recoil_offset := 8
}


Gui, +AlwaysOnTop +ToolWindow -Caption +Owner +LastFound +E0x20  ;E0x20 - Windows form style to allow click-through to what is below
Gui, Margin, 0, 0
Gui, Color, Grey

Gui, Font, cRed s30 bold q4, Arial
Gui, Add, Text, x13  y0  w280 h40, Recoil Reduce
Gui, Add, Text, x307 y0  w14  h50, |
Gui, Add, Text, x330 y0  w170 h40 vrecoil_status, %recoil_status%
Gui, Font, cWhite s30 bold q4, Arial
Gui, Add, Text, x510 y0  w80 h50 vrecoil_offset, s%recoil_offset%

Gui, Font, cRed s30 bold q4, Arial
Gui, Add, Text, x13  y50 w280 h50, Triggerbot
Gui, Add, Text, x307 y50 w14  h50, |
Gui, Add, Text, x330 y50 w170 h40 vtrigger_status, %trigger_status%

WinSet, Transparent, 200
Gui, Show, x0 y500 h100 w600 NoActivate


Hotkey, $*~LButton, Toggle  ;Toggle hotkey off - starting state


#IfWinActive, ahk_exe TheDivision.exe
UP::
{
	Hotkey, $*~LButton, Toggle
	returned := toggler(counter_a, 1)
	tex := returned[1]
	col := returned[2]
	GuiControl, +%col%, recoil_status         ;set colour
	GuiControl,       , recoil_status, %tex%  ;set text
	counter_a += 1
}
return


NumpadSub::
{
	if (recoil_offset > -99)
	{
		recoil_offset -= 1
		GuiControl,, recoil_offset, s%recoil_offset%
	}
}
return


NumpadAdd::
{
	if (recoil_offset < 99)
	{
		recoil_offset += 1
		GuiControl,, recoil_offset, s%recoil_offset%
	}
}
return


5::
{
	returned := toggler(counter_b, 2)
	tex := returned[1]
	col := returned[2]
	GuiControl, +%col%, trigger_status         ;set colour
	GuiControl,       , trigger_status, %tex%  ;set text
	counter_b += 1
}
return


$*~LButton::  ; Recoil-reduce
{
	if (WinActive("ahk_exe TheDivision.exe"))
	{
		while GetKeyState("LButton")
		{
			DllCall("mouse_event", uint, 1, int, 0, int, recoil_offset, uint, 1, int, 0)
			Sleep, 25
		}
	}
}
return


Trigger:
{
	Loop
	{
		if (Mod(counter_b, 2) = 0)
		{
			return
		}
		if (WinActive("ahk_exe TheDivision.exe"))
		{
			if (GetKeyState("RButton", "P"))
			{
				Loop                         ; 934, 538, 987, 542
				{                            ; wider search: 
					PixelSearch, outx, outy, 934, 538, 987, 544, 0xF93236, 10, FastRGB
					if (outx)  ;match, crosshair is lit
					{
						DllCall("mouse_event", "UInt", 0x02) ; left mouse button down
						Sleep, 1  ; enough time to register click in-game
						DllCall("mouse_event", "UInt", 0x04) ; left mouse button up
					}

					Sleep, 2  ;delay to allow for RButton's un-pressing to register

					if (GetKeyState("RButton", "T"))
					{
						break
					}
				}
			}
			else
			{
				Sleep, 100  ;No need to run key check so often
			}
		}
		else
		{
			Sleep, 800  ;Enough for a tab-into the window and ESC to close the In-game GUI
		}
	}
}
return


toggler(counter, option)
{
	if (Mod(counter, 2) = 0)
	{
		fstatus := "Enabled"
		colour := "clime"
		if (option = 2)
		{
			SetTimer, Trigger, -0
		}
	}
	else
	{
		fstatus := "Disabled"
		colour := "cred"
	}
	return [fstatus, colour]
}


DoBeforeExit:
{
    FileDelete, TD.txt
    FileAppend, %recoil_offset%, TD.txt
    FileSetAttrib, +H, TD.txt
    ExitApp
}



Test Script:
 
Code:
Gui, +AlwaysOnTop -Caption +Owner +LastFound +E0x20
WinSet, Trans, 50
Gui, Show, x934 y538 h4 w53 NA
SetTimer, reloadd, 2000
return

;Other Test Co-ordinates
;933, 537, 987, 560
;934, 538, 987, 542

reloadd:
{
   reload
}
return
Does it still work? And can be used in multiplayer? I mean in DZ or in any mission with a group. Thanks!