Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.48 KB | None | 0 0
  1. if GetObjectName(GetMyHero()) ~= "Olaf" then return end
  2.  
  3. require "OpenPredict"
  4.  
  5. if not FileExist(COMMON_PATH.. "Analytics.lua") then
  6.   DownloadFileAsync("https://raw.githubusercontent.com/LoggeL/GoS/master/Analytics.lua", COMMON_PATH .. "Analytics.lua", function() end)
  7. end
  8.  
  9. require("Analytics")
  10.  
  11. Analytics("OlafTheLooter", "MemoTheCollector")
  12.  
  13. local QStats = {delay = 0.25, speed = 1600, width = 90, range = 1000}
  14. local EDamage = 0
  15. local lastlevel = GetLevel(myHero)-1
  16. local enemy = GetCurrentTarget()
  17.  
  18. ---GoS 1.0 funeral
  19. local OlafMenu = Menu("Olaf", "Olaf")
  20. OlafMenu:SubMenu("Combo", "Combo")
  21. OlafMenu.Combo:Boolean("Q", "Use Q", true)
  22. OlafMenu.Combo:Boolean("W", "Use W", true)
  23. OlafMenu.Combo:Boolean("E", "Use E", true)
  24. OlafMenu.Combo:Boolean("R", "Use R", true)
  25.  
  26. ---BeAHoeAndPush
  27. OlafMenu:SubMenu("LaneClear", "LaneClear")
  28. OlafMenu.LaneClear:Boolean("QL", "Use Q", true)
  29. OlafMenu.LaneClear:Boolean("EL", "Use E", true)
  30. OlafMenu.LaneClear:Slider("Mana", "if Mana % >", 30, 0, 100, 1)
  31.  
  32. ---ADcarriesFavourite
  33. OlafMenu:SubMenu("LastHit","LastHit")
  34. OlafMenu.LastHit:Boolean("ELSHT", "Use E", true)
  35. OlafMenu.LastHit:Boolean("QLSHT", "Use Q", true)
  36. OlafMenu.LastHit:Boolean("ALSHT", "Auto Last Hit", true)
  37.  
  38. ---GreedyASF
  39. OlafMenu:SubMenu("KillSteal", "KillSteal")
  40. OlafMenu.KillSteal:Boolean("QKS", "KillSteal with Q", true)
  41. OlafMenu.KillSteal:Boolean("EKS", "KillSteal with E", true)
  42.  
  43. ---MisCancerous
  44. OlafMenu:SubMenu("Misc", "Misc")
  45. OlafMenu.Misc:SubMenu("AUL", "Auto Level")
  46. OlafMenu.Misc.AUL:Boolean("AUL", "Auto level skills", true)
  47. OlafMenu.Misc.AUL:Boolean("AUW", "QWE", false)
  48. OlafMenu.Misc.AUL:Boolean("AUE", "QEW", false)
  49. OlafMenu.Misc:Boolean("WAutoX", "Use Auto W on X Enemies", true)
  50. OlafMenu.Misc:Slider("WAutoXE", "X Enemies to use W",3,1,5,1)
  51.  
  52. ---PictureDeftsuNaked
  53. OlafMenu:SubMenu("Draw", "Drawings")
  54. OlafMenu.Draw:Boolean("DAA", "Draw AA Range", true)
  55. OlafMenu.Draw:Boolean("DQ", "Draw Q Range", true)
  56. OlafMenu.Draw:Boolean("DE", "Draw E Range", true)
  57.  
  58. --- some spaghetti coders say this will cause fps to get better
  59. function Mode()
  60.     if IOW_Loaded then
  61.         return IOW:Mode()
  62.     elseif DAC_Loaded then
  63.         return DAC:Mode()
  64.     elseif PW_Loaded then
  65.         return PW:Mode()
  66.     elseif GoSWalkLoaded and GoSWalk.CurrentMode then
  67.         return ({"Combo", "Harass", "LaneClear", "LastHit"})[GoSWalk.CurrentMode+1]
  68.     elseif AutoCarry_Loaded then
  69.         return DACR:Mode()
  70.     elseif _G.SLW_Loaded then
  71.         return SLW:Mode()
  72.     elseif _G.EOW_Loaded then
  73.         return EOW:Mode()
  74.     end
  75.     return ""
  76. end
  77.  
  78. OnTick (function()
  79.     EDamage = 25 + 45 * GetCastLevel(myHero,_E) + myHero.totalDamage*.4
  80.     QDamage = 25 + 45 * GetCastLevel(myHero, _Q) + GetBonusDmg(myHero)
  81.     --Rbuff()
  82.     if Mode() == "LaneClear" then
  83.       LaneClear()
  84.     elseif Mode() == "LastHit" then
  85.       LastHit()
  86.     elseif Mode() == "Combo" then
  87.         Combo()
  88.     end
  89.     AutoWX()
  90.     AutoLastHit()
  91.     KillSteal()  
  92. end)
  93.  
  94. function Combo()
  95.     if Ready(_Q) and OlafMenu.Combo.Q:Value() and ValidTarget(enemy,GetCastRange(myHero, _Q)) then
  96.         local predQ = GetLinearAOEPrediction(enemy, QStats)
  97.         if predQ and predQ.hitChance >= 0.25 then
  98.             CastSkillShot(_Q,predQ.castPos)
  99.         end
  100.     end  
  101.     if Ready(_E) and OlafMenu.Combo.E:Value() and ValidTarget(enemy, GetCastRange(myHero, _E)) then
  102.        CastTargetSpell(enemy, _E)
  103.     end
  104. end              
  105.  
  106.  
  107. --- You'll need to hold down lasthit button key
  108. function LastHit()
  109.     if Ready(_E) and OlafMenu.LastHit.ELSHT:Value() then
  110.         for _, minion in pairs(minionManager.objects) do
  111.             if ValidTarget(minion, GetCastRange(myHero, _E)) and EDamage > GetCurrentHP(minion) then
  112.               CastTargetSpell(minion, _E)
  113.               break
  114.             end
  115.         end
  116.     end
  117.     if Ready(_Q) and OlafMenu.LastHit.QLSHT:Value() then
  118.         for _, minion in pairs(minionManager.objects) do
  119.             if ValidTarget(minion, GetCastRange(myHero, _Q)) and CalcDamage(myHero,minion,QDamage,0) > GetCurrentHP(minion) then
  120.                   CastSkillShot(_Q, minion.pos)
  121.                   break
  122.             end
  123.         end
  124.     end
  125. end
  126.  
  127. --- Amazing killsteal function, you'll never miss that KS
  128. function KillSteal()
  129.     if Ready(_E) and OlafMenu.KillSteal.EKS:Value() then
  130.         for _, enemy in pairs(GetEnemyHeroes()) do
  131.             if ValidTarget(enemy, GetCastRange(myHero, _E)) and EDamage > GetCurrentHP(enemy) then
  132.               CastTargetSpell(enemy, _E)
  133.             end
  134.         end
  135.     end
  136.     if Ready(_Q) and OlafMenu.KillSteal.QKS:Value() then
  137.       for _,enemy in pairs(GetEnemyHeroes()) do
  138.           if ValidTarget(enemy,GetCastRange(myHero, _Q)) and CalcDamage(myHero,enemy,QDamage,0) > GetCurrentHP(enemy) then
  139.               local predQ = GetLinearAOEPrediction(enemy, QStats)
  140.               if predQ and predQ.hitChance >= 0.25 then
  141.                   CastSkillShot(_Q,predQ.castPos)
  142.               end
  143.           end
  144.       end
  145.    end
  146. end
  147.  
  148. --- The Q Sometimes won't hit the whole lane full of minions, cuz linearOP.. but E is amazing
  149. function LaneClear()
  150.     if Ready(_Q) and OlafMenu.LaneClear.QL:Value() and GetPercentMP(myHero) > OlafMenu.LaneClear.Mana:Value() then
  151.          for _,minion in pairs(minionManager.objects) do
  152.             if ValidTarget(minion, GetCastRange(myHero, _Q)) then
  153.                 CastSkillShot(_Q,minion.pos)
  154.                 break
  155.             end
  156.          end
  157.     end
  158.     if Ready(_E) and OlafMenu.LaneClear.EL:Value() and GetPercentMP(myHero) > OlafMenu.LaneClear.Mana:Value() then
  159.         for _, minion in pairs(minionManager.objects) do
  160.             if ValidTarget(minion, GetCastRange(myHero, _E)) then
  161.               CastTargetSpell(minion, _E)
  162.               break
  163.             end
  164.         end
  165.     end
  166. end
  167.  
  168. ---obviously
  169. function AutoLastHit()
  170.     for _,closeminion in pairs(minionManager.objects) do
  171.         if not KeyIsDown(32) then
  172.             if Ready(_E) and OlafMenu.LastHit.ALSHT:Value() then
  173.                 if ValidTarget(closeminion, GetCastRange(myHero, _E)) and EDamage > GetCurrentHP(closeminion) then
  174.                    CastTargetSpell(closeminion, _E)
  175.                    break       
  176.                 end
  177.             end
  178.         end
  179.     end
  180. end
  181.  
  182. function AutoWX()
  183.     if OlafMenu.Misc.WAutoX:Value() and Ready(_W) and EnemiesAround(myHeroPos(), 350) >= 1 and (EnemiesAround(myHeroPos(), 350) >= OlafMenu.Misc.WAutoXE:Value()) then
  184.         CastSkillShot(_W, myHeroPos())
  185.     end
  186. end
  187.  
  188. Printchat("<font color=\"#FF5000\">Olaf The Looter: </font> <font color=\#FFFFFF\">"..tostring(x).."</font>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement