Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <BlockInputEx.au3>
- HotKeySet("f", "ExitProg") ;;Sets F as a hotkey to exit the progam
- HotKeySet("s", "StartProg") ;;Sets S as a hotkey to start the program
- HotKeySet("d", "TogglePause");;Sets D as a hotkey to start the program
- Global $Paused
- const $ballcolor = 0xFFEB00
- const $playercolor = 0x186DFF
- Const $distball = 50
- Const $ScreenWidth = 1680
- Const $ScreenHeight = 1050
- Dim $ball = PixelSearch( 0, 0, $ScreenWidth, $ScreenHeight, $ballcolor);
- Dim $player = PixelSearch( 0, 0, $ScreenWidth, $ScreenHeight, $playercolor)
- $distance = 0
- ;Const $pixeltolerance = 0
- While 1 ;;;Waits for function call
- Wend
- Func StartProg()
- while 1
- Dim $ball = PixelSearch( 0, 0, $ScreenWidth, $ScreenHeight, $ballcolor)
- Dim $player = PixelSearch( 0, 0, $ScreenWidth, $ScreenHeight, $playercolor)
- calcdist()
- If IsArray($player) And IsArray($ball) Then
- $distance = sqrt(abs(($ball[0] - $player[0])) ^2 + abs(($ball[1] - $player[0]) ^2))
- If NOT @error Then
- Mousemove( $ball[0], $ball[1], 0)
- While ($distance < $distball)
- $xball=$ball[0]
- $yball=$ball[1]
- calcdist()
- refresh()
- If IsArray($player) And IsArray($ball) Then
- MouseClick("left",$ball[0],$ball[1], 1, 0)
- refresh()
- Else
- $distance = $distance + 100
- EndIf
- WEnd
- EndIf
- EndIf
- WEnd
- EndFunc
- Func TogglePause()
- $Paused = NOT $Paused
- While $Paused
- WEnd
- EndFunc
- Func ExitProg()
- Exit 0 ;;;Exits the program
- EndFunc
- Func Refresh()
- If IsArray($player) And IsArray($ball) Then
- Dim $ball = PixelSearch( 0, 0, $ScreenWidth, $ScreenHeight, $ballcolor)
- Dim $player = PixelSearch( 0, 0, $ScreenWidth, $ScreenHeight, $playercolor)
- EndIf
- EndFunc
- Func calcdist()
- refresh()
- If IsArray($player) And IsArray($ball) Then
- $distance = sqrt((abs(($ball[0] - $player[0])) ^2) + abs((($ball[1] - $player[1])) ^2))
- EndIf
- return $distance
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment