krawson

Edgeworld Defense Simulator Full Automatic Level Grinding v3

Aug 7th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.45 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;                                    ;;;;
  3. ;;;; Edgeworld Defense Simulator Automa ;;;;
  4. ;;;; written by: kara marie rawson      ;;;;
  5. ;;;; copyright 2013 - use at own risk   ;;;;
  6. ;;;;                                    ;;;;
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9. #include <Misc.au3>
  10.  
  11. ;constants
  12. Const $POST_CLICK_DELAY = 250
  13. Const $MOUSE_MOVE_SPEED = 1
  14. Const $DEF_SIM_LENGTH = 25000
  15. Const $BASE_LOAD_DELAY = 5000
  16.  
  17. ;objects ;2931, 378
  18. Local $hDLL = DllOpen("user32.dll")
  19.  
  20. ;Main Script Function
  21. Func RunScript()
  22.    ;prevent user taking control back when running
  23.     BlockInput(1)
  24.    
  25.     ;make sure we are scrolled all the way to the bottom
  26.     ScrollGameViewDown()
  27.    
  28.     RunSetOfSims()
  29.    
  30.     ;give user control back
  31.     BlockInput(0)
  32. EndFunc
  33.  
  34. Func ScrollGameViewDown()
  35.     MouseClickDrag("left", 2252, 319, 2252, 134)
  36. EndFunc
  37.  
  38. ; runs a set of 6 sims
  39. Func RunSetOfSims()
  40.    Local $i = 0
  41.    While $i < 1000000
  42.       ;lets fire a single run of the sim
  43.       RunSingleSim();
  44.        
  45.       ;cancel if esc is held down
  46.       If _IsPressed("1B", $hDLL) Then
  47.          DllClose($hDLL)
  48.          ExitLoop
  49.       EndIf
  50.       $i = $i + 1
  51.    WEnd
  52. EndFunc
  53.  
  54. ;runs single instance of the sim
  55. Func RunSingleSim()
  56.     ; open the simulations window
  57.     MouseClick ( "left", 3425, 602 , 2 , $MOUSE_MOVE_SPEED)
  58.     Sleep($POST_CLICK_DELAY)
  59.  
  60.     ;select the highest defense sim
  61.     MouseClick ( "left", 2676, 450, 1 , $MOUSE_MOVE_SPEED)
  62.     Sleep($POST_CLICK_DELAY)
  63.  
  64.     ;go to the last page
  65.     MouseClick ( "left", 3005, 790 , 10 , $MOUSE_MOVE_SPEED)
  66.     Sleep($POST_CLICK_DELAY)
  67.  
  68.     ;select the last level in the sim
  69.     MouseClick ( "left", 2829, 398 , 1 , $MOUSE_MOVE_SPEED)
  70.    
  71.     ;select def sim boost
  72.     ;MouseClick ( "left", 2753, 366 , 1 , $MOUSE_MOVE_SPEED)
  73.    
  74.     Sleep($POST_CLICK_DELAY)
  75.  
  76.     ;accept simulation
  77.     MouseClick ( "left", 3127, 842 , 1 , $MOUSE_MOVE_SPEED)
  78.     Sleep($POST_CLICK_DELAY)
  79.  
  80.     ;wait for sim to complete
  81.     Sleep($DEF_SIM_LENGTH)
  82.    
  83.     ;close level up if open
  84.     MouseClick( "left", 3055, 645, 1, $MOUSE_MOVE_SPEED )
  85.     Sleep($POST_CLICK_DELAY)
  86.  
  87.     ;close results window
  88.     MouseClick ( "left", 3193, 264 , 1 , $MOUSE_MOVE_SPEED)
  89.     Sleep($BASE_LOAD_DELAY)
  90.    
  91.     ;close sim window if open still
  92.     MouseClick ( "left", 3221, 218 , 1 , $MOUSE_MOVE_SPEED)
  93.     Sleep($POST_CLICK_DELAY)
  94.    
  95.     ;move mouse to center to show done
  96.     MouseMove(2897, 538, $MOUSE_MOVE_SPEED)
  97.     Sleep($POST_CLICK_DELAY)
  98. EndFunc
  99.  
  100. ;call the main method after script is initialized
  101. RunScript();
Advertisement
Add Comment
Please, Sign In to add comment