Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Press spacebar to cast Q, W, E (Only using W on self)
- Press X to Harass with Q
- Press S to smart cast W on self/ally
- Press Z to smart cast R on self/ally
- Edited by DrMundo for Kayle -
- Taking parts from TRUS kassadin script. (From his dropbox)
- :: dabbled by xkjtx(added W and R cast on ally)
- :: HeX's (AA) code from his Kayle helper
- ]]--
- if myHero.charName ~= "Kayle" then return end
- ---------------------------
- ------ Configuration ------
- ---------------------------
- local hotkey = 32 --[[ Spacebar (Cast Q, W, E)(With auto Attacks!) ]]--
- local harasskey = 88 --[[ X (Only cast Q spell) ]]--
- local healkey = 83 --[[ S (Cast W on self/ally while holding your mouse over) ]]--
- local sheildkey = 90 --[[ Z (Cast Ult on self/ally while holding your mouse over) ]]--
- --[[ ------------------------------------
- ---- Script Start [Do not change] ----
- -------------------------------------- ]]--
- -- Runtime variables
- local scriptActive = false
- local harassActive = false
- local HealActive = false
- local RshieldActive = false
- local lastBasicAttack = 0
- local startAttackSpeed = 0.625
- local swing = 0
- local nextTick = 0
- local waitDelay = 400
- local _wBuffer = 400 --Wont use W unless they are this far away. 400 by default.
- local _Qrange = 650
- local _Erange = 625
- local ts
- function OnLoad()
- PrintChat("Kayle -SBTW-")
- -- put true if you want to be able to GetTarget()
- ts = TargetSelector(TARGET_LOW_HP,_Qrange+125,DAMAGE_MAGIC)
- lastBasicAttack = os.clock()
- end
- function OnWndMsg(msg, key)
- if key == hotkey then
- if msg == KEY_DOWN then
- scriptActive = true
- elseif msg == KEY_UP then
- scriptActive = false
- end
- end
- if key == harasskey then
- if msg == KEY_DOWN then
- harassActive = true
- elseif msg == KEY_UP then
- harassActive = false
- end
- end
- if key == healkey then
- if msg == KEY_DOWN then
- HealActive = true
- elseif msg == KEY_UP then
- HealActive = false
- end
- end
- if key == sheildkey then
- if msg == KEY_DOWN then
- RshieldActive = true
- elseif msg == KEY_UP then
- RshieldActive = false
- end
- end
- end
- function OnProcessSpell(unit, spell)
- if unit.isMe and (spell.name:find("Attack") ~= nil) then
- swing = 1
- lastBasicAttack = os.clock()
- end
- end
- function OnTick()
- if myHero.dead then return end
- ts:update()
- AttackDelay = (1000/(myHero.attackSpeed/(1/startAttackSpeed)))/1000
- if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
- swing = 0
- end
- if not player.dead and RshieldActive then
- -- added by xkjtx: given to by TRUS: this will cast R on self/ally while holding mouse over
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if hero.team == myHero.team and GetDistanceFromMouse(hero)<200 ---here is your value
- then
- CastSpell(_R,hero)
- end
- end
- end
- if not player.dead and HealActive then
- -- added by xkjtx: given to by TRUS: this will cast W on self/ally while holding mouse over
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if hero.team == myHero.team and GetDistanceFromMouse(hero)<200 ---here is your value
- then
- CastSpell(_W,hero)
- end
- end
- end
- if not player.dead and scriptActive and ts.target ~= nil then
- if GetInventoryHaveItem(3128) then
- CastItem(3128, ts.target)
- end
- if player:CanUseSpell(_Q) == READY and GetMyHero():GetDistance(ts.target) < _Qrange then
- CastSpell(_Q, ts.target)
- end
- if player:CanUseSpell(_W) == READY and GetMyHero():GetDistance(ts.target) < _wBuffer then
- CastSpell(_W, myHero)
- end
- if player:CanUseSpell(_E) == READY and GetMyHero():GetDistance(ts.target) < _Erange then
- CastSpell(_E, ts.target)
- end
- --[[ Auto Attacks ]]--
- local tick = GetTickCount()
- if swing == 0 then
- if GetDistance(ts.target) < _Qrange and GetTickCount() > nextTick then
- myHero:Attack(ts.target)
- nextTick = GetTickCount() + waitDelay
- end
- elseif swing == 1 and GetTickCount() > (nextTick + 100) then
- myHero:MoveTo(mousePos.x, mousePos.z)
- end
- end
- if not player.dead and harassActive and ts.target ~= nil then
- if player:CanUseSpell(_Q) == READY and GetMyHero():GetDistance(ts.target) < _Qrange then
- CastSpell(_Q, ts.target)
- end
- end
- end
- function OnDraw()
- if player.dead then return end
- --DrawCircle(player.x, player.y, player.z, _Qrange, 0xFF80FF00)
- if scriptActive then DrawText("Script Active",16,100,80,0xFF80FF00) end
- if HealActive then DrawText("Heal Active",16,100,80,0xFF80FF00) end
- if harassActive then DrawText("Harass Active",16,100,80,0xFF80FF00) end
- if RshieldActive then DrawText("Shield Active",16,100,80,0xFF80FF00) end
- if ts.target ~= nil then
- DrawText("Targetting: " .. ts.target.charName, 16, 100, 100, 0xFFFF0000)
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement