Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Rengar The Rapist v1.4 by jbman
- ]]
- if myHero.charName ~= "Rengar" then return end
- --[[ Code ]]
- local mousemoving = true
- local waitDelay = 400
- local scanAdditionalRange = 750
- local nextTick = 0
- local wrange = 450
- local range = 750
- local erange = 575
- local canQ = false
- local lastBasicAttack = 0
- local swingDelay = 0.15
- local swing = 0
- local tick = nil
- local targetSelected = true
- local ts
- local ignite = nil
- local TMATSlot, SotDSlot BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil, nil, nil, nil
- local QREADY, WREADY, EREADY, RREADY, TMATREADY, SotDREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY = false, false, false, false, false, false, false, false, false, false
- function OnLoad()
- velocityTimer = {}
- oldPos = {}
- Velocity = {}
- oldTick = {}
- velocity = 0
- velocityTimeOut = 5
- conversionFactor = 975 --estimate. Converts coordinate velocity to game movement speed.
- msVarianceTrigger = 100 --will knock back when velocity > hero.ms + variance
- minMovementSpeed = 300 --minimum hero.ms to condemn. Sometimes hero.ms bugs and shows lesser values.
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if hero.team == TEAM_ENEMY then
- oldPos[hero.name] = {}
- oldTick[hero.name] = {}
- Velocity[hero.name] = 0
- velocityTimer[hero.name] = 0
- end
- end
- RCConfig = scriptConfig("Rengar the Rapist", "rengartherapist v1.4")
- RCConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
- RCConfig:addParam("scriptActive2", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 90)
- RCConfig:addParam("scriptActive3", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
- RCConfig:addParam("escape", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 89)
- RCConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
- RCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- RCConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
- RCConfig:addParam("autoEKS", "E Kill Steal", SCRIPT_PARAM_ONOFF, true)
- RCConfig:addParam("autoAAFarm", "Auto AA Farm", SCRIPT_PARAM_ONKEYDOWN, false, 192) -- `~
- RCConfig:addParam("autoEFarm", "Auto E Farm", SCRIPT_PARAM_ONKEYDOWN, false, 112) -- F1
- RCConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
- RCConfig:addParam("autoW", "Auto W", SCRIPT_PARAM_ONKEYTOGGLE, false, 84)
- RCConfig:permaShow("autoAAFarm")
- RCConfig:permaShow("autoEFarm")
- RCConfig:permaShow("autoW")
- RCConfig:permaShow("autoEKS")
- ts = TargetSelector(TARGET_LOW_HP,range+150,DAMAGE_PHYSICAL,true)
- ts.name = "Rengar"
- RCConfig:addTS(ts)
- enemyMinions = minionManager(MINION_ENEMY, range+150, player, MINION_SORT_HEALTH_ASC)
- 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 OnProcessSpell(unit, spell)
- if unit.isMe then
- if spell and spell.name:find("RengarQ")then
- canQ = false
- swing = 0
- end
- if spell and spell.name:find("RengarBasicAttack" or "RengarCritAttack") then
- swing = 1
- lastBasicAttack = os.clock()
- canQ = true
- end
- end
- end
- function OnCreateObj(obj)
- if canQ == true and obj and obj.name:find("RengarQ") then
- canQ = false
- swing = 0
- end
- if obj and (obj.name == "Rengar_LeapEnd.troy") and GetDistance(obj) < 150 then
- swing = 1
- lastBasicAttack = os.clock()
- canQ = true
- end
- --minionManager__OnCreateObj(object) -- OnCreateObj
- end
- function findmyHeroVelocity(target, oldPos, oldTick)
- if oldPos.x and oldPos.z and target.x and target.z then
- local dis = math.sqrt((oldPos.x - target.x) ^ 2 + (oldPos.z - target.z) ^ 2)
- Velocity[target.name] = (dis / (GetTickCount() - oldTick)) * conversionFactor
- end
- end
- --[[function OnDeleteObj(obj)
- minionManager__OnDeleteObj(object) -- OnDeleteObj
- end]]
- function OnTick()
- if myHero.dead then
- return
- end
- if swing == 1 and os.clock() > lastBasicAttack + 0.5 then
- swing = 0
- end
- --[[if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then
- if IREADY then
- local ignitedmg = 0
- for j = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(j)
- if ValidTarget(enemyhero,600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= (ignitedmg - 50) then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end]]
- TMATSlot, SotDSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3077) or GetInventorySlotItem(3074) , GetInventorySlotItem(3131), GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100) --
- 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)
- TMATREADY = (TMATSlot ~= nil and myHero:CanUseSpell(TMATSlot) == READY)
- SotDREADY = (SotDSlot ~= nil and myHero:CanUseSpell(SotDSlot) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- ts:update()
- if RCConfig.harass and ts.target ~= nil then
- if EREADY and GetDistance(ts.target) < erange then
- CastSpell(_E, ts.target)
- end
- end
- if RCConfig.autoW or RCConfig.autoEKS then
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if RCConfig.autoW then
- if ValidTarget(hero, nil, true) then
- if velocityTimer[hero.name] <= GetTickCount() and hero and hero.x and hero.z then
- velocityTimer[hero.name] = GetTickCount() + velocityTimeOut
- findmyHeroVelocity(hero, oldPos[hero.name], oldTick[hero.name])
- oldPos[hero.name].x = hero.x
- oldPos[hero.name].z = hero.z
- oldTick[hero.name] = GetTickCount()
- end
- if Velocity[hero.name] > (hero.ms + msVarianceTrigger) and hero.ms > minMovementSpeed and GetDistance(myHero, hero) < 475 then
- if WREADY then
- CastSpell(_W)
- end
- end
- end
- if ValidTarget(hero) and GetDistance(myHero, hero) < 450 then
- if myHero.mana < 5 and WREADY then
- CastSpell(_W)
- end
- end
- end
- if RCConfig.autoEKS then
- local edamage = getDmg("E",hero,myHero)
- if ValidTarget(hero) and GetDistance(myHero, hero) < erange and hero.health < edamage then
- if myHero.mana < 5 and EREADY then
- CastSpell(_E)
- end
- end
- end
- end
- end
- if (RCConfig.scriptActive or RCConfig.scriptActive1 or RCConfig.scriptActive2 or RCConfig.scriptActive3) and ts.target ~= nil and RCConfig.autoignite and IREADY then
- local QWEDmg = RENDmgCalculation(ts.target)
- local IDmg = getDmg("IGNITE",ts.target,myHero)
- if GetDistance(ts.target) < 600 and ts.target.health > QWEDmg and ts.target.health <= IDmg+QWEDmg then CastSpell(ignite, ts.target) end
- end
- if RCConfig.scriptActive and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then
- CastSpell(_W)
- end
- if swing == 0 then
- if (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then
- CastSpell(_E, ts.target)
- end
- if ts.target ~= nil and ValidTarget(ts.target, wrange) then
- myHero:Attack(ts.target)
- end
- elseif swing == 1 then
- if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(TMATSlot)
- swing = 0
- end
- if SotDREADY then
- if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
- CastSpell(SotDSlot)
- end
- end
- if EREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_E, ts.target)
- swing = 0
- elseif myHero.mana < 5 and QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- end
- end
- end
- if RCConfig.scriptActive2 and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then
- CastSpell(_W)
- end
- if swing == 0 then
- if myHero.mana == 4 and not (WREADY or QREADY) and (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then
- CastSpell(_E, ts.target)
- end
- if ts.target ~= nil and ValidTarget(ts.target, wrange) then
- myHero:Attack(ts.target)
- end
- elseif swing == 1 then
- if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(TMATSlot)
- swing = 0
- end
- if SotDREADY then
- if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
- CastSpell(SotDSlot)
- end
- end
- if canQ == true then
- if QREADY and os.clock() - lastBasicAttack > swingDelay and canQ == true then
- canQ = false
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_E, ts.target)
- swing = 0
- end
- end
- end
- end
- if RCConfig.scriptActive3 and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if GetDistance(ts.target) < wrange and WREADY then
- CastSpell(_W)
- end
- if swing == 0 then
- if myHero.mana == 4 and not (WREADY or QREADY) and (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then
- CastSpell(_E, ts.target)
- end
- if ts.target ~= nil and ValidTarget(ts.target, wrange) then
- myHero:Attack(ts.target)
- end
- elseif swing == 1 then
- if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(TMATSlot)
- swing = 0
- end
- if SotDREADY then
- if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
- CastSpell(SotDSlot)
- end
- end
- if myHero.mana < 5 and QREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_E, ts.target)
- swing = 0
- end
- end
- end
- if RCConfig.autoEFarm then
- enemyMinions:update()
- if mousemoving and GetTickCount() > nextTick then
- player:MoveTo(mousePos.x, mousePos.z)
- end
- for index, minion in pairs(enemyMinions.objects) do
- if minion and minion.dead == false then
- local myE = getDmg("E",minion,myHero)
- local myAA = getDmg("AD",minion,myHero)
- if EREADY then
- if player:GetDistance(minion) < range and minion.health <= myE and EREADY then
- CastSpell(_E, minion)
- end
- elseif EREADY == false then
- if minion and minion.health <= myAA and GetDistance(minion) <= (player.range + scanAdditionalRange) and GetTickCount() > nextTick then
- player:Attack(minion) ---PrintChat("ATTACKING")
- nextTick = GetTickCount() + waitDelay
- end
- end
- end
- end
- end
- --[[if mousemoving and GetTickCount() > nextTick then
- player:MoveTo(mousePos.x, mousePos.z)
- end
- for index, minion in pairs(enemyMinions.objects) do
- local myE = getDmg("E",minion,myHero)
- if minion and EREADY and myHero:GetDistance(minion) <= erange and minion.health <= myE and minion.dead == false then
- CastSpell(_E, minion)
- end
- end
- end
- for k = 1, objManager.maxObjects do
- local minionObjectI = objManager:GetObject(k)
- if minionObjectI ~= nil and string.find(minionObjectI.name,"Minion_") == 1 and minionObjectI.team ~= myHero.team and minionObjectI.dead == false then
- local myE = getDmg("E",minionObjectI,myHero)
- if myHero:GetDistance(minionObjectI) < 575 and minionObjectI.health <= myHero:CalcDamage(minionObjectI, myE) then
- CastSpell(_E, minionObjectI)
- end
- end
- end
- end]]
- if RCConfig.autoAAFarm then
- enemyMinions:update()
- if mousemoving and GetTickCount() > nextTick then
- player:MoveTo(mousePos.x, mousePos.z)
- end
- local tick = GetTickCount()
- if lasthiton then
- for index, minion in pairs(enemyMinions.objects) do
- if minion and minion.dead == false then
- local myAA = getDmg("AD",minion,myHero)
- if minion and minion.health <= myAA and GetDistance(minion) <= (player.range + scanAdditionalRange) and GetTickCount() > nextTick then
- player:Attack(minion)
- nextTick = GetTickCount() + waitDelay
- end
- end
- end
- end
- end
- end
- function RENDmgCalculation(enemy)
- local hitdamage = getDmg("AD",enemy,myHero)
- local qdamage = getDmg("Q",enemy,myHero)
- local qdamage2 = getDmg("Q",enemy,myHero,2) --to Isolated Target
- local wdamage = getDmg("W",enemy,myHero)
- local edamage = getDmg("E",enemy,myHero)
- local combo5 = 0
- if GetDistance(enemy) < 350 then
- combo5 = hitdamage
- if QREADY and myHero.mana < 5 then
- combo5 = combo5 + qdamage + hitdamage
- elseif QREADY and myHero.mana == 5 then
- combo5 = combo5 + qdamage2 + hitdamage
- end
- end
- if WREADY and GetDistance(enemy) < wrange then
- combo5 = combo5 + wdamage
- end
- if EREADY and GetDistance(enemy) < erange then
- combo5 = combo5 + edamage
- end
- return combo5
- end
- function OnDraw()
- if RCConfig.drawcircles and not myHero.dead then
- if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wrange, 0x992D3D) end
- if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, erange, 0xFFFFFF) end
- if ts.target ~= nil then
- for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
- end
- end
- end
- function OnSendChat(msg)
- ts:OnSendChat(msg, "pri")
- end
- PrintChat(" >> Rengar the Rapist v1.4 loaded!")
Advertisement
Add Comment
Please, Sign In to add comment