Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;======================================================================================
- ; Cut trees automatically in Dota 2! To use, open the mini-game, and turn on Caps Lock
- ; to activate the script. To deactivate it, turn off Caps Lock.
- ;======================================================================================
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Warn ; Enable warnings to assist with detecting common errors.
- #Persistent
- #SingleInstance force
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ;============================================================================
- ; These are X,Y coordinates of the top left and bottom left of the mini-game.
- ; You will need to change this if your resolution is not 1920x1080.
- ;============================================================================
- TOPLEFT_X := 270
- TOPLEFT_Y := 246
- BOTTOMRIGHT_X := 1268
- BOTTOMRIGHT_Y := 872
- ; You may optionally wish to modify these two values to better suit your tastes.
- INCREMENT_BY_X := 100 ; This is how many pixels the mouse will move horizontally before clicking.
- INCREMENT_BY_Y := 100 ; This is how many pixels the mouse will move vertically after it has finished 1 row.
- ;==================================
- ; Don't change anything below here
- ;==================================
- CURRENT_X := TOPLEFT_X
- CURRENT_Y := TOPLEFT_Y
- DISTANCE_X := BOTTOMRIGHT_X - TOPLEFT_X
- DISTANCE_Y := BOTTOMRIGHT_Y - TOPLEFT_Y
- CURRENT_DISTANCE_X := 0
- CURRENT_DISTANCE_Y := 0
- #IfWinActive, DOTA 2
- SetTimer, CutTrees, 0
- return
- CutTrees:
- if (GetKeyState("capslock","T"))
- {
- Click %CURRENT_X%, %CURRENT_Y%
- CURRENT_X += %INCREMENT_BY_X%
- CURRENT_DISTANCE_X += %INCREMENT_BY_X%
- if (CURRENT_DISTANCE_X > DISTANCE_X)
- {
- Click %BOTTOMRIGHT_X%, %CURRENT_Y%
- CURRENT_X := TOPLEFT_X
- CURRENT_DISTANCE_X := 0
- CURRENT_Y += %INCREMENT_BY_Y%
- CURRENT_DISTANCE_Y += %INCREMENT_BY_Y%
- }
- if (CURRENT_DISTANCE_Y > DISTANCE_Y)
- {
- CURRENT_Y := TOPLEFT_Y
- CURRENT_DISTANCE_Y := 0
- }
- }
- else
- {
- CURRENT_X := TOPLEFT_X
- CURRENT_Y := TOPLEFT_Y
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement