Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;; ;;;;
- ;;;; Edgeworld Defense Simulator Automa ;;;;
- ;;;; written by: kara marie rawson ;;;;
- ;;;; copyright 2013 - use at own risk ;;;;
- ;;;; ;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- #include <Misc.au3>
- ;constants
- Const $POST_CLICK_DELAY = 250
- Const $MOUSE_MOVE_SPEED = 1
- Const $DEF_SIM_LENGTH = 25000
- Const $BASE_LOAD_DELAY = 5000
- ;objects ;2931, 378
- Local $hDLL = DllOpen("user32.dll")
- ;Main Script Function
- Func RunScript()
- ;prevent user taking control back when running
- BlockInput(1)
- ;make sure we are scrolled all the way to the bottom
- ScrollGameViewDown()
- RunSetOfSims()
- ;give user control back
- BlockInput(0)
- EndFunc
- Func ScrollGameViewDown()
- MouseClickDrag("left", 2252, 319, 2252, 134)
- EndFunc
- ; runs a set of 6 sims
- Func RunSetOfSims()
- Local $i = 0
- While $i < 1000000
- ;lets fire a single run of the sim
- RunSingleSim();
- ;cancel if esc is held down
- If _IsPressed("1B", $hDLL) Then
- DllClose($hDLL)
- ExitLoop
- EndIf
- $i = $i + 1
- WEnd
- EndFunc
- ;runs single instance of the sim
- 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)
- ;select def sim boost
- ;MouseClick ( "left", 2753, 366 , 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)
- ;close level up if open
- MouseClick( "left", 3055, 645, 1, $MOUSE_MOVE_SPEED )
- Sleep($POST_CLICK_DELAY)
- ;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