Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Misc.au3>
- ;constants
- Const $POST_CLICK_DELAY = 200
- Const $MOUSE_MOVE_SPEED = 3
- Const $DEF_SIM_LENGTH = 29000
- Const $BASE_LOAD_DELAY = 6000
- ;objects
- Local $hDLL = DllOpen("user32.dll")
- ;Main Script Function
- Func RunScript()
- BlockInput(1)
- ;make sure we are scrolled all the way to the bottom
- ScrollGameViewDown()
- While 1 = 1
- ;lets fire a single run of the sim
- RunSingleSim();
- If _IsPressed("1B", $hDLL) Then
- DllClose($hDLL)
- ExitLoop
- EndIf
- WEnd
- BlockInput(0)
- EndFunc
- Func ScrollGameViewDown()
- MouseClickDrag("left", 2252, 319, 2252, 134)
- EndFunc
- Func RunSingleSim()
- ; open the simulations window
- MouseClick ( "left", 3425, 602 , 2 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;select the highest defense sim
- MouseClick ( "left", 2676, 450 , 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;go to the last page
- MouseClick ( "left", 3005, 790 , 10 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;select the last level in the sim
- MouseClick ( "left", 2829, 398 , 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;accept simulation
- MouseClick ( "left", 3127, 842 , 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;wait for sim to complete
- Sleep($DEF_SIM_LENGTH)
- ;TODO make sure we are closing the level up if showing
- ;close results window
- MouseClick ( "left", 3193, 264 , 1 , $MOUSE_MOVE_SPEED)
- Sleep($BASE_LOAD_DELAY)
- ;close sim window if open still
- MouseClick ( "left", 3221, 218 , 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;move mouse to center to show done
- MouseMove(2897, 538, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- EndFunc
- ;call the main method after script is initialized
- RunScript();
Advertisement
Add Comment
Please, Sign In to add comment