setkeydelay -1 setmousedelay -1 Process, Exist ; sets ErrorLevel to the PID of this running script ; Get the handle of this script with PROCESS_QUERY_INFORMATION (0x0400) h := DllCall("OpenProcess", "UInt", 0x0400, "Int", false, "UInt", ErrorLevel) ; Open an adjustable access token with this process (TOKEN_ADJUST_PRIVILEGES = 32) DllCall("Advapi32.dll\OpenProcessToken", "UInt", h, "UInt", 32, "UIntP", t) VarSetCapacity(ti, 16, 0) ; structure of privileges NumPut(1, ti, 0, 4) ; one entry in the privileges array... ; Retrieves the locally unique identifier of the debug privilege: DllCall("Advapi32.dll\LookupPrivilegeValueA", "UInt", 0, "Str", "SeDebugPrivilege", "UIntP", luid) NumPut(luid, ti, 4, 8) NumPut(2, ti, 12, 4) ; enable this privilege: SE_PRIVILEGE_ENABLED = 2 ; Update the privileges of this process with the new access token: DllCall("Advapi32.dll\AdjustTokenPrivileges", "UInt", t, "Int", false, "UInt", &ti, "UInt", 0, "UInt", 0, "UInt", 0) DllCall("CloseHandle", "UInt", h) ; close this process handle to save memory read1(MADDRESS) { global processhandle varsetcapacity(mvalue,1,0) temp:=DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"str",MVALUE,"UInt",1,"UInt",0) if (ErrorLevel or !ProcessHandle or !temp) { winget, pid, PID, Brood War ProcessHandle := DllCall("OpenProcess", "Int", 16, "Char", 0, "UInt", pid, "UInt") temp:=DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"str",MVALUE,"UInt",1,"UInt",0) if (ErrorLevel or !ProcessHandle or !temp) MsgBox fail %errorlevel% %processhandle% %temp% } return *(&mvalue) } select() { return (read1(0x6556f2)!=72) } sc() { return read1(0x6d11ec) } #ifWinActive Brood War *$~RButton:: send {RBUTTON UP} return *$LButton:: x:=!select() send {BLIND}{LBUTTON DOWN} if(x && sc()) send {BLIND}{LBUTTON UP} return *~LButton UP:: return