Need Help at a Script!

Ask gaming related questions (AHK v1.1 and older)
Yaruqii
Posts: 32
Joined: 11 Jul 2021, 16:29

Need Help at a Script!

Post by Yaruqii » 21 Jul 2021, 04:12

Hey, here I have a code for GTA5, and after I used this once, it doesnt works anymore, until I reload the Script, can u add something for, that after the script done his thing, that the Script automaticly reloads itself? or If this isnt possible, that the Script reloads on the Key "F8"? Thank you! Heres the Code:

Code: Select all

Control & BS::


if (toggle := !toggle) {
	
Process_Suspend("Gta5.exe")

Process_Suspend(PID_or_Name){

    PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name

    h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)

    If !h   

        Return -1

    DllCall("ntdll.dll\NtSuspendProcess", "Int", h)

    DllCall("CloseHandle", "Int", h)

}
sleep 8000

Process_Resume("Gta5.exe")

Process_Resume(PID_or_Name){

    PID := (InStr(PID_or_Name,".")) ? ProcExist(PID_or_Name) : PID_or_Name

    h:=DllCall("OpenProcess", "uInt", 0x1F0FFF, "Int", 0, "Int", pid)

    If !h   

        Return -1

    DllCall("ntdll.dll\NtResumeProcess", "Int", h)

    DllCall("CloseHandle", "Int", h)

}

ProcExist(PID_or_Name=""){

    Process, Exist, % (PID_or_Name="") ? DllCall("GetCurrentProcessID") : PID_or_Name

    Return Errorlevel

}
}
return
[Mod edit: [code][/code] tags added.]

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Need Help at a Script!

Post by mikeyww » 21 Jul 2021, 05:26

If you remove the toggle, the routine would execute with each triggering of it.

Post Reply

Return to “Gaming Help (v1)”