Skip to content

Instantly share code, notes, and snippets.

@Skyross
Created May 22, 2016 18:34
Show Gist options
  • Save Skyross/957f2fb0c0464d9fd51a2af316ea0f73 to your computer and use it in GitHub Desktop.
Save Skyross/957f2fb0c0464d9fd51a2af316ea0f73 to your computer and use it in GitHub Desktop.
Dota 2 AutoIt tree cutter
#include <AutoItConstants.au3>
HotKeySet("{PAUSE}", "LoopFlagToggle")
$loopflag = False
$random = False
$only_clicks = False
$dx = 50
$dy = 50
$minX = 270
$maxX = 1270
$minY = 250
$maxY = 875
$x = $minX
$y = $maxY
While True
If $loopflag Then
IF Not $only_clicks Then
If $random Then
$x = Random($minX, $maxX, 1)
$y = Random($minY, $maxY, 1)
EndIf
MouseClick($MOUSE_CLICK_LEFT, $x, $y, 1, 0)
Else
MouseClick($MOUSE_CLICK_LEFT)
EndIf
If Not $random And Not $only_clicks Then
$x = $x + $dx
If ($x > $maxX) Or ($x < $minX) Then
$dx = -$dx
$y = $y + $dy
EndIf
If ($x > $maxX) And ($y > $maxY) Then
$x = $minX
$y = $minY
EndIf
EndIf
Sleep(10)
Else
Sleep(5000)
EndIf
WEnd
Func LoopFlagToggle()
$loopflag = Not $loopflag
EndFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment