Last active
July 5, 2023 23:56
-
-
Save A2TC-YT/4c2564442e2c60792e322a0dadfbec09 to your computer and use it in GitHub Desktop.
afk fishing macro for destiny 2. You will need to install the Gdip_all library which you can find here: https://www.autohotkey.com/boards/viewtopic.php?t=6517
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance, Force | |
SendMode Input | |
SetWorkingDir, %A_ScriptDir% | |
global 1080p := 0 | |
MsgBox, ***READ BEFORE USING***`nMake sure you are on 7 brightness, chromatic abberation is off, and hud opacity is max. Make sure you have interact bound to "E". Press F3 to start and F4 to stop. Does NOT work on Nessus. | |
InputBox, 1080p, Resolution, If your computer monitor resolution is 1440p enter 0`nIf your computer monitor is 1080p enter 1 | |
pToken := Gdip_Startup() | |
F3:: | |
{ | |
coords := "1243|971|37|21" | |
width := 37 | |
height := 21 | |
threshold := 0.16 | |
if (1080p) | |
{ | |
coords := "932|728|27|16" | |
width := 27 | |
height := 16 | |
threshold := 0.12 | |
} | |
Loop, | |
{ | |
loop, | |
{ | |
pBitmap := Gdip_BitmapFromScreen(coords) | |
pWhite := simpleColorCheck(pBitmap, width, height) | |
Gdip_DisposeImage(pBitmap) | |
if (pWhite >= threshold) | |
Break | |
} | |
Send, {e down} | |
Sleep, 800 | |
Send, {e Up} | |
DllCall("mouse_event",uint,1,int,-300,int,0,uint,0,int,0) | |
Sleep, 200 | |
DllCall("mouse_event",uint,1,int,300,int,0,uint,0,int,0) | |
Send, {d Down} | |
Sleep, 100 | |
Send, {d Up} | |
Sleep, 100 | |
Send, {a Down} | |
Sleep, 100 | |
Send, {a Up} | |
} | |
} | |
Return | |
simpleColorCheck(pBitmap, w, h) | |
{ | |
x := 0 | |
y := 0 | |
white := 0 | |
total := 0 | |
loop %h% | |
{ | |
loop %w% | |
{ | |
color := (Gdip_GetPixel(pBitmap, x, y) & 0x00F0F0F0) | |
if (color == 0xF0F0F0) | |
white += 1 | |
total += 1 | |
x+= 1 | |
} | |
x := 0 | |
y += 1 | |
} | |
pWhite := white/total | |
return pWhite | |
} | |
F4::Reload | |
#Include %A_ScriptDir%\Gdip_all.ahk |
As far as I know/tried to do: You can't send keyboard commands to an inactive Destiny 2 window and you can't only capture a Destiny 2 window (it comes black. Whole monitor screen must be captured), so you can't interact with a non visible/non focused Destiny window.
Only way I know to interact with a non focused Destiny window (thanks to A2TC-YT scripts) is with virtual gamepads.
I guess that stuff can't be done to avoid cheats like aimbots.
ControlSend
Yeah, that's how its done, but I guess D2 ignores those
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wonder if this works instead of a virt gamepad:
https://www.autohotkey.com/board/topic/7927-send-a-macro-to-an-inactive-window/