Guest User

Untitled

a guest
May 3rd, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.27 KB | None | 0 0
  1. REG = {}
  2.  
  3.  
  4.  
  5. -- Ankulua
  6.  
  7. SIMILAR = 0.7
  8.  
  9. WIDTH = 720
  10.  
  11. HEIGHT = 1280
  12.  
  13. ROOT = scriptPath()
  14.  
  15. DIR_IMAGES = ROOT .. "images/"
  16.  
  17. DIR_LIBS = ROOT .. "libs/"
  18.  
  19. setImagePath(DIR_IMAGES)
  20.  
  21.  
  22.  
  23. -- Ankulua settings
  24.  
  25. Settings:setCompareDimension(true, WIDTH)
  26.  
  27. Settings:setScriptDimension(true, WIDTH)
  28.  
  29. Settings:set("MinSimilarity", 0.8)
  30.  
  31. --libs/add debug
  32. --add debug lua
  33. dofile(scriptPath().."DebugMyScript.luac")
  34.  
  35.  
  36. luaLib = loadstring(httpGet("https://raw.githubusercontent.com/mercobots/luaLib/master/luaLib.lua"))
  37.  
  38. luaLib()
  39.  
  40. commonLib = loadstring(httpGet("https://raw.githubusercontent.com/AnkuLua/commonLib/master/commonLib.lua"))
  41.  
  42. commonLib()
  43.  
  44.  
  45.  
  46.  
  47. REG.image = {
  48.  
  49.     image_region = Region(0, 0, 720, 1280),
  50.     image_region2 = Region(532, 436, 180, 60),
  51.    -- image_region2 = Region(432, 811, 246, 85),
  52.     image_region3 = Region(495, 1181, 180, 60),
  53.     image_region4 = Region(362, 716, 240, 80),
  54.     image_region5 = Region(433, 876, 170, 80),
  55.     image_region6 = Region(508, 914, 80, 80),
  56.     image_region7 = Region(18, 18, 60, 60),
  57.     image_region8 = Region(157, 1164, 420, 114),
  58. }
  59.  
  60.  
  61.  
  62.  
  63. function joinrally()
  64. toast("Joining Rally")
  65.     if REG.image.image_region:existsClick("bos1.png", 10) then
  66.  
  67.         if REG.image.image_region8:existsClick("join.png", 4) then
  68.  
  69.             rallyset()
  70.  
  71.         else keyevent(4) joinrally2()
  72.  
  73.         end
  74.  
  75.     end
  76.  
  77. end
  78.  
  79.  
  80. function joinrally2()
  81.  
  82.     if REG.image.image_region2:existsClick("bos1.png", 100) then
  83.  
  84.         if REG.image.image_region:waitClick("join.png", 100) then
  85.  
  86.             rallyset()
  87.  
  88.         else REG.image.image_region7:existsClick("back.png")
  89.  
  90.             keyevent(4) joinrally3()
  91.  
  92.         end
  93.  
  94.     end
  95.  
  96. end
  97.  
  98.  
  99. function joinrally3()
  100.  
  101.     if REG.image.image_region3:existsClick("bos3.png", 1) then
  102.  
  103.         if REG.image.image_region:waitClick("join.png", 1) then
  104.  
  105.             rallyset()
  106.  
  107.         else REG.image.image_region7:existsClick("back.png")
  108.  
  109.             keyevent(4) joinrally()
  110.  
  111.         end
  112.  
  113.     end
  114.  
  115. end
  116.  
  117. function rallyset()
  118.  
  119.     if REG.image.image_region:click("prst.png") then
  120.  
  121.         if REG.image.image_region:click("mrch.png") then
  122.  
  123.             if REG.image.image_region4:waitClick("confirmstm.png", 2) then
  124.  
  125.                 do stam()
  126.  
  127.                 end
  128.  
  129.             else if REG.image.image_region:click("acm.png") then
  130.  
  131.                 if REG.image.image_region:click("war.png") then
  132.  
  133.                     joinrally()
  134.  
  135.                 end
  136.  
  137.             end
  138.  
  139.             end
  140.  
  141.         end
  142.  
  143.     end
  144.  
  145. end
  146.  
  147. function stam()
  148.  
  149.     if REG.image.image_region5:existsClick("usestm.png", 2) then
  150.  
  151.         if REG.image.image_region6:existsClick("usestm2.png", 2)then
  152.  
  153.             if REG.image.image_region7:existsClick("back.png") then
  154.  
  155.                 if REG.image.image_region:click("mrch.png") then
  156.                                 --I changed this ^ from march.png
  157.                     if REG.image.image_region:click("acm.png") then
  158.  
  159.                         if REG.image.image_region:click("war.png") then
  160.  
  161.                             joinrally()
  162.  
  163.                         end
  164.  
  165.                     end
  166.  
  167.                 end
  168.  
  169.             end
  170.  
  171.         end
  172.  
  173.     end
  174.  
  175. end
  176. -----Main Script Start-----
  177.  
  178. while true do
  179.     joinrally()
  180. end
Add Comment
Please, Sign In to add comment