Advertisement
Guest User

Auto-Jungle-Tweaked-xkjtx.lua

a guest
Apr 2nd, 2013
866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.67 KB | None | 0 0
  1. PrintChat(" >> Auto Jungle loaded!")
  2.  
  3. --[[
  4.     Auto Jungle by ikita for BoL Studio 1.0a
  5.     numerate spawns, towers functions by botrik/Ivan
  6.         --Tweaked to xkjtx liking
  7. ]]
  8. --
  9. --require "BugsplatAvoider"
  10. --AvoidBugsplats(true) do return end
  11.  
  12. -- Code
  13.  
  14. -- Hot key to pause/start script is letter 'M'.
  15. -- Off at start of game. Press 'M' after getting in game.
  16.  
  17.  
  18.  
  19. function statusUpdate()
  20.     --Recall takes Priority
  21.     if GetInventorySlotItem(3106) == nil and player.gold > 750 and firstRecalled == false then  --First recall at 750g for madrd and boots
  22.         status = "recalling"
  23.     end
  24.     if player.gold > 1600 then
  25.         status = "recalling"
  26.     end
  27.     if player.health/player.maxHealth < 0.2 then  --Always recall when hp lower than 20%
  28.         status = "recalling"
  29.     end
  30.     if wolvesCleared and wraithsCleared and redCleared and blueCleared and golemCleared and status == "jungling" then  --Always recall when no camps available
  31.         status = "recalling"
  32.     end
  33.     --Jungle when full hp/mana at base
  34.     if status == "recalling" then
  35.         if GetDistance(allySpawn, player) < 100 then
  36.             if player.health == player.maxHealth then
  37.                 status = "jungling"
  38.             end
  39.         end
  40.     end
  41.    
  42. end
  43.  
  44. --Recalling AI
  45. function recall() --status = recalling
  46. --Only recall when no enemies around
  47.     recallLoc = player
  48.     for i=1, heroManager.iCount, 1 do
  49.         local target = heroManager:getHero(i)
  50.         if target ~= nil and target.dead == false and target.team ~= player.team and GetDistance(target, player) < 950 then
  51.             recallLoc = GetCloseTower(player,player.team)
  52.             safe = false
  53.         end
  54.     end
  55.     --Can add more recallLoc for tower divings
  56.     --Safe when no enemies around
  57.     if recallLoc ~= player then
  58.         if GetDistance(recallLoc, player) < 500 then
  59.             safe = true
  60.         end
  61.     end
  62.     if recallLoc == player then
  63.         safe = true
  64.     end
  65.     if safe == false then
  66.         player:MoveTo(recallLoc.x, recallLoc.z)
  67.     else
  68.         if recallCasting == false then
  69.             if inGameTime - recallCastTime > 2 then
  70.                 CastSpell(RECALL)
  71.                 recallCasting = true
  72.                 recallCastTime = inGameTime
  73.             end
  74.         end
  75.     end
  76.     --Check if Recall interupted:
  77.     if recallCasting == true and inGameTime - recallCastTime > 2 then
  78.         recallInterupted = true
  79.         for i=1, objManager.maxObjects, 1 do
  80.             local object = objManager:getObject(i)
  81.             if object ~= nil and object.valid and object.name == "TeleportHome.troy" and GetDistance(object, player) < 100 and object.visible then
  82.                 recallInterupted = false
  83.             end
  84.         end
  85.         if recallInterupted then
  86.             recallCasting = false
  87.         end
  88.     end
  89.     if GetDistance(allySpawn, player) < 500 then
  90.         recallCasting = false
  91.         statusUpdate()
  92.     end
  93. end
  94.  
  95. function shop()
  96.     if GetTickCount() > lastBuy + buyDelay then
  97.         if shopList[nextbuyIndex] ~= nil and GetInventorySlotItem(shopList[nextbuyIndex]) ~= nil then
  98.         --Last Buy successful
  99.             nextbuyIndex = nextbuyIndex + 1
  100.         else
  101.         --Last Buy unsuccessful (buy again)
  102.             BuyItem(shopList[nextbuyIndex])
  103.             lastBuy = GetTickCount()
  104.         end
  105.     end
  106.     if nextbuyIndex >= 2 then
  107.         firstRecalled = true
  108.     end
  109. end
  110.  
  111. --return towers table
  112. function GetTowers(team)
  113.     local towers = {}
  114.     for i=1, objManager.maxObjects, 1 do
  115.         local tower = objManager:getObject(i)
  116.         if tower ~= nil and tower.valid and tower.type == "obj_AI_Turret" and tower.visible and tower.team == team then
  117.             table.insert(towers,tower)
  118.         end
  119.     end
  120.     if #towers > 0 then
  121.         return towers
  122.     else
  123.         return false
  124.     end
  125. end
  126.  
  127. --here get close tower
  128. function GetCloseTower(hero, team)
  129.     local towers = GetTowers(team)
  130.     if #towers > 0 then
  131.         local candidate = towers[1]
  132.         for i=2, #towers, 1 do
  133.             if (towers[i].health/towers[i].maxHealth > 0.1) and GetDistance(candidate, hero) > GetDistance(towers[i], hero) then candidate = towers[i] end
  134.         end
  135.         return candidate
  136.     else
  137.         return false
  138.     end
  139. end
  140.  
  141. --Jungling AI Purple side
  142. function wolvesP()
  143.     --Go to wolves
  144.     if ((player.x - 10754)^2 + (player.z - 8318)^2)^(1/2) > 100 then
  145.         player:MoveTo(10754,8318)
  146.     else
  147.     --At wolves camp
  148.         if true then --Not killed yet
  149.             found813 = false
  150.             for i=1, objManager.maxObjects, 1 do
  151.                 local object = objManager:getObject(i)
  152.                 if object ~= nil and object.valid and object.name == "GiantWolf8.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  153.                     CastSpell(_W)
  154.                     player:Attack(object)
  155.                     CastSpell(_Q, object)
  156.                     wolvesStarted = true
  157.                     found813 = true
  158.                 end
  159.             end
  160.         end
  161.         if found813 == false then
  162.             found811 = false
  163.             for i=1, objManager.maxObjects, 1 do
  164.                 local object = objManager:getObject(i)
  165.                 if object ~= nil and object.valid and object.name == "wolf8.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  166.                     player:Attack(object)
  167.                     found811 = true
  168.                 end
  169.             end
  170.         end
  171.         if found811 == false then
  172.             found812 = false
  173.             for i=1, objManager.maxObjects, 1 do
  174.                 local object = objManager:getObject(i)
  175.                 if object ~= nil and object.valid and object.name == "wolf8.1.2" and GetDistance(object, player) < 600 and not object.dead  and object.visible then
  176.                     player:Attack(object)
  177.                     found812 = true
  178.                 end
  179.             end
  180.         end
  181.         if found812 == false then
  182.             wolvesCleared = true
  183.             wolvesStarted = false
  184.             wolvesClearTime = GetInGameTimer()
  185.         end
  186.     end
  187. end
  188.  
  189. function blueP()
  190.     --Go to blue
  191.     if ((player.x - 10807)^2 + (player.z - 6687)^2)^(1/2) > 200 then
  192.         player:MoveTo(10807,6687)
  193.     else
  194.     --At blue camp
  195.         if true then --Not killed yet
  196.             found711 = false
  197.             for i=1, objManager.maxObjects, 1 do
  198.                 local object = objManager:getObject(i)
  199.                 if object ~= nil and object.valid and object.name == "AncientGolem7.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  200.                     blueStarted = true
  201.                     CastSpell(_W)
  202.                     player:Attack(object)
  203.                     CastSpell(_Q, object)
  204.                     found711 = true
  205.                 end
  206.             end
  207.         end
  208.         if found711 == false then
  209.             found712 = false
  210.             for i=1, objManager.maxObjects, 1 do
  211.                 local object = objManager:getObject(i)
  212.                 if object ~= nil and object.valid and object.name == "YoungLizard7.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  213.                     player:Attack(object)
  214.                     found712 = true
  215.                 end
  216.             end
  217.         end
  218.         if found712 == false then
  219.             found713 = false
  220.             for i=1, objManager.maxObjects, 1 do
  221.                 local object = objManager:getObject(i)
  222.                 if object ~= nil and object.valid and object.name == "YoungLizard7.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  223.                     player:Attack(object)
  224.                     found713 = true
  225.                 end
  226.             end
  227.         end
  228.         if found713 == false then
  229.             blueCleared = true
  230.             blueStarted = false
  231.             blueClearTime = GetInGameTimer()
  232.         end
  233.     end
  234. end
  235.  
  236. function wraithsP()
  237.     --Go to wraiths
  238.     if ((player.x - 7475)^2 + (player.z - 9554)^2)^(1/2) > 200 then
  239.         player:MoveTo(7475,9554)
  240.     else
  241.     --At wraiths camp
  242.         if true then --Not killed yet
  243.             found913 = false
  244.             for i=1, objManager.maxObjects, 1 do
  245.                 local object = objManager:getObject(i)
  246.                 if object ~= nil and object.valid and object.name == "Wraith9.1.3" and GetDistance(object, player) < 900 and not object.dead and object.visible then
  247.                     CastSpell(_W)
  248.                     player:Attack(object)
  249.                     CastSpell(_Q, object)
  250.                     wraithsStarted = true
  251.                     found913 = true
  252.                 end
  253.             end
  254.         end
  255.         if found913 == false then
  256.             found911 = false
  257.             for i=1, objManager.maxObjects, 1 do
  258.                 local object = objManager:getObject(i)
  259.                 if object ~= nil and object.valid and object.name == "LesserWraith9.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  260.                     player:Attack(object)
  261.                     found911 = true
  262.                 end
  263.             end
  264.         end
  265.         if found911 == false then
  266.             found912 = false
  267.             for i=1, objManager.maxObjects, 1 do
  268.                 local object = objManager:getObject(i)
  269.                 if object ~= nil and object.valid and object.name == "LesserWraith9.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  270.                     player:Attack(object)
  271.                     found912 = true
  272.                 end
  273.             end
  274.         end
  275.         if found912 == false then
  276.             found914 = false
  277.             for i=1, objManager.maxObjects, 1 do
  278.                 local object = objManager:getObject(i)
  279.                 if object ~= nil and object.valid and object.name == "LesserWraith9.1.4" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  280.                     player:Attack(object)
  281.                     found914 = true
  282.                 end
  283.             end
  284.         end
  285.         if found914 == false then
  286.             wraithsCleared = true
  287.             wraithsStarted = false
  288.             wraithsClearTime = GetInGameTimer()
  289.         end
  290.     end
  291. end
  292.  
  293. function redP()
  294.     --Go to red
  295.     if ((player.x - 6594)^2 + (player.z - 11069)^2)^(1/2) > 500 then
  296.         player:MoveTo(6594,11069)
  297.     else
  298.     --At red camp
  299.         if true then --Not killed yet
  300.             found1011 = false
  301.             for i=1, objManager.maxObjects, 1 do
  302.                 local object = objManager:getObject(i)
  303.                 if object ~= nil and object.valid and object.name == "LizardElder10.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  304.                     CastSpell(_W)
  305.                     player:Attack(object)
  306.                     CastSpell(_Q, object)
  307.                     redStarted = true
  308.                     found1011 = true
  309.                 end
  310.             end
  311.         end
  312.         if found1011 == false then
  313.             found1012 = false
  314.             for i=1, objManager.maxObjects, 1 do
  315.                 local object = objManager:getObject(i)
  316.                 if object ~= nil and object.valid and object.name == "YoungLizard10.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  317.                     player:Attack(object)
  318.                     found1012 = true
  319.                 end
  320.             end
  321.         end
  322.         if found1012 == false then
  323.             found1013 = false
  324.             for i=1, objManager.maxObjects, 1 do
  325.                 local object = objManager:getObject(i)
  326.                 if object ~= nil and object.valid and object.name == "YoungLizard10.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  327.                     player:Attack(object)
  328.                     found1013 = true
  329.                 end
  330.             end
  331.         end
  332.         if found1013 == false then
  333.             redCleared = true
  334.             redStarted = false
  335.             redClearTime = GetInGameTimer()
  336.         end
  337.     end
  338. end
  339.  
  340. function golemP()
  341.     --Go to golem
  342.     if ((player.x - 5910)^2 + (player.z - 12122)^2)^(1/2) > 100 then
  343.         player:MoveTo(5910,12122)
  344.     else
  345.     --At golem camp
  346.         if true then --Not killed yet
  347.             found1112 = false
  348.             for i=1, objManager.maxObjects, 1 do
  349.                 local object = objManager:getObject(i)
  350.                 if object ~= nil and object.valid and object.name == "Golem11.1.2" and GetDistance(object, player) < 800 and not object.dead and object.visible then
  351.                     CastSpell(_W)
  352.                     player:Attack(object)
  353.                     CastSpell(_Q, object)
  354.                     golemStarted = true
  355.                     found1112 = true
  356.                 end
  357.             end
  358.         end
  359.         if found1112 == false then
  360.             found1111 = false
  361.             for i=1, objManager.maxObjects, 1 do
  362.                 local object = objManager:getObject(i)
  363.                 if object ~= nil and object.valid and object.name == "SmallGolem11.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  364.                     player:Attack(object)
  365.                     found1111 = true
  366.                 end
  367.             end
  368.         end
  369.         if found1111 == false then
  370.             golemCleared = true
  371.             golemStarted = false
  372.             golemClearTime = GetInGameTimer()
  373.         end
  374.     end
  375. end
  376.  
  377. --Jungling AI Blue side
  378. function wolvesB()
  379.     --Go to wolves
  380.     if ((player.x - 3350)^2 + (player.z - 6235)^2)^(1/2) > 100 then
  381.         player:MoveTo(3350,6235)
  382.     else
  383.     --At wolves camp
  384.         if true then --Not killed yet
  385.             found213 = false
  386.             for i=1, objManager.maxObjects, 1 do
  387.                 local object = objManager:getObject(i)
  388.                 if object ~= nil and object.valid and object.name == "GiantWolf2.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  389.                     CastSpell(_W)
  390.                     player:Attack(object)
  391.                     CastSpell(_Q, object)
  392.                     wolvesStarted = true
  393.                     found213 = true
  394.                 end
  395.             end
  396.         end
  397.         if found213 == false then
  398.             found211 = false
  399.             for i=1, objManager.maxObjects, 1 do
  400.                 local object = objManager:getObject(i)
  401.                 if object ~= nil and object.valid and object.name == "wolf2.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  402.                     player:Attack(object)
  403.                     found211 = true
  404.                 end
  405.             end
  406.         end
  407.         if found211 == false then
  408.             found212 = false
  409.             for i=1, objManager.maxObjects, 1 do
  410.                 local object = objManager:getObject(i)
  411.                 if object ~= nil and object.valid and object.name == "wolf2.1.2" and GetDistance(object, player) < 600 and not object.dead  and object.visible then
  412.                     player:Attack(object)
  413.                     found212 = true
  414.                 end
  415.             end
  416.         end
  417.         if found212 == false then
  418.             wolvesCleared = true
  419.             wolvesStarted = false
  420.             wolvesClearTime = GetInGameTimer()
  421.         end
  422.     end
  423. end
  424.  
  425. function blueB()
  426.     --Go to blue
  427.     if ((player.x - 3600)^2 + (player.z - 7626)^2)^(1/2) > 500 then
  428.         player:MoveTo(3600,7626)
  429.     else
  430.     --At blue camp
  431.         if true then --Not killed yet
  432.             found111 = false
  433.             for i=1, objManager.maxObjects, 1 do
  434.                 local object = objManager:getObject(i)
  435.                 if object ~= nil and object.valid and object.name == "AncientGolem1.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  436.                     blueStarted = true
  437.                     CastSpell(_W)
  438.                     player:Attack(object)
  439.                     CastSpell(_Q, object)
  440.                     found111 = true
  441.                 end
  442.             end
  443.         end
  444.         if found111 == false then
  445.             found112 = false
  446.             for i=1, objManager.maxObjects, 1 do
  447.                 local object = objManager:getObject(i)
  448.                 if object ~= nil and object.valid and object.name == "YoungLizard1.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  449.                     player:Attack(object)
  450.                     found112 = true
  451.                 end
  452.             end
  453.         end
  454.         if found112 == false then
  455.             found113 = false
  456.             for i=1, objManager.maxObjects, 1 do
  457.                 local object = objManager:getObject(i)
  458.                 if object ~= nil and object.valid and object.name == "YoungLizard1.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  459.                     player:Attack(object)
  460.                     found113 = true
  461.                 end
  462.             end
  463.         end
  464.         if found113 == false then
  465.             blueCleared = true
  466.             blueStarted = false
  467.             blueClearTime = GetInGameTimer()
  468.         end
  469.     end
  470. end
  471.  
  472. function wraithsB()
  473.     --Go to wraiths
  474.     if ((player.x - 6426)^2 + (player.z - 5209)^2)^(1/2) > 500 then
  475.         player:MoveTo(6426,5209)
  476.     else
  477.     --At wraiths camp
  478.         if true then --Not killed yet
  479.             found313 = false
  480.             for i=1, objManager.maxObjects, 1 do
  481.                 local object = objManager:getObject(i)
  482.                 if object ~= nil and object.valid and object.name == "Wraith3.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  483.                     CastSpell(_W)
  484.                     player:Attack(object)
  485.                     CastSpell(_Q, object)
  486.                     wraithsStarted = true
  487.                     found313 = true
  488.                 end
  489.             end
  490.         end
  491.         if found313 == false then
  492.             found311 = false
  493.             for i=1, objManager.maxObjects, 1 do
  494.                 local object = objManager:getObject(i)
  495.                 if object ~= nil and object.valid and object.name == "LesserWraith3.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  496.                     player:Attack(object)
  497.                     found311 = true
  498.                 end
  499.             end
  500.         end
  501.         if found311 == false then
  502.             found312 = false
  503.             for i=1, objManager.maxObjects, 1 do
  504.                 local object = objManager:getObject(i)
  505.                 if object ~= nil and object.valid and object.name == "LesserWraith3.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  506.                     player:Attack(object)
  507.                     found312 = true
  508.                 end
  509.             end
  510.         end
  511.         if found312 == false then
  512.             found314 = false
  513.             for i=1, objManager.maxObjects, 1 do
  514.                 local object = objManager:getObject(i)
  515.                 if object ~= nil and object.valid and object.name == "LesserWraith3.1.4" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  516.                     player:Attack(object)
  517.                     found314 = true
  518.                 end
  519.             end
  520.         end
  521.         if found314 == false then
  522.             wraithsCleared = true
  523.             wraithsStarted = false
  524.             wraithsClearTime = GetInGameTimer()
  525.         end
  526.     end
  527. end
  528.  
  529. function redB()
  530.     --Go to red
  531.     if ((player.x - 7500)^2 + (player.z - 3875)^2)^(1/2) > 500 then
  532.         player:MoveTo(7500,3875)
  533.     else
  534.     --At red camp
  535.         if true then --Not killed yet
  536.             found411 = false
  537.             for i=1, objManager.maxObjects, 1 do
  538.                 local object = objManager:getObject(i)
  539.                 if object ~= nil and object.valid and object.name == "LizardElder4.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  540.                     CastSpell(_W)
  541.                     player:Attack(object)
  542.                     CastSpell(_Q, object)
  543.                     redStarted = true
  544.                     found411 = true
  545.                 end
  546.             end
  547.         end
  548.         if found411 == false then
  549.             found412 = false
  550.             for i=1, objManager.maxObjects, 1 do
  551.                 local object = objManager:getObject(i)
  552.                 if object ~= nil and object.valid and object.name == "YoungLizard4.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  553.                     player:Attack(object)
  554.                     found412 = true
  555.                 end
  556.             end
  557.         end
  558.         if found412 == false then
  559.             found413 = false
  560.             for i=1, objManager.maxObjects, 1 do
  561.                 local object = objManager:getObject(i)
  562.                 if object ~= nil and object.valid and object.name == "YoungLizard4.1.3" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  563.                     player:Attack(object)
  564.                     found413 = true
  565.                 end
  566.             end
  567.         end
  568.         if found413 == false then
  569.             redCleared = true
  570.             redStarted = false
  571.             redClearTime = GetInGameTimer()
  572.         end
  573.     end
  574. end
  575.  
  576. function golemB()
  577.     --Go to golem
  578.     if ((player.x - 8200)^2 + (player.z - 2500)^2)^(1/2) > 500 then
  579.         player:MoveTo(8200,2500)
  580.     else
  581.     --At golem camp
  582.         if true then --Not killed yet
  583.             found512 = false
  584.             for i=1, objManager.maxObjects, 1 do
  585.                 local object = objManager:getObject(i)
  586.                 if object ~= nil and object.valid and object.name == "Golem5.1.2" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  587.                     CastSpell(_W)
  588.                     player:Attack(object)
  589.                     CastSpell(_Q, object)
  590.                     golemStarted = true
  591.                     found512 = true
  592.                 end
  593.             end
  594.         end
  595.         if found512 == false then
  596.             found511 = false
  597.             for i=1, objManager.maxObjects, 1 do
  598.                 local object = objManager:getObject(i)
  599.                 if object ~= nil and object.valid and object.name == "SmallGolem5.1.1" and GetDistance(object, player) < 600 and not object.dead and object.visible then
  600.                     player:Attack(object)
  601.                     found511 = true
  602.                 end
  603.             end
  604.         end
  605.         if found511 == false then
  606.             golemCleared = true
  607.             golemStarted = false
  608.             golemClearTime = GetInGameTimer()
  609.         end
  610.     end
  611. end
  612.  
  613. function OnLoad()
  614. firstRecalled = false
  615. shopList = {1039, 3106, 1001, 1036, 1053, 3154, 1033, 3111, 1028, 1036, 3044, 1033, 1043, 3091, 1031, 1011, 3068, 1011, 3022, 1031, 1033, 3026, 1036, 1053, 1037, 3144, 3153}
  616. buyDelay = 250
  617. lastBuy = 0
  618. nextbuyIndex = 1
  619. recallInterupted = false
  620. recallCasting = false
  621. abilityLevel = 0
  622. status = "jungling"
  623. inGameTime = 0
  624. pauseHK = 77 -- M
  625. paused = true -- True sets it off in game at start. Press letter "M" in game to turn on.
  626. found811 = true
  627. found812 = true
  628. found813 = true
  629. found711 = true
  630. found712 = true
  631. found713 = true
  632. found911 = true
  633. found912 = true
  634. found913 = true
  635. found914 = true
  636. found1011 = true
  637. found1012 = true
  638. found1013 = true
  639. found1111 = true
  640. found1112 = true
  641. found211 = true
  642. found212 = true
  643. found213 = true
  644. wolvesStarted = false
  645. wolvesCleared = false
  646. found111 = true
  647. found112 = true
  648. found113 = true
  649. blueStarted = false
  650. blueCleared = false
  651. found313 = true
  652. found311 = true
  653. found312 = true
  654. found314 = true
  655. wraithsStarted = false
  656. wraithsCleared = false
  657. found411 = true
  658. found412 = true
  659. found413 = true
  660. redStarted = false
  661. redCleared = false
  662. found511 = true
  663. found512 = true
  664. golemStarted = false
  665. golemCleared = false
  666. blueClearTime = -5000
  667. redClearTime = -5000
  668. wolvesClearTime = -5000
  669. wraithsClearTime = -5000
  670. golemClearTime = -5000
  671. recallArrivalTime = -5000
  672. mode = 0
  673. currentMode = nil
  674. safe = true
  675. abilitySequence = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
  676. recallCastTime = -5000
  677.     -- numerate spawn
  678.     for i=1, objManager.maxObjects, 1 do
  679.         local spawnCandidate = objManager:getObject(i)
  680.         if spawnCandidate ~= nil and spawnCandidate.type == "obj_SpawnPoint" then
  681.             if spawnCandidate.team == TEAM_ENEMY then enemySpawn = spawnCandidate
  682.             elseif spawnCandidate.team == player.team then allySpawn = spawnCandidate end --removed <3000x check
  683.            
  684.         end
  685.     end
  686. end
  687.  
  688. function OnTick()
  689.     if paused == false then
  690.         -- BLUE LOOP
  691.         if allySpawn.x ~= nil and allySpawn.x < 3000 then --Blue
  692.            
  693.             --Spam shop
  694.             --if inGameTime > 100 then
  695.             --shop()
  696.             --end
  697.            
  698.         --Always check the time
  699.             inGameTime = GetInGameTimer()
  700.            
  701.        
  702.         --First spawn at fountain
  703.             if inGameTime < 100 and inGameTime > 1 then
  704.                 --BuyItem(1029)--cloth armor
  705.                 --BuyItem(2003)--pots
  706.                 player:MoveTo(3350,6235) --wait at Wolves BLUE !!!!!!
  707.             end
  708.        
  709.         --Auto level up spells
  710.             if player.level > abilityLevel then
  711.                 abilityLevel=abilityLevel+1
  712.                 if abilitySequence[abilityLevel] == 1 then LevelSpell(_Q)
  713.                 elseif abilitySequence[abilityLevel] == 2 then LevelSpell(_W)
  714.                 elseif abilitySequence[abilityLevel] == 3 then LevelSpell(_E)
  715.                 elseif abilitySequence[abilityLevel] == 4 then LevelSpell(_R) end
  716.             end
  717.        
  718.         --Reset camps when they spawn
  719.             if GetInGameTimer() - wolvesClearTime > 60 then
  720.                 wolvesCleared = false
  721.                 found211 = true
  722.                 found212 = true
  723.                 found213 = true
  724.             end
  725.             if GetInGameTimer() - wraithsClearTime > 50 then
  726.                 wraithsCleared = false
  727.                 found313 = true
  728.                 found311 = true
  729.                 found312 = true
  730.                 found314 = true
  731.             end
  732.             if GetInGameTimer() - redClearTime > 300 then
  733.                 redCleared = false
  734.                 found411 = true
  735.                 found412 = true
  736.                 found413 = true
  737.             end
  738.             if GetInGameTimer() - blueClearTime > 300 then
  739.                 blueCleared = false
  740.                 found111 = true
  741.                 found112 = true
  742.                 found113 = true
  743.             end
  744.             if GetInGameTimer() - golemClearTime > 60 then
  745.                 golemCleared = false
  746.                 found511 = true
  747.                 found512 = true
  748.             end
  749.            
  750.         --Jungling AI
  751.             --Always finish current camp once started
  752.             if wolvesStarted then
  753.                 wolvesB()
  754.             elseif wraithsStarted then
  755.                 wraithsB()
  756.             elseif redStarted then
  757.                 redB()
  758.             elseif blueStarted then
  759.                 blueB()
  760.             elseif golemStarted then
  761.                 golemB()
  762.             elseif inGameTime > 102 then
  763.            
  764.                 statusUpdate()
  765.                
  766.                 if status == "jungling" then --Keep switching camps. Path: wolves->blue->wraiths->red->golems->wraiths->wolves->golems->wraiths->wolves..etc
  767.                     if golemCleared == false and redCleared == true then
  768.                         golemB()
  769.                     elseif blueCleared == false and wolvesCleared == true then
  770.                         blueB()
  771.                     elseif wraithsCleared == false and blueCleared == true then
  772.                         wraithsB()
  773.                     elseif redCleared == false and wraithsCleared == true then
  774.                         redB()
  775.                     elseif wolvesCleared == false and blueCleared == false then
  776.                         wolvesB()
  777.                     elseif wraithsCleared == false and golemCleared == true then
  778.                         wraithsB()
  779.                     elseif wolvesCleared == false and wraithsCleared == true then
  780.                         wolvesB()
  781.                     end
  782.                 end
  783.             end
  784.        
  785.             if status == "recalling" then
  786.                 recall()
  787.             end
  788.        
  789.         else --PURPLE LOOP
  790.        
  791.             --Spam shop
  792.             --if inGameTime > 100 then
  793.             --shop()
  794.             --end
  795.            
  796.         --Always check the time
  797.             inGameTime = GetInGameTimer()
  798.            
  799.        
  800.         --First spawn at fountain
  801.             if inGameTime < 100 and inGameTime > 1 then
  802.                 --BuyItem(1029)--cloth armor
  803.                 --BuyItem(2003)--pots
  804.                 player:MoveTo(10754,8318) --wait at Wolves PURPLE !!!!!!
  805.             end
  806.        
  807.         --Auto level up spells
  808.             if player.level > abilityLevel then
  809.                 abilityLevel=abilityLevel+1
  810.                 if abilitySequence[abilityLevel] == 1 then LevelSpell(_Q)
  811.                 elseif abilitySequence[abilityLevel] == 2 then LevelSpell(_W)
  812.                 elseif abilitySequence[abilityLevel] == 3 then LevelSpell(_E)
  813.                 elseif abilitySequence[abilityLevel] == 4 then LevelSpell(_R) end
  814.             end
  815.        
  816.         --Reset camps when they spawn
  817.             if GetInGameTimer() - wolvesClearTime > 60 then
  818.                 wolvesCleared = false
  819.                 found811 = true
  820.                 found812 = true
  821.                 found813 = true
  822.             end
  823.             if GetInGameTimer() - wraithsClearTime > 50 then
  824.                 wraithsCleared = false
  825.                 found913 = true
  826.                 found911 = true
  827.                 found912 = true
  828.                 found914 = true
  829.             end
  830.             if GetInGameTimer() - redClearTime > 300 then
  831.                 redCleared = false
  832.                 found1011 = true
  833.                 found1012 = true
  834.                 found1013 = true
  835.             end
  836.             if GetInGameTimer() - blueClearTime > 300 then
  837.                 blueCleared = false
  838.                 found711 = true
  839.                 found712 = true
  840.                 found713 = true
  841.             end
  842.             if GetInGameTimer() - golemClearTime > 60 then
  843.                 golemCleared = false
  844.                 found1011 = true
  845.                 found1012 = true
  846.             end
  847.            
  848.         --Jungling AI
  849.             --Always finish current camp once started
  850.             if wolvesStarted then
  851.                 wolvesP()
  852.             elseif wraithsStarted then
  853.                 wraithsP()
  854.             elseif redStarted then
  855.                 redP()
  856.             elseif blueStarted then
  857.                 blueP()
  858.             elseif golemStarted then
  859.                 golemP()
  860.             elseif inGameTime > 102 then
  861.            
  862.                 statusUpdate()
  863.                
  864.                 if status == "jungling" then --Keep switching camps. Path: wolves->blue->wraiths->red->golems->wraiths->wolves->golems->wraiths->wolves..etc
  865.                     if golemCleared == false and redCleared == true then
  866.                         golemP()
  867.                     elseif blueCleared == false and wolvesCleared == true then
  868.                         blueP()
  869.                     elseif wraithsCleared == false and blueCleared == true then
  870.                         wraithsP()
  871.                     elseif redCleared == false and wraithsCleared == true then
  872.                         redP()
  873.                     elseif wolvesCleared == false and blueCleared == false then
  874.                         wolvesP()
  875.                     elseif wraithsCleared == false and golemCleared == true then
  876.                         wraithsP()
  877.                     elseif wolvesCleared == false and wraithsCleared == true then
  878.                         wolvesP()
  879.                     end
  880.                 end
  881.             end
  882.             if status == "recalling" then
  883.                 recall()
  884.             end
  885.         end
  886.     end
  887. end
  888.  
  889. function OnWndMsg(msg,key)
  890.     if msg == KEY_DOWN then
  891.         if key == pauseHK then
  892.             if paused then
  893.                     paused = false
  894.                     PrintChat(" >> resumed!")
  895.             else
  896.                     paused = true
  897.                     PrintChat(" >> paused")
  898.             end
  899.         end
  900.     end
  901. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement