Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- #include <Misc.au3>
- If WinExists(@ScriptName) Then Exit
- AutoItWinSetTitle(@ScriptName)
- Global $Paused = 0
- HotKeySet("{F3}", "TogglePause")
- HotKeySet("{F2}", "Terminate")
- Local $hDLL = DllOpen("user32.dll")
- While 1
- IsHoldingAlt()
- WEnd
- Func IsHoldingAlt()
- If _IsPressed("12", $hDLL) Then
- ConsoleWrite("_IsPressed - Pressed Shift." & @crlf)
- ; Standby cycle until the key is released.
- While _IsPressed("12", $hDLL)
- Shoot()
- WEnd
- EndIf
- EndFunc
- ;you will have to update the color value in PixelSearch function to match your games colors
- ;take a screenshot of your game, extract the hex value of the trigger color and paste it over 0xBA0A0B in the function
- ;PixelSearch ( left, top, right, bottom, color [, shade-variation = 0 [, step = 1 [, hwnd]]] )
- Func Shoot()
- ;check if crosshair is white to reduce false positives such as character names
- Local $coord = PixelSearch(@desktopWidth / 2 - 1, @desktopHeight / 2 + 1, @desktopWidth / 2, @desktopHeight / 2 + 20, 0xDEDEDE, 30)
- If @error Then
- ;check if crosshair is red
- Local $coord = PixelSearch(@desktopWidth / 2 - 1, @desktopHeight / 2 + 1, @desktopWidth / 2, @desktopHeight / 2 + 20, 0xE57F72, 50)
- If Not @error Then
- MouseClick("Left")
- EndIf
- EndIf
- EndFunc
- ;function to pause the script
- Func TogglePause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100)
- WEnd
- ToolTip("")
- EndFunc
- ;function to exit the script
- Func Terminate()
- Exit 0
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement