Guest User

Simple Orb Walker 1.0

a guest
Jul 5th, 2013
10,273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.92 KB | None | 0 0
  1. --[[
  2.     Simple Orb Walker 1.0
  3.         by Manciuszz and eXtragoZ
  4.         Based in Auto Carry - Extreme Orb-walking by Sida
  5.        
  6.     Features:
  7.         - Orb Walker: Orb walks around the target champion (works with every champion)
  8.         - Orb Walker - Auto Attack (VIP only): Orb walks around the closest thing unless there is a champion in range
  9.         - Supports: Bilgewater Cutlass, Hextech Gunblade and Blade of the Ruined King
  10.         - Auto attack reset detection
  11.         - Prevents the cancellation of Katarina and Nunu ults
  12.         - Marks the target
  13.         - Press shift to configure
  14.        
  15.     I recommend using it with Simple Automatic Target Selector Priority Arranger
  16.     http://botoflegends.com/forum/topic/3968-simple-automatic-target-selector-priority-arranger/
  17. --]]
  18.  
  19. ------ Configuration -------
  20. local OrbWalkerKey = 32
  21. local OrbWalkerKeyAA = GetKey("Y")
  22.  
  23. ---------------------
  24. local SOWConfig, ts, MyTrueRange
  25. local HitBoxSize = 65
  26. local lastAttack = GetTickCount()
  27. local walkDistance = 300
  28. local lastWindUpTime = 0
  29. local lastAttackCD = 0
  30.  
  31. --Channeling related
  32. local lastAnimation = ""
  33. local lastChanneling = 0
  34. --
  35. function OnLoad()
  36.     MyTrueRange = myHero.range + HitBoxSize
  37.     SOWConfig = scriptConfig("Simple Orb Walker 1.0", "simpleOrbWalker")
  38.     SOWConfig:addParam("OrbWalker", "Orb Walker", SCRIPT_PARAM_ONKEYDOWN, false, OrbWalkerKey)
  39.     if VIP_USER then SOWConfig:addParam("OrbWalkerAA", "Orb Walker - Auto Attack", SCRIPT_PARAM_ONKEYDOWN, false, OrbWalkerKeyAA) end
  40.     SOWConfig:addParam("attackFocused", "Kite focused targets", SCRIPT_PARAM_ONOFF, false)
  41.     SOWConfig:addParam("drawCircles", "Display circles", SCRIPT_PARAM_ONOFF, true)
  42.     ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, MyTrueRange, DAMAGE_PHYSICAL, false)
  43.     ts.name = "OrbWalker"
  44.     SOWConfig:addTS(ts)
  45.     PrintChat(" >> Simple Orb Walker 1.0 loaded!")
  46. end
  47.  
  48. function OnProcessSpell(object, spell)
  49.     if myHero.dead then return end
  50.     local spellIsAA = (spell.name:lower():find("attack") or isSpellAttack(spell.name)) and not isNotAttack(spell.name)
  51.     if object.isMe then
  52.         if spellIsAA then
  53.             lastAttack = GetTickCount() - GetLatency()/2
  54.             lastWindUpTime = spell.windUpTime*1000
  55.             lastAttackCD = spell.animationTime*1000
  56.         elseif refreshAttack(spell.name) then
  57.             lastAttack = GetTickCount() - GetLatency()/2 - lastAttackCD
  58.         end
  59.     end
  60. end
  61.  
  62. function OnTick()
  63.     MyTrueRange = myHero.range + HitBoxSize
  64.     ts.range = MyTrueRange
  65.     ts.targetSelected = SOWConfig.attackFocused
  66.     ts:update()
  67.     if myHero.dead or myHeroisChanneling() then return end
  68.     if SOWConfig.OrbWalker or SOWConfig.OrbWalkerAA then
  69.         if (SOWConfig.OrbWalker or SOWConfig.OrbWalkerAA) and ts.target ~= nil and GetDistance(ts.target) - HitBoxSize < MyTrueRange then
  70.             if GetDistance(ts.target) <= 500 then
  71.                 if GetInventoryItemIsCastable(3153) then
  72.                     CastItem(3153, ts.target)
  73.                 elseif GetInventoryItemIsCastable(3144) then
  74.                     CastItem(3144, ts.target)
  75.                 elseif GetInventoryItemIsCastable(3146) then
  76.                     CastItem(3146, ts.target)
  77.                 end
  78.             end
  79.             if timeToShoot() then
  80.                 myHero:Attack(ts.target)
  81.             elseif heroCanMove() then
  82.                 moveToCursor()
  83.             end
  84.         elseif SOWConfig.OrbWalkerAA then
  85.             if timeToShoot() then
  86.                 local moveToPos = myHero + (Vector(mousePos) - myHero):normalized()*walkDistance
  87.                 Packet("S_MOVE", {type = 7, x = moveToPos.x, y = moveToPos.z}):send()
  88.             elseif heroCanMove() then
  89.                 moveToCursor()
  90.             end
  91.         elseif heroCanMove() then
  92.             moveToCursor()
  93.         end
  94.     end
  95. end
  96. function heroCanMove()
  97.     return (GetTickCount() + GetLatency()/2 > lastAttack + lastWindUpTime + 20)
  98. end
  99. function timeToShoot()
  100.     return (GetTickCount() + GetLatency()/2 > lastAttack + lastAttackCD)
  101. end
  102. function moveToCursor()
  103.     if GetDistance(mousePos) > 50 or lastAnimation == "Idle1" then
  104.         local moveToPos = myHero + (Vector(mousePos) - myHero):normalized()*walkDistance
  105.         myHero:MoveTo(moveToPos.x, moveToPos.z)
  106.     end
  107. end
  108. function OnDraw()
  109.     if not myHero.dead and SOWConfig.drawCircles then
  110.         DrawCircle(myHero.x, myHero.y, myHero.z, MyTrueRange, 0x19A712)
  111.         if ts.target ~= nil then
  112.             for j=0, 5 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 50 + j*1.5, 0x00FF00) end
  113.         end
  114.     end
  115. end
  116. --Channeling related
  117. function OnSendPacket(p)
  118.     local packet = Packet(p)
  119.     if packet:get('name') == 'S_CAST' and packet:get('sourceNetworkId') == myHero.networkID then
  120.         local spellId = packet:get('spellId')
  121.         if (myHero.charName == "Katarina" and spellId == _R) or (myHero.charName == "Nunu" and spellId == _R) then
  122.             lastChanneling = GetTickCount()
  123.         end
  124.     end
  125. end
  126. function OnAnimation(unit,animationName)
  127.     if unit.isMe and lastAnimation ~= animationName then lastAnimation = animationName end
  128. end
  129. function myHeroisChanneling()
  130.     return (
  131.         (GetTickCount() <= lastChanneling + GetLatency() + 50)
  132.         or (myHero.charName == "Katarina" and lastAnimation == "Spell4")
  133.         or (myHero.charName == "Nunu" and (lastAnimation == "Spell4" or lastAnimation == "Spell4_Loop"))
  134.     )
  135. end
  136. --
  137. function refreshAttack(spellName)
  138.     return (
  139.         --Blitzcrank
  140.         spellName == "PowerFist"
  141.         --Darius
  142.         or spellName == "DariusNoxianTacticsONH"
  143.         --Nidalee
  144.         or spellName == "Takedown"
  145.         --Sivir
  146.         or spellName == "Ricochet"
  147.         --Teemo
  148.         or spellName == "BlindingDart"
  149.         --Vayne
  150.         or spellName == "VayneTumble"
  151.         --Jax
  152.         or spellName == "JaxEmpowerTwo"
  153.         --Mordekaiser
  154.         or spellName == "MordekaiserMaceOfSpades"
  155.         --Nasus
  156.         or spellName == "SiphoningStrikeNew"
  157.         --Rengar
  158.         or spellName == "RengarQ"
  159.         --Wukong
  160.         or spellName == "MonkeyKingDoubleAttack"
  161.         --Yorick
  162.         or spellName == "YorickSpectral"
  163.         --Vi
  164.         or spellName == "ViE"
  165.         --Garen
  166.         or spellName == "GarenSlash3"
  167.         --Hecarim
  168.         or spellName == "HecarimRamp"
  169.         --XinZhao
  170.         or spellName == "XenZhaoComboTarget"
  171.         --Leona
  172.         or spellName == "LeonaShieldOfDaybreak"
  173.         --Shyvana
  174.         or spellName == "ShyvanaDoubleAttack"
  175.         or spellName == "shyvanadoubleattackdragon"
  176.         --Talon
  177.         or spellName == "TalonNoxianDiplomacy"
  178.         --Trundle
  179.         or spellName == "TrundleTrollSmash"
  180.         --Volibear
  181.         or spellName == "VolibearQ"
  182.         --Poppy
  183.         or spellName == "PoppyDevastatingBlow"
  184.     )
  185. end
  186. function isSpellAttack(spellName)
  187.     return (
  188.         --Ashe
  189.         spellName == "frostarrow"
  190.         --Caitlyn
  191.         or spellName == "CaitlynHeadshotMissile"
  192.         --Quinn
  193.         or spellName == "QuinnWEnhanced"
  194.         --Trundle
  195.         or spellName == "TrundleQ"
  196.         --XinZhao
  197.         or spellName == "XenZhaoThrust"
  198.         or spellName == "XenZhaoThrust2"
  199.         or spellName == "XenZhaoThrust3"
  200.         --Garen
  201.         or spellName == "GarenSlash2"
  202.         --Renekton
  203.         or spellName == "RenektonExecute"
  204.         or spellName == "RenektonSuperExecute"
  205.     )
  206. end
  207. function isNotAttack(spellName)
  208.     return (
  209.         --Shyvana
  210.         spellName == "shyvanadoubleattackdragon"
  211.         or spellName == "ShyvanaDoubleAttack"
  212.         --MonkeyKing
  213.         or spellName == "MonkeyKingDoubleAttack"
  214.         --JarvanIV
  215.         --or spellName == "JarvanIVCataclysmAttack"
  216.         --or spellName == "jarvanivcataclysmattack"
  217.     )
  218. end
Advertisement
Add Comment
Please, Sign In to add comment