Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #WinActivateForce
- Numpad3::
- WinGet, PID, PID, A
- WinGet, HWND, ID, A
- Break := 0
- Loop
- {
- ControlSend, , {c down}, ahk_pid %PID%
- Sleep, 86
- ControlSend, , {c up}, ahk_pid %PID%
- Random, SleepTime, 3000, 6000
- Sleep, %SleepTime%
- If (Break = 1)
- {
- break
- }
- else
- {
- Sleep, 30
- }
- }
- return
- Numpad6::
- WinGet, PID, PID, A
- WinGet, HWND, ID, A
- Address := 0x00961904
- Base := getProcessBaseAddress(HWND)
- WaterAddress := GetAddressWater(PID, Base, Address)
- LavaAddress := GetAddressLava(PID, Base, Address)
- ChocoAddress := GetAddressChoco(PID, Base, Address)
- Break := 0
- Loop
- {
- If (Break = 1)
- {
- Break
- }
- else
- {
- Sleep, 30
- }
- ControlSend, , {c down}, ahk_pid %pid%
- Sleep, 86
- ControlSend, , {c up}, ahk_pid %pid%
- Sleep, 1000
- ControlSend, , {f down}, ahk_pid %pid%
- Sleep, 86
- ControlSend, , {f up}, ahk_pid %pid%
- Timer := 0
- While Timer = 0
- {
- Loop
- {
- CaughtWater := ReadMemory(PID, WaterAddress)
- CaughtLava := ReadMemory(PID, LavaAddress)
- CaughtChoco := ReadMemory(PID, ChocoAddress)
- If (CaughtWater = 1 or CaughtLava = 1 or CaughtChoco = 1)
- {
- Break
- }
- if Timer = 40
- {
- Break
- }
- Sleep, 1000
- Timer := Timer + 1
- }
- }
- Timer := 0
- ControlSend, , {f down}, ahk_pid %pid%
- Sleep, 86
- ControlSend, , {f up}, ahk_pid %pid%
- Sleep, 2000
- }
- return
- Numpad9::
- Break := 1
- return
- Numpad7::
- ExitApp
- GetAddressWater(PID, Base, Address)
- {
- pointerBase := base + Address
- y1 := ReadMemory(PID, pointerBase)
- y2 := ReadMemory(PID, y1 + 0x144)
- y3 := ReadMemory(PID, y2 + 0xe4)
- Return WaterAddress := (y3 + 0x70)
- }
- GetAddressLava(PID, Base, Address)
- {
- pointerBase := base + Address
- y1 := ReadMemory(PID, pointerBase)
- y2 := ReadMemory(PID, y1 + 0x144)
- y3 := ReadMemory(PID, y2 + 0xe4)
- Return LavaAddress := (y3 + 0x514)
- }
- GetAddressChoco(PID, Base, Address)
- {
- pointerBase := base + Address
- y1 := ReadMemory(PID, pointerBase)
- y2 := ReadMemory(PID, y1 + 0x144)
- y3 := ReadMemory(PID, y2 + 0xe4)
- Return ChocoAddress := (y3 + 0x2c0)
- }
- getProcessBaseAddress(HWND)
- {
- return DllCall( A_PtrSize = 4
- ? "GetWindowLong"
- : "GetWindowLongPtr"
- , "Ptr", HWND
- , "Int", -6
- , "Int64") ; Use Int64 to prevent negative overflow when AHK is 32 bit and target process is 64bit
- ; If DLL call fails, returned value will = 0
- }
- ReadMemory(PID, MADDRESS)
- {
- VarSetCapacity(MVALUE,4,0)
- ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", PID, "UInt")
- ;DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
- DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
- Loop 4
- result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
- return, result
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement