Advertisement
Guest User

DOOOOOOOOOOO

a guest
Mar 6th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 5.42 KB | None | 0 0
  1. #cs
  2. Autor:          Joël Alder, Kerim Kale
  3. Name:           DarkOrbit Bonusboxcollector
  4. Version:        1
  5. #ce
  6.  
  7. #include <MsgBoxConstants.au3>
  8. #include <ButtonConstants.au3>
  9. #include <GUIConstantsEx.au3>
  10. #include <WindowsConstants.au3>
  11. #include <Misc.au3>
  12.  
  13. HotKeySet("{F2}", "_main")
  14. HotKeySet("{F3}", "_exit")
  15. HotKeySet("{F4}", "_collectedcounter")
  16. HotKeySet("{F5}", "_timerstop")
  17. HotKeySet("{F6}", "_pause")
  18.  
  19. ;~ Global  $bonusbox = PixelSearch(0,0, @DesktopWidth, @DesktopHeight, 0xFDFFFA)
  20. ;~ $bot = False
  21. ;~ _pause()
  22.  
  23. Opt("GUIOnEventMode", 1)
  24.  
  25. GUICreate("AK's Dark Orbit Bot", 314, 123, -1, -1)
  26. GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
  27. Global $StartButton = GUICtrlCreateButton("Start", 32, 32, 75, 25)
  28. GUICTRLSETOnEvent(-1,"f2")
  29. Global $PauseButton = GUICtrlCreateButton("Pause", 120, 32, 75, 25)
  30. GUICtrlSetOnEvent(-1,"f6")
  31. Global $ExitButton = GUICtrlCreateButton("Exit", 208, 32, 75, 25)
  32. GUICtrlSetOnEvent(-1,"f3")
  33. Global $BonusboxCounterButton = GUICtrlCreateButton("Bonusbox Counter", 56, 72, 99, 25)
  34. GUICtrlSetOnEvent(-1,"f4")
  35. Global $TimerButton = GUICtrlCreateButton("Timer", 176, 72, 75, 25)
  36. GUICtrlSetOnEvent(-1,"f5")
  37. GUISetState()
  38. While 1
  39.    Sleep(100)
  40. WEnd
  41.  
  42.  
  43. Func _main()        ;Main funktion, mit F2 pausieren und starten
  44.    Global $bot = True
  45.       If $bot = True Then
  46.                            _timerstart()
  47.                            bot()
  48.       Else
  49.          _pause()
  50.       EndIf
  51. EndFunc
  52. Func bot()              ;Bot funktion
  53. Global $collectedcounter = 0
  54.           While $bot = True
  55.              GUISetState()
  56.                  Global  $bonusbox = PixelSearch(0,0, @DesktopWidth, @DesktopHeight, 0xFDFFFA)
  57.                  If IsArray($bonusbox) Then
  58.                         box()
  59.                  Else
  60.                         moveship()
  61.                  EndIf
  62.           WEnd
  63. EndFunc
  64. Func box()              ;Falls Bonusbox in Sicht
  65.           Global  $bonusbox = PixelSearch(0,0, @DesktopWidth, @DesktopHeight, 0xFDFFFA)
  66.           Global $collected = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,0x1B272E)
  67.           If IsArray($bonusbox) Then
  68.                move_stop()
  69.                  collect()
  70.                  MouseClick("left",$bonusbox[0],$bonusbox[1],1,1)
  71.                  Sleep(Random(2950,3950))
  72.                                  $collectedcounter += 1
  73.           EndIf
  74. EndFunc
  75. Func collect()          ;Mousemove für besseres Collecten
  76.           Global  $bonusbox = PixelSearch(0,0, @DesktopWidth, @DesktopHeight, 0xFDFFFA)
  77.           For $move_collect = 1 To 5 Step 1             ;Fährt mit der Maus über Bonusbox ( 5x 10 ms = 50ms)
  78.           MouseMove($bonusbox[0],$bonusbox[1],1)
  79.           Sleep(10)
  80.           Next
  81. EndFunc
  82. Func moveship()         ;Minimap klick, movement falls kein Bonusbox in Sicht (Minimap size: Kleinste Form + 1; Position: Unten Rechts)
  83.           MouseClick("left", Random(1700, 1895), Random(893, 1008), 1 , 1000)
  84.           moveship_collect()
  85. EndFunc
  86. Func moveship_collect()         ;collecting während des Fluges, nach Minimap klick [[FUNKTIONIERT NOCH NICHT GANZ]]
  87.           Global  $bonusbox = PixelSearch(0,0, @DesktopWidth, @DesktopHeight, 0xFDFFFA)
  88.           Global $sleep_collect = 0
  89.           While $sleep_collect < 50             ;Schleife mit 50 * 100 Sleep (=5000ms = 5s)
  90.                          $bonusbox = PixelSearch(0,0, @DesktopWidth, @DesktopHeight, 0xFDFFFA)                  ;Übergangslösung bis das mit dem Global klappt
  91.                  If IsArray($bonusbox) Then                     ;Falls Box in Sicht, Logout mit L für stehenbleiben danach collecten mit Func box(), falls nicht sleep.
  92.                     #cs
  93.                         Send("{L}")
  94.                         Sleep(800)                                      ;Sleep für warten bis Logout Fenster aufgeht und wieder geschlossen werden kann.
  95.                         Send("{L}")                         ; Zu schnelles schliessen, aktiviert das Logout Fenster wieder.
  96.                      #ce
  97.                         box()
  98.                  Else
  99.                         Sleep(10 )
  100.                  EndIf
  101.                  $sleep_collect += 1                    ;Counter für sleep and collect
  102.           WEnd
  103. EndFunc
  104.  
  105. Func _collectedcounter()                ;gibt nach drücken der F4 Taste aus wieviel Bonusboxen der Bot schon gesammelt hat und geht weiter sobald man auf OK drückt
  106.                  MsgBox (0,"","You already collected so many Bonusboxes: "&$collectedcounter,0)
  107. EndFunc
  108. Func move_stop()
  109.    MouseClick("left",908, 474,1,1)
  110.    MouseClick("left",1045, 625,1,1)
  111.    Sleep(500)
  112. EndFunc
  113. Func _timerstart()                      ;startet den Timer
  114.    Dim $TimerInit
  115.    Dim $Timer
  116.    Global $TimerInit = TimerInit()
  117. EndFunc
  118.  
  119.  
  120. func f2()
  121.    Send("{F2}")
  122. EndFunc
  123. func f3()
  124.    Send("{F3}")
  125. EndFunc
  126. func f4()
  127.    Send("{F4}")
  128. EndFunc
  129. func f5()
  130.    Send("{F5}")
  131. EndFunc
  132. func f6()
  133.    Send("{F6}")
  134. EndFunc
  135.  
  136. Func _timerstop()                       ;stoppt den Timer
  137.    $Timer = int (TimerDiff($TimerInit))
  138.    Global $h = Round($Timer/1000/60/60)
  139. Global $min = Round($Timer/1000/60)
  140. Global $sek = Round($Timer/1000)
  141.  
  142.    MsgBox(0,"","Der Bot läuft bereits:"&@crlf&$h&":"&$min&":"&$sek)
  143. EndFunc
  144.  
  145.  
  146. Func _pause()                                                   ;pause
  147.           While True
  148.                  Sleep(10)
  149.           WEnd
  150. EndFunc
  151.  
  152. Func _exit()                                                    ;Programm schliessen mit F3
  153.           Exit
  154. EndFunc
  155.  
  156. ;~ Func _test1()
  157. ;~    Run ("calc.exe")
  158. ;~ EndFunc
  159.  
  160. ;~ Func _test2()
  161.  
  162. ;~ EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement