Code: Select all
#NoEnv
DetectHiddenWindows, On
ClassName = LWJGL
CurrentID =
WinGet, GameList, List, ahk_class %ClassName%
if (GameList = 0)
{
MsgBox, 48, Game Not Found, Game window not found. Please Relaunch the game and try again.
ExitApp
}
else if (GameList = 1)
{
Loop, %GameList%
CurrentID := GameList%A_Index%
}
else if (GameList >= 2)
{
MsgBox, 64, Multiple Found, More then 1 game running.`nThe game windows will be marked as active, bringing them to the front.`nFollow the prompts and confirm which window to link the script to.
Loop, %GameList%
{
CurrentID := GameList%A_Index%
WinActivate, ahk_id %CurrentID%
MsgBox, 36, Confirm Game Link, Is the current activated window the one to link to?`n ID = %CurrentID%
IfMsgBox Yes
break
else
CurrentID =
}
}
if (CurrentID = "")
{
MsgBox, 48, ID Not Selected, GameID not selected during selection process. Please try again.`nExiting script.
ExitApp
}
else
{
GameID := CurrentID
}
While (WinExist("ahk_id " GameID) != 0)
{
=::
Click, D
Loop {
ControlClick, ahk_id %GameID%
ControlSend,, {s down}, ahk_id %GameID%
Sleep, 23000
ControlSend,, {s up}, ahk_id %GameID%
Sleep, 500
ControlSend,, {d down}, ahk_id %GameID%
Sleep, 23000
ControlSend,, {d up}, ahk_id %GameID%
Sleep, 240
}
}
MsgBox, 48, Game Not Found, The game window has either been closed or for whatever reason is not found. Please try again.
ExitApp
Esc::ExitApp
[Mod actions: Moved topic to "Gaming" and added [code][/code] tags. Please use them yourself when posting code.]