krawson

Edgeworld Defense Simulator Full Automatic Level Grinding

Jul 31st, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.71 KB | None | 0 0
  1. #include <Misc.au3>
  2.  
  3. ;constants
  4. Const $POST_CLICK_DELAY = 200
  5. Const $MOUSE_MOVE_SPEED = 3
  6. Const $DEF_SIM_LENGTH = 29000
  7. Const $BASE_LOAD_DELAY = 6000
  8.  
  9. ;objects
  10. Local $hDLL = DllOpen("user32.dll")
  11.  
  12. ;Main Script Function
  13. Func RunScript()
  14.     BlockInput(1)
  15.    
  16.     ;make sure we are scrolled all the way to the bottom
  17.     ScrollGameViewDown()
  18.    
  19.     While 1 = 1
  20.         ;lets fire a single run of the sim
  21.         RunSingleSim();
  22.         If _IsPressed("1B", $hDLL) Then
  23.             DllClose($hDLL)
  24.             ExitLoop
  25.         EndIf
  26.     WEnd
  27.    
  28.     BlockInput(0)
  29. EndFunc
  30.  
  31. Func ScrollGameViewDown()
  32.     MouseClickDrag("left", 2252, 319, 2252, 134)
  33. EndFunc
  34.  
  35. Func RunSingleSim()
  36.     ; open the simulations window
  37.     MouseClick ( "left", 3425, 602 , 2 , $MOUSE_MOVE_SPEED)
  38.     Sleep($POST_CLICK_DELAY)
  39.  
  40.     ;select the highest defense sim
  41.     MouseClick ( "left", 2676, 450 , 1 , $MOUSE_MOVE_SPEED)
  42.     Sleep($POST_CLICK_DELAY)
  43.  
  44.     ;go to the last page
  45.     MouseClick ( "left", 3005, 790 , 10 , $MOUSE_MOVE_SPEED)
  46.     Sleep($POST_CLICK_DELAY)
  47.  
  48.     ;select the last level in the sim
  49.     MouseClick ( "left", 2829, 398 , 1 , $MOUSE_MOVE_SPEED)
  50.     Sleep($POST_CLICK_DELAY)
  51.  
  52.     ;accept simulation
  53.     MouseClick ( "left", 3127, 842 , 1 , $MOUSE_MOVE_SPEED)
  54.     Sleep($POST_CLICK_DELAY)
  55.  
  56.     ;wait for sim to complete
  57.     Sleep($DEF_SIM_LENGTH)
  58.    
  59.     ;TODO make sure we are closing the level up if showing
  60.  
  61.     ;close results window
  62.     MouseClick ( "left", 3193, 264 , 1 , $MOUSE_MOVE_SPEED)
  63.     Sleep($BASE_LOAD_DELAY)
  64.    
  65.     ;close sim window if open still
  66.     MouseClick ( "left", 3221, 218 , 1 , $MOUSE_MOVE_SPEED)
  67.     Sleep($POST_CLICK_DELAY)
  68.    
  69.     ;move mouse to center to show done
  70.     MouseMove(2897, 538, $MOUSE_MOVE_SPEED)
  71.     Sleep($POST_CLICK_DELAY)
  72. EndFunc
  73.  
  74. ;call the main method after script is initialized
  75. RunScript();
Advertisement
Add Comment
Please, Sign In to add comment