Advertisement
Guest User

bot truc

a guest
Mar 31st, 2014
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.77 KB | None | 0 0
  1. #cs ----------------------------------------------------------------------------
  2.  
  3.  AutoIt Version: 3.3.8.1
  4.  Author:         myName
  5.  
  6.  Script Function:
  7.     Template AutoIt script.
  8.  
  9. #ce ----------------------------------------------------------------------------
  10.  
  11. ; Script Start - Add your code below here
  12. #RequireAdmin
  13. $blue = 0x6969FF;
  14. $yellow = 0xFFFF00
  15. $green = 0x00FF00
  16. $legend = 0xFF8000
  17. $gem = 0x99bbff
  18.  
  19. $pickupGem = IniRead("config.ini", "LootType", "Gems", True)
  20. $pickupYellow = IniRead("config.ini", "LootType", "Yellow", True)
  21. $pickupLegend = IniRead("config.ini", "LootType", "Legendary", True)
  22.  
  23. $lootX = 635
  24. $lootY = 208
  25. $endLootX = 1208
  26. $endLootY = 605
  27. WinActivate("Diablo III")
  28. Global $paused;
  29. Global $start = TimerInit()
  30.  
  31. HotKeySet("{PAUSE}", "TogglePause")
  32.  
  33. Global $state = "Init";
  34.  
  35. Init();
  36.  
  37. While 1
  38.    StartGame()
  39. WEnd
  40.  
  41. Func TogglePause ()
  42.    $paused = NOT $paused
  43.    while $paused
  44.       sleep(10)
  45.    WEnd
  46. EndFunc
  47.  
  48. Func Init()
  49.    
  50. EndFunc
  51.  
  52. Func StartGame ()
  53.    $found = False
  54.    while NOT $found
  55.       $coord = PixelSearch(340, 513, 341, 514, 0x290400, 10)
  56.       If Not @error Then
  57.          $found = true;
  58.          Sleep(500)
  59.          MouseClick("left", 340, 513, 1, 50)
  60.       Else
  61.          Sleep(200);
  62.       EndIf;
  63.    WEnd
  64.    $start = TimerInit()
  65.    usePortal()
  66. EndFunc
  67.  
  68. Func usePortal()
  69.    $found = false;
  70.    while not $found
  71.       $coord = PixelSearch(439, 1013, 440, 1014, 0x35373B, 10)
  72.       If Not @error Then
  73.          $found = True
  74.          Sleep(1000)
  75.          MouseClick("left", 159, 117, 1, 10)
  76.       Else
  77.          Sleep(100)
  78.       EndIf
  79.    WEnd
  80.    GoToBoss()
  81. EndFunc
  82.  
  83. Func GoToBoss()
  84.    Sleep(5000)
  85.    $found = False
  86.    while not $found
  87.       $coord = PixelSearch(679, 215, 679, 215, 0x245cb4, 30)
  88.       If Not @error Then
  89.          $found = True
  90.          Sleep(2000)
  91.          MouseClick("left", 679, 215, 1, 10)
  92.       Else
  93.          Sleep(100)
  94.       EndIf
  95.    WEnd
  96.    StartBoss()
  97. EndFunc
  98.  
  99. Func StartBoss()
  100.    Sleep(4000)
  101.    $found = False
  102.    while not $found
  103.       $coord = PixelSearch(135, 572, 135, 572, 0x6D6236, 30)
  104.       If Not @error Then
  105.          $found = True
  106.          Sleep(2000)
  107.          MouseClick("left", 777, 957, 2, 20)
  108.       Else
  109.          sleep(100)
  110.       EndIf
  111.    WEnd
  112.    BeatBoss()
  113. EndFunc
  114.  
  115. Func BeatBoss()
  116.    Sleep(2500)
  117.    $dead = False
  118.    
  119.    Send("2")
  120.    Send("3")
  121.    Send("4")
  122.    MouseMove(1150, 137)
  123.    MouseDown("right")
  124.    Send("1")
  125.    while not $dead
  126.       $coords = PixelSearch(880, 144, 1360, 425, $yellow, 1)
  127.       If Not @error Then
  128.          MouseUp("right")
  129.          if $pickupYellow Then
  130.             MouseClick("left", $coords[0], $coords[1], 1, 10)
  131.          EndIf
  132.          $dead = True
  133.          Sleep(2000)
  134.       Else
  135.          $coords = PixelSearch(880, 144, 1360, 425, $legend, 3)
  136.          If Not @error Then
  137.             $dead = True
  138.              MouseUp("right")
  139.             MouseClick("left", $coords[0], $coords[1], 1, 10)
  140.             Sleep(2000)
  141.          EndIf
  142.          Sleep(500)
  143.       EndIf
  144.       if TimerDiff($start) > 180000 Then
  145.          $dead = True
  146.          MouseUp("right")
  147.       EndIf
  148.    WEnd
  149.    Loot()
  150. EndFunc
  151.  
  152. Func Loot()
  153.  
  154.    $nothingToFind = false
  155.    while not $nothingToFind
  156.       $nothingToFind = True
  157.       if $pickupYellow Then
  158.          if LootItem($yellow) Then
  159.             $nothingToFind = false;
  160.          EndIf;
  161.       EndIf
  162.       Sleep(500)
  163.       If $pickupGem Then
  164.          If LootItem($gem) Then
  165.             $nothingToFind = false;
  166.          EndIf
  167.       EndIf
  168.       if $pickupLegend Then
  169.          If LootItem($legend) Then
  170.             $nothingToFind = False
  171.          EndIf
  172.          If LootItem($green) Then
  173.             $nothingToFind = False
  174.          EndIf
  175.       EndIf
  176.    WEnd
  177.    Sleep(100)
  178.    EndGame()
  179. EndFunc
  180.  
  181. Func LootItem ($color)
  182.    $coords = PixelSearch($lootX, $lootY, $endLootX, $endLootY, $color, 3)
  183.    If Not @error Then
  184.       MouseClick("left", $coords[0], $coords[1], 1, 10)
  185.       Sleep(1000)
  186.       return True;
  187.    Else
  188.       return False;
  189.    EndIf
  190. EndFunc
  191. Func EndGame ()
  192.    Send("{ESCAPE}")
  193.    Sleep(100)
  194.    MouseClick("left", 340, 473, 1, 10)
  195.    Sleep(15000)
  196. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement