Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if myHero.charName ~= "Karma" then return end
- require 'Prodiction'
- local empowered = false
- class 'TickManager'
- function TickManager:__init(ticksPerSecond)
- self.TPS = ticksPerSecond
- self.lastClock = 0
- self.currentClock = 0
- end
- function TickManager:__type()
- return "TickManager"
- end
- function TickManager:setTPS(ticksPerSecond)
- self.TPS = ticksPerSecond
- end
- function TickManager:getTPS(ticksPerSecond)
- return self.TPS
- end
- function TickManager:isReady()
- self.currentClock = os.clock()
- if self.currentClock < self.lastClock + (1 / self.TPS) then return false end
- self.lastClock = self.currentClock
- return true
- end
- local tm = TickManager(20)
- function OnLoad()
- Load()
- Menu()
- end
- function OnTick()
- ReadyCheck()
- --[[ Combos ]]--
- if ts.target and not myHero.dead then
- if KarmaConfig.Combo then
- UseItems(ts.target)
- autoCombo(ts.target)
- end
- if KarmaConfig.Harass and QREADY then
- castQ(ts.target, true)
- end
- end
- --[[ Ignite ]]--
- if KarmaConfig.autoignite and IREADY then
- AutoIgnite()
- end
- end
- function OnDraw()
- if KarmaConfig.circlesSelf and not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x19A712)
- end
- if KarmaConfig.circlesEnemies and ts.target then
- for i=1, 5, 1 do
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, 50+3*i, 0xFF0000)
- end
- end
- end
- --[[ Script Functions ]]--
- function autoCombo(target)
- if QREADY and target.health < getDmg("Q", target, myHero) then
- castQ(target, false)
- elseif QREADY and target.health < getDmg("Q", target, myHero, 2) and (RREADY or empowered) then
- castQ(target, true)
- elseif myHero.health <= myHero.maxHealth*0.70 and WREADY and GetDistance(target) <= wRange and (RREADY or empowered) then
- WCombo(target)
- elseif not QREADY and myHero.health <= myHero.maxHealth*0.65 and GetDistance(target) <= eRadius and EREADY and (RREADY or empowered) then
- ECombo(target)
- else
- QCombo(target)
- end
- end
- function QCombo(target)
- if WREADY and GetDistance(target) <= wRange then
- CastSpell(_W, target)
- end
- if QREADY then castQ(target, true) end
- if not KarmaConfig.supportMode and GetDistance(target) >= 600 and myHero.mana >= 200 then
- CastSpell(_E, myHero)
- end
- end
- function WCombo(target)
- if WREADY and GetDistance(target) <= wRange then
- if RREADY or empowered then
- CastSpell(_R)
- CastSpell(_W, target)
- else
- CastSpell(_W, target)
- end
- end
- if QREADY then castQ(target, false) end
- if not KarmaConfig.supportMode and GetDistance(target) >= 600 and myHero.mana >= 200 then
- CastSpell(_E, myHero)
- end
- end
- function ECombo(target)
- if WREADY and GetDistance(target) <= wRange then
- CastSpell(_W, target)
- end
- if EREADY and GetDistance(target) <= eRadius then
- if RREADY or empowered then
- CastSpell(_R)
- CastSpell(_E, myHero)
- end
- end
- if QREADY then castQ(target, false) end
- end
- --[[ Base Functions ]]--
- function Load()
- --[[ Ranges ]]--
- qRange, wRange, eRange, eRadius = 950, 650, 800, 400
- --[[ Ready ]]--
- ignite = nil
- QREADY, WREADY, EREADY, RREADY = false, false, false, false
- BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = nil, nil, nil,
- nil, nil, nil, nil, nil
- BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY, YGBREADY, IREADY =
- false, false, false, false, false, false, false, false, false
- end
- function Menu()
- KarmaConfig = scriptConfig("Karma Helper", "KarmaHelper")
- KarmaConfig:addParam("Combo", "Empowered Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- KarmaConfig:addParam("Harass", "Q Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
- KarmaConfig:addParam("empLogic", "Use Empowered Q Logic", SCRIPT_PARAM_ONOFF, false)
- KarmaConfig:addParam("supportMode", "Support Mode", SCRIPT_PARAM_ONOFF, false)
- KarmaConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
- KarmaConfig:addParam("circlesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, true)
- KarmaConfig:addParam("circlesEnemies", "Draw Circles - Enemies", SCRIPT_PARAM_ONOFF, true)
- ts = TargetSelector(TARGET_LOW_HP, qRange, DAMAGE_MAGIC)
- ts.name = "Karma"
- KarmaConfig:addTS(ts)
- PrintChat("<font color='#CCCCCC'> >> Karma Combo loaded! <<</font>")
- if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite =
- SUMMONER_2
- end
- end
- function castQ(target, castR)
- local qPred, info = Prodiction.GetPrediction(target, 1050, 1700, 0.25, 90)
- if qPred and GetDistance(qPred) <= qRange and info.hitchance > 1 and not info.mCollision() then
- if VIP_USER then
- if castR and (RREADY or empowered) then
- if KarmaConfig.empLogic and (info.hitchance > 2 or target.health < getDmg("Q", target, myHero, 2)) then
- CastSpell(_R)
- CastSpell(_Q, qPred.x, qPred.z)
- elseif not KarmaConfig.empLogic then
- CastSpell(_R)
- CastSpell(_Q, qPred.x, qPred.z)
- else
- CastSpell(_Q, qPred.x, qPred.z)
- end
- else
- CastSpell(_Q, qPred.x, qPred.z)
- end
- end
- end
- end
- function ReadyCheck()
- if not tm:isReady() then return end
- ts:update()
- BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot =
- GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146),
- GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074),
- GetInventorySlotItem(3143), GetInventorySlotItem(3142)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
- BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
- BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
- TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
- RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
- RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
- YGBREADY = (YGBSlot ~= nil and myHero:CanUseSpell(YGBSlot) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- end
- function UseItems(target)
- if GetDistance(target) < 550 then
- if DFGREADY then CastSpell(DFGSlot, target) end
- if HXGREADY then CastSpell(HXGSlot, target) end
- if BWCREADY then CastSpell(BWCSlot, target) end
- if BRKREADY then CastSpell(BRKSlot, target) end
- if YGBREADY then CastSpell(YGBSlot, target) end
- if TMTREADY and GetDistance(target) < 275 then CastSpell(TMTSlot) end
- if RAHREADY and GetDistance(target) < 275 then CastSpell(RAHSlot) end
- if RNDREADY and GetDistance(target) < 275 then CastSpell(RNDSlot) end
- end
- end
- function AutoIgnite()
- local ignitedmg = 0
- for i = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(i)
- if ValidTarget(enemyhero, 600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= ignitedmg then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- function OnGainBuff(unit, buff)
- if unit.isMe and buff.name == "KarmaMantra" then empowered = true end
- end
- function OnLoseBuff(unit, buff)
- if unit.isMe and buff.name == "KarmaMantra" then empowered = false end
- end
Advertisement
Add Comment
Please, Sign In to add comment