Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- fire := 0
- xpos = 0
- ypos = 0
- F2::
- MouseGetPos, xpos, ypos ; remember the mouse position when auto-firing
- SetTimer, AutoFire, % (fire := !fire) ? "100" : "Off"
- return
- AutoFire:
- Click, left, %xpos%, %ypos%
- ;ControlClick, X%xpos% Y%ypos%, ahk_class ApplicationFrameWindow,,,, Pos
- ;ControlClick, x500 y500, A,,,, Pos; position relative to upper left corner of window!
- return
- ShowSavedMousePos:
- MsgBox, The cursor is at X%xpos% Y%ypos%.
- return
- PostClick(x,y,win="A") {
- lParam := x & 0xFFFF | (y & 0xFFFF) << 16
- PostMessage, 0x201, , %lParam%, , %win% ;WM_LBUTTONDOWN
- PostMessage, 0x202, , %lParam%, , %win% ;WM_LBUTTONUP
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement