here's the code:
Code: Select all
setKeyDelay, 50, 50
setMouseDelay, 50
$~lbutton::
while (getKeyState("lbutton", "P"))
{
send, {lbutton}
sleep, 40
}
#IfWinActive, ahk_class Notepad
return
Code: Select all
setKeyDelay, 50, 50
setMouseDelay, 50
$~lbutton::
while (getKeyState("lbutton", "P"))
{
send, {lbutton}
sleep, 40
}
#IfWinActive, ahk_class Notepad
return
Code: Select all
#SingleInstance, Force
SendMode, Event
settitlematchmode,2 ;<- so you don't need the whole nopad window title
detecthiddenwindows On ;<- so the script can detect the target window even if hidden
return
esc:: ;<- exits the script entirely
tooltip ;<- turns off the tooltip message
MsgBox,0x1000,Line%A_LineNumber%,Script Ended. ;<- signals the end of the script
ExitApp
;------------------------------------------------
; make sure the game is in windows mode so
; it shows a title bar on the screen. Change
; the tgtwin variable to reflect the game's
; displayed title from the titlebar. this routine
; does not exit the script, it simply stops the
; loop until the game window can become active
; again. It's been tested with the windows
; Notepad so i know it works with that
; window
;------------------------------------------------
$~lbutton::
Suspend Permit
tgtwin := "Rainbow Six"
;tgtwin := "Untitled"
while (getKeyState("lbutton", "P"))
{ ifWinNotActive, %tgtwin% ;<- check the target window
{ break ;<- break the loop if window is not active
}
click
sleep, 40
}
return
Users browsing this forum: No registered users and 73 guests