Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.81 KB | None | 0 0
  1. #include <ImageSearch.au3>
  2. #include <lib.au3>
  3.  
  4. ; --- Stamina Check ---
  5.  
  6. Dim $x
  7. Dim $y
  8.  
  9. $read_stam = IniRead("user.ini", "colors","stam_color", "1")
  10.  
  11. If  $read_stam = 1 Then
  12. WinWaitActive("Darkfall Online")
  13. Sleep(3000)
  14.  
  15.     $mystam = _ImageSearch("images\stambar.bmp", 1, $x, $y, 35)
  16.     Sleep(250)
  17.    
  18.     if $mystam = 0 then
  19.         ToolTip("failed")
  20.     Else
  21.         tooltip("success")
  22.     EndIf
  23.        
  24.  
  25. $stam_color = PixelGetColor($x-45, $y)
  26. IniWrite("user.ini", "colors", "stam_color", $stam_color)
  27. EndIf
  28.  
  29.  
  30. ; --- Harvesting ---
  31. HotKeySet ("{ESC}", "_Exit")
  32. $num = 1
  33. $switch = InputBox( "Tools", "How many tools do you have? (starting on slot #1 to slot #5)", 1 )
  34. Sleep(100)
  35. ;$shutoff = MsgBox ( 4, "Shutdown", "After the script is over, would you like your computer to shutdown?" )
  36. Sleep(100)
  37.  
  38. WinWaitActive("Darkfall Online")
  39. Sleep(1000)
  40.  
  41.  
  42.  
  43. While 1
  44.    
  45.     Harvest()
  46.  
  47. WEnd
  48.  
  49. Func Harvest()
  50.    
  51.     $read_stam = IniRead("user.ini", "colors","stam_color", "1")
  52.    
  53.     Do
  54.         $stam_color = PixelGetColor($x-45, $y)
  55.         WinWaitActive("Darkfall Online")   
  56.         MouseClick("left")
  57.         Sleep(1500)
  58.     Until $read_stam <> $stam_color
  59.  
  60.     _hStop()
  61.    
  62.     _imgRest()
  63.    
  64.     _SwitchSlot($switch)
  65.    
  66.     _face()
  67.  
  68.     $num += 1
  69.     ;If $num > $switch * 4 And $shutoff = 6 Then Shutdown(1)
  70.    
  71. EndFunc
  72.  
  73. Func _hStop()
  74.     WinWaitActive("Darkfall Online")
  75.     Send("{c down}")
  76.     sleep(1200)
  77.     Send("{c up}")
  78.     sleep(500)
  79. EndFunc
  80.  
  81. Func _face()
  82.     WinWaitActive("Darkfall Online")
  83.     Send("{down down}")
  84.     sleep(750)
  85.     Send("{down up}")
  86.     sleep(500)
  87. EndFunc
  88.  
  89. Func _imgRest()
  90. Sleep(500)
  91. Send("r") ; sheathe
  92. Sleep(1200)
  93. Send("6") ; rest hotkey
  94. Sleep(2200)
  95. MouseClick("left")
  96.  
  97. Do
  98.     sleep(1000)
  99.     $mystam = _ImageSearch("images\stambar.bmp", 1, $x, $y, 35)
  100.     Sleep(250)
  101. Until $mystam = 1
  102.  
  103. Send("{Space}")
  104. Sleep(2000)
  105. Send("r") ; unsheathe
  106. Sleep(1500)
  107. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement