Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Misc.au3>
- ;constants
- Const $LOOP_AMOUNT = 1000
- Const $POST_CLICK_DELAY = 250
- Const $MOUSE_MOVE_SPEED = 2
- Const $GAME_LOAD_DELAY = 30000
- Const $GAME_SIDEBAR_DELAY = 3000
- Const $ZOOT_DELAY = 2000
- Const $DEF_SIM_DELAY = 50000
- Const $BASE_LOAD_DELAY = 8000
- Const $COMBAT_LOAD_DELAY = 4000
- Const $DEPLOY_GENERAL_DELAY = 1000
- Const $DEPLOY_RAPTOR_DELAY = 1000
- Const $DEPLOY_DEV_DELAY = 2000
- Const $COMBAT_DELAY = 90000
- Const $RESOURCE_DELAY = 3000
- Const $SIM_LOOP_AMOUNT = 6
- Const $COMBAT_LOOP_AMOUNT = 3
- Const $DEV_PLATOONS = 6
- Const $COMBAT_DIFFICULTY = 14
- ;objects
- Local $hDLL = DllOpen("user32.dll")
- ;Main Script Function
- Func RunScript()
- ;prevent user taking control back when running
- BlockInput(1)
- Local $i = 0
- While $i < $LOOP_AMOUNT
- ;refresh the view for out of sync errors
- ;RefreshBrowserGame()
- ;run the simulation
- ;RunSetOfSims()
- ;collect resources
- ;CollectResources()
- ;refresh the view for out of sync errors
- RefreshBrowserGame()
- ;run the simulation
- RunSetOfAttacks("A")
- ;refresh the view for out of sync errors
- RefreshBrowserGame()
- ;run the simulation
- RunSetOfAttacks("B")
- ;collect resources
- ;CollectResources()
- ;increment the loop
- $i = $i + 1
- WEnd
- ;give user control back
- BlockInput(0)
- EndFunc
- Func RefreshBrowserGame()
- ;right click on browser
- MouseClick ( "right", 518, 40, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;enter edgeworld address in browser
- MouseClickDrag("left", 518, 40, 49, 41)
- Sleep($POST_CLICK_DELAY)
- Send("{DELETE}")
- Send("https://www.kabam.com/games/edgeworld/play");
- Send("{ENTER}")
- Sleep($POST_CLICK_DELAY)
- ;select reload browser tab
- MouseClick ( "left", 675, 137, 1 , $MOUSE_MOVE_SPEED)
- Sleep($GAME_LOAD_DELAY)
- ;hide side panel
- MouseClick ( "left", 1127, 80, 1 , $MOUSE_MOVE_SPEED)
- Sleep($GAME_SIDEBAR_DELAY)
- ;close daily update if open
- MouseClick ( "left", 892, 236, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;if zoot winddow is open play and close
- CloseZoots()
- ;close the chat window
- CloseChat()
- EndFunc
- Func CloseZoots()
- ;play zoots if open
- MouseClick ( "left", 683, 761, 1 , $MOUSE_MOVE_SPEED)
- Sleep($ZOOT_DELAY)
- ;select zoot item
- MouseClick ( "left", 798, 654, 1 , $MOUSE_MOVE_SPEED)
- Sleep($ZOOT_DELAY)
- ;close zoots
- MouseClick ( "left", 921, 131, 1 , $MOUSE_MOVE_SPEED)
- Sleep($ZOOT_DELAY)
- EndFunc
- Func CloseChat()
- MouseClick("left", 19, 579, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- EndFunc
- Func CloseUnitHealth()
- MouseClick("left", 940, 229, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- EndFunc
- Func ScrollGameViewDown()
- MouseClickDrag("left", 525, 781, 525, 191)
- MouseClickDrag("left", 525, 781, 525, 191)
- MouseClickDrag("left", 860, 428, 80, 428)
- MouseClickDrag("left", 860, 428, 80, 428)
- MouseClickDrag("left", 883, 202, 883, 637)
- EndFunc
- Func CollectResources()
- ;right click on browser
- MouseClick ( "left", 518, 549, 2, $MOUSE_MOVE_SPEED)
- Sleep($RESOURCE_DELAY)
- EndFunc
- ; runs a set of 6 sims
- Func RunSetOfSims()
- Local $i = 0
- While $i < $SIM_LOOP_AMOUNT
- ;scroll view to def sim building
- ScrollGameViewDown()
- ;lets fire a single run of the sim
- RunSingleSim();
- ;increment the loop
- $i = $i + 1
- WEnd
- EndFunc
- ;runs single instance of the sim
- Func RunSingleSim()
- ; open the simulations window
- MouseClick ( "left", 840, 446, 2 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;select the highest defense sim
- MouseClick ( "left", 393, 413, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;go to the last page
- MouseClick ( "left", 691, 717, 11, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;select the last level in the sim
- MouseClick ( "left", 506, 331, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;select def sim boost
- MouseClick ( "left", 428, 294, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;accept simulation
- MouseClick ( "left", 829, 763, 1 , $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;wait for sim to complete
- Sleep($DEF_SIM_DELAY)
- ;close level up if open
- MouseClick( "left", 813, 335, 1, $MOUSE_MOVE_SPEED )
- Sleep($POST_CLICK_DELAY)
- ;close results window
- MouseClick ( "left", 878, 185 , 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)
- EndFunc
- ; runs a set of 6 sims
- Func RunSetOfAttacks($warp)
- Local $i = 0
- While $i < $COMBAT_LOOP_AMOUNT
- ;lets fire a single run of the sim
- RunSingleAttack($warp, $i, $COMBAT_DIFFICULTY)
- ;increment the loop
- $i = $i + 1
- WEnd
- EndFunc
- ;runs single attack run
- Func RunSingleAttack($warp, $count, $difficulty)
- ; open the combat window
- MouseClick ( "left", 928, 789, 1 , $MOUSE_MOVE_SPEED)
- Sleep($COMBAT_LOAD_DELAY)
- ; select factions tab
- MouseClick ( "left", 766, 234, 1 , $MOUSE_MOVE_SPEED)
- Sleep($COMBAT_LOAD_DELAY)
- ; go to first page
- MouseClick ( "left", 217, 458 , 17, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ; go to nth page
- MouseClick ( "left", 915, 460, $difficulty, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ; select base
- If $count = 0 Then
- MouseClick ( "left", 850, 440, 1, $MOUSE_MOVE_SPEED)
- ElseIf $count = 1 Then
- MouseClick ( "left", 850, 486, 1, $MOUSE_MOVE_SPEED)
- ElseIf $count = 2 Then
- MouseClick ( "left", 850, 525, 1, $MOUSE_MOVE_SPEED)
- EndIf
- ;wait while base loads
- Sleep($BASE_LOAD_DELAY)
- ; attack
- If $warp = "A" Then
- MouseClick ( "left", 538, 172, 1, $MOUSE_MOVE_SPEED) ; warp A
- ElseIf $warp = "B" Then
- MouseClick ( "left", 599, 173, 1, $MOUSE_MOVE_SPEED) ; warp B
- EndIf
- Sleep($POST_CLICK_DELAY)
- ; close no warp dialog if open
- MouseClick("left", 888, 186, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;wait while combat is loadingx
- Sleep($COMBAT_LOAD_DELAY)
- ;scroll attack window west
- MouseClickDrag("left", 910, 469, 152, 469)
- MouseClickDrag("left", 910, 469, 152, 469)
- ;select general
- MouseClick("left", 295, 702, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;deploy general
- MouseClick("left", 636, 314, 1, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_GENERAL_DELAY)
- ;defocus general unit selection
- MouseClick("left", 894, 540, 2, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_GENERAL_DELAY)
- ;close unit health
- CloseUnitHealth()
- ;select and deploy blocker
- Send("b")
- Sleep($POST_CLICK_DELAY)
- MouseClick("left", 640, 555, 1, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_RAPTOR_DELAY)
- ;select and deploy blocker
- Send("b")
- Sleep($POST_CLICK_DELAY)
- MouseClick("left", 640, 380, 1, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_RAPTOR_DELAY)
- ;deploy three squadrons of devestators
- Local $i = 0
- While $i < $DEV_PLATOONS
- Send("x")
- MouseClick("left", 808, 205, 1, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_DEV_DELAY)
- Send("x")
- MouseClick("left", 887, 386, 1, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_DEV_DELAY)
- Send("x")
- MouseClick("left", 967, 564, 1, $MOUSE_MOVE_SPEED)
- Sleep($DEPLOY_DEV_DELAY)
- MouseClick("left", 808, 205, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- MouseClick("left", 887, 386, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- MouseClick("left", 967, 564, 1, $MOUSE_MOVE_SPEED)
- Sleep($POST_CLICK_DELAY)
- ;increment the loop
- $i = $i + 1
- WEnd
- Sleep($COMBAT_DELAY)
- ;close level up if open
- MouseClick( "left", 816, 332, 1, $MOUSE_MOVE_SPEED )
- Sleep($POST_CLICK_DELAY)
- ;close the results page
- MouseClick ( "left", 875, 115 , 1, $MOUSE_MOVE_SPEED)
- Sleep($BASE_LOAD_DELAY)
- EndFunc
- ;call the main method after script is initialized
- RunScript();
Advertisement
Add Comment
Please, Sign In to add comment