Coder Social home page Coder Social logo

stiflerbr's Projects

ahri---the-nine-tailed-fox.lua icon ahri---the-nine-tailed-fox.lua

local version = "1.166" --[[ Ahri - the Nine-Tailed Fox Author: Draconis Version: 1.166 Copyright 2014 Dependency: Standalone --]] if myHero.charName ~= "Ahri" then return end HWID = Base64Encode(tostring(os.getenv("PROCESSOR_IDENTIFIER")..os.getenv("USERNAME")..os.getenv("COMPUTERNAME")..os.getenv("PROCESSOR_LEVEL")..os.getenv("PROCESSOR_REVISION"))) id = 44 ScriptName = "AhriTheNineTailedFox" -- BoL Tracker assert(load(Base64Decode("G0x1YVIAAQQEBAgAGZMNChoKAAAAAAAAAAAAAQIDAAAAJQAAAAgAAIAfAIAAAQAAAAQKAAAAVXBkYXRlV2ViAAEAAAACAAAADAAAAAQAETUAAAAGAUAAQUEAAB2BAAFGgUAAh8FAAp0BgABdgQAAjAHBAgFCAQBBggEAnUEAAhsAAAAXwAOAjMHBAgECAgBAAgABgUICAMACgAEBgwIARsNCAEcDwwaAA4AAwUMDAAGEAwBdgwACgcMDABaCAwSdQYABF4ADgIzBwQIBAgQAQAIAAYFCAgDAAoABAYMCAEbDQgBHA8MGgAOAAMFDAwABhAMAXYMAAoHDAwAWggMEnUGAAYwBxQIBQgUAnQGBAQgAgokIwAGJCICBiIyBxQKdQQABHwCAABcAAAAECAAAAHJlcXVpcmUABAcAAABzb2NrZXQABAcAAABhc3NlcnQABAQAAAB0Y3AABAgAAABjb25uZWN0AAQQAAAAYm9sLXRyYWNrZXIuY29tAAMAAAAAAABUQAQFAAAAc2VuZAAEGAAAAEdFVCAvcmVzdC9uZXdwbGF5ZXI/aWQ9AAQHAAAAJmh3aWQ9AAQNAAAAJnNjcmlwdE5hbWU9AAQHAAAAc3RyaW5nAAQFAAAAZ3N1YgAEDQAAAFteMC05QS1aYS16XQAEAQAAAAAEJQAAACBIVFRQLzEuMA0KSG9zdDogYm9sLXRyYWNrZXIuY29tDQoNCgAEGwAAAEdFVCAvcmVzdC9kZWxldGVwbGF5ZXI/aWQ9AAQCAAAAcwAEBwAAAHN0YXR1cwAECAAAAHBhcnRpYWwABAgAAAByZWNlaXZlAAQDAAAAKmEABAYAAABjbG9zZQAAAAAAAQAAAAAAEAAAAEBvYmZ1c2NhdGVkLmx1YQA1AAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAMAAAADAAAAAwAAAAMAAAAEAAAABAAAAAUAAAAFAAAABQAAAAYAAAAGAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAgAAAAHAAAABQAAAAgAAAAJAAAACQAAAAkAAAAKAAAACgAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAAMAAAACwAAAAkAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAGAAAAAgAAAGEAAAAAADUAAAACAAAAYgAAAAAANQAAAAIAAABjAAAAAAA1AAAAAgAAAGQAAAAAADUAAAADAAAAX2EAAwAAADUAAAADAAAAYWEABwAAADUAAAABAAAABQAAAF9FTlYAAQAAAAEAEAAAAEBvYmZ1c2NhdGVkLmx1YQADAAAADAAAAAIAAAAMAAAAAAAAAAEAAAAFAAAAX0VOVgA="), nil, "bt", _ENV))() _G.UseUpdater = true local REQUIRED_LIBS = { ["SOW"] = "https://raw.githubusercontent.com/Hellsing/BoL/master/common/SOW.lua", ["VPrediction"] = "https://raw.githubusercontent.com/Hellsing/BoL/master/common/VPrediction.lua", ["Prodiction"] = "https://bitbucket.org/Klokje/public-klokjes-bol-scripts/raw/ec830facccefb3b52212dba5696c08697c3c2854/Test/Prodiction/Prodiction.lua" } local DOWNLOADING_LIBS, DOWNLOAD_COUNT = false, 0 function AfterDownload() DOWNLOAD_COUNT = DOWNLOAD_COUNT - 1 if DOWNLOAD_COUNT == 0 then DOWNLOADING_LIBS = false print("<b><font color=\"#6699FF\">Ahri - the Nine-Tailed Fox:</font></b> <font color=\"#FFFFFF\">Required libraries downloaded successfully, please reload (double F9).</font>") end end for DOWNLOAD_LIB_NAME, DOWNLOAD_LIB_URL in pairs(REQUIRED_LIBS) do if FileExist(LIB_PATH .. DOWNLOAD_LIB_NAME .. ".lua") then if DOWNLOAD_LIB_NAME ~= "Prodiction" then require(DOWNLOAD_LIB_NAME) end if DOWNLOAD_LIB_NAME == "Prodiction" and VIP_USER then require(DOWNLOAD_LIB_NAME) end else DOWNLOADING_LIBS = true DOWNLOAD_COUNT = DOWNLOAD_COUNT + 1 DownloadFile(DOWNLOAD_LIB_URL, LIB_PATH .. DOWNLOAD_LIB_NAME..".lua", AfterDownload) end end if DOWNLOADING_LIBS then return end local UPDATE_NAME = "Ahri - the Nine-Tailed Fox" local UPDATE_HOST = "raw.github.com" local UPDATE_PATH = "/DraconisBoL/BoL/master/Ahri%20-%20the%20Nine-Tailed%20Fox.lua" .. "?rand=" .. math.random(1, 10000) local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME local UPDATE_URL = "http://"..UPDATE_HOST..UPDATE_PATH function AutoupdaterMsg(msg) print("<b><font color=\"#6699FF\">"..UPDATE_NAME..":</font></b> <font color=\"#FFFFFF\">"..msg..".</font>") end if _G.UseUpdater then local ServerData = GetWebResult(UPDATE_HOST, UPDATE_PATH) if ServerData then local ServerVersion = string.match(ServerData, "local version = \"%d+.%d+\"") ServerVersion = string.match(ServerVersion and ServerVersion or "", "%d+.%d+") if ServerVersion then ServerVersion = tonumber(ServerVersion) if tonumber(version) < ServerVersion then AutoupdaterMsg("New version available "..ServerVersion) AutoupdaterMsg("Updating, please don't press F9") DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..version.." => "..ServerVersion.."), press F9 twice to load the updated version.") end) else AutoupdaterMsg("You have got the latest version ("..ServerVersion..")") end end else AutoupdaterMsg("Error downloading version info") end end ------------------------------------------------------ -- Callbacks ------------------------------------------------------ function OnLoad() print("<b><font color=\"#6699FF\">Ahri - the Nine-Tailed Fox:</font></b> <font color=\"#FFFFFF\">Good luck and have fun!</font>") UpdateWeb(true, ScriptName, id, HWID) Variables() Menu() PriorityOnLoad() end function OnBugsplat() UpdateWeb(false, ScriptName, id, HWID) end function OnUnload() UpdateWeb(false, ScriptName, id, HWID) end function OnTick() ComboKey = Settings.combo.comboKey HarassKey = Settings.harass.harassKey JungleClearKey = Settings.jungle.jungleKey LaneClearKey = Settings.lane.laneKey if ComboKey then Combo(Target) end if HarassKey then Harass(Target) end if JungleClearKey then JungleClear() end if LaneClearKey then LaneClear() end if Settings.ks.killSteal then KillSteal() end Checks() end function OnDraw() if not myHero.dead and not Settings.drawing.mDraw then if SkillQ.ready and Settings.drawing.qDraw then DrawCircle(myHero.x, myHero.y, myHero.z, SkillQ.range, RGB(Settings.drawing.qColor[2], Settings.drawing.qColor[3], Settings.drawing.qColor[4])) end if SkillW.ready and Settings.drawing.wDraw then DrawCircle(myHero.x, myHero.y, myHero.z, SkillW.range, RGB(Settings.drawing.wColor[2], Settings.drawing.wColor[3], Settings.drawing.wColor[4])) end if SkillE.ready and Settings.drawing.eDraw then DrawCircle(myHero.x, myHero.y, myHero.z, SkillE.range, RGB(Settings.drawing.eColor[2], Settings.drawing.eColor[3], Settings.drawing.eColor[4])) end if SkillR.ready and Settings.drawing.rDraw then DrawCircle(myHero.x, myHero.y, myHero.z, SkillR.range, RGB(Settings.drawing.rColor[2], Settings.drawing.rColor[3], Settings.drawing.rColor[4])) end if Settings.drawing.myHero then DrawCircle(myHero.x, myHero.y, myHero.z, TrueRange(), RGB(Settings.drawing.myColor[2], Settings.drawing.myColor[3], Settings.drawing.myColor[4])) end if Settings.drawing.Target and Target ~= nil then DrawCircle(Target.x, Target.y, Target.z, 80, ARGB(255, 10, 255, 10)) end if Settings.drawing.Text then Calculation() end end end ------------------------------------------------------ -- Functions ------------------------------------------------------ function Combo(unit) if ValidTarget(unit) and unit ~= nil and unit.type == myHero.type then if Settings.combo.comboItems then UseItems(unit) end if Settings.combo.useR then CastR(unit) end CastE(unit) CastQ(unit) CastW(unit) end if not Settings.combo.useAA then SOWi:DisableAttacks() elseif Settings.combo.useAA then SOWi:EnableAttacks() end end function Harass(unit) if ValidTarget(unit) and unit ~= nil and unit.type == myHero.type and not IsMyManaLow() then if Settings.harass.useQ then CastQ(unit) end if Settings.harass.useE then CastE(unit) end end end function LaneClear() enemyMinions:update() if LaneClearKey then for i, minion in pairs(enemyMinions.objects) do if ValidTarget(minion) and minion ~= nil then if Settings.lane.laneQ and GetDistance(minion) <= SkillQ.range and SkillQ.ready then local BestPos, BestHit = GetBestLineFarmPosition(SkillQ.range, SkillQ.width, enemyMinions.objects) if BestPos ~= nil then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _Q, toX = BestPos.x, toY = BestPos.z, fromX = BestPos.x, fromY = BestPos.z }):send() end CastSpell(_Q, BestPos.x, BestPos.z) end end if Settings.lane.laneW and GetDistance(minion) <= SkillW.range and SkillW.ready then if VIP_USER and Settings.misc.packets then Packet("S_CAST", {spellId = _W}):send() end CastSpell(_W) end end end end end function JungleClear() if Settings.jungle.jungleKey then local JungleMob = GetJungleMob() if JungleMob ~= nil then if Settings.jungle.jungleQ and GetDistance(JungleMob) <= SkillQ.range and SkillQ.ready then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _Q, toX = JungleMob.x, toY = JungleMob.z, fromX = JungleMob.x, fromY = JungleMob.z }):send() end CastSpell(_Q, JungleMob.x, JungleMob.z) end if Settings.jungle.jungleW and GetDistance(JungleMob) <= SkillW.range and SkillW.ready then if VIP_USER and Settings.misc.packets then Packet("S_CAST", {spellId = _W}):send() end CastSpell(_W) end end end end function CastQ(unit) if unit ~= nil and GetDistance(unit) <= SkillQ.range and SkillQ.ready then if Settings.misc.prediction == 1 then local CastPosition, HitChance, Position = VP:GetLineCastPosition(unit, SkillQ.delay, SkillQ.width, SkillQ.range, SkillQ.speed, myHero) if HitChance >= 2 then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _Q, toX = CastPosition.x, toY = CastPosition.z, fromX = CastPosition.x, fromY = CastPosition.z }):send() end CastSpell(_Q, CastPosition.x, CastPosition.z) end elseif Settings.misc.prediction == 2 and VIP_USER then local pos, info = Prodiction.GetPrediction(unit, SkillQ.range, SkillQ.speed, SkillQ.delay, SkillQ.width) if pos ~= nil then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _Q, toX = pos.x, toY = pos.z, fromX = pos.x, fromY = pos.z }):send() end CastSpell(_Q, pos.x, pos.z) end end end end function CastE(unit) if unit ~= nil and GetDistance(unit) <= SkillE.range and SkillE.ready then if Settings.misc.prediction == 1 then local CastPosition, HitChance, Position = VP:GetLineCastPosition(unit, SkillE.delay, SkillE.width, SkillE.range, SkillE.speed, myHero, true) if HitChance >= 2 then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _E, toX = CastPosition.x, toY = CastPosition.z, fromX = CastPosition.x, fromY = CastPosition.z }):send() end CastSpell(_E, CastPosition.x, CastPosition.z) end elseif Settings.misc.prediction == 2 and VIP_USER then local pos, info = Prodiction.GetPrediction(unit, SkillE.range, SkillE.speed, SkillE.delay, SkillE.width) if pos ~= nil and not info.mCollision() then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _E, toX = pos.x, toY = pos.z, fromX = pos.x, fromY = pos.z }):send() end CastSpell(_E, pos.x, pos.z) end end end end function CastW(unit) if unit ~= nil and SkillW.ready and GetDistance(unit) <= SkillW.range then if VIP_USER and Settings.misc.packets then Packet("S_CAST", {spellId = _W}):send() end CastSpell(_W) end end function CastR(unit) if unit ~= nil then if SkillR.ready and GetDistance(unit) <= SkillQ.range and Settings.combo.useR == 1 then local Mouse = Vector(myHero) + 400 * (Vector(mousePos) - Vector(myHero)):normalized() if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _R, toX = Mouse.x, toY = Mouse.z, fromX = Mouse.x, fromY = Mouse.z }):send() end CastSpell(_R, Mouse.x, Mouse.z) elseif SkillR.ready and GetDistance(unit) <= SkillQ.range and Settings.combo.useR == 2 then if VIP_USER and Settings.misc.packets then Packet("S_CAST", { spellId = _R, toX = unit.x, toY = unit.z, fromX = unit.x, fromY = unit.z }):send() end CastSpell(_R, unit.x, unit.z) elseif Settings.combo.useR == 3 then return end end end function KillSteal() for _, enemy in ipairs(GetEnemyHeroes()) do if ValidTarget(enemy) and enemy.visible then local qDmg = getDmg("Q", enemy, myHero) local eDmg = getDmg("E", enemy, myHero) if enemy.health <= qDmg then CastQ(enemy) elseif enemy.health <= (qDmg + eDmg) then CastE(enemy) CastQ(enemy) elseif enemy.health <= eDmg then CastE(enemy) end if Settings.ks.autoIgnite then AutoIgnite(enemy) end end end end function Calculation() for _, enemy in ipairs(GetEnemyHeroes()) do if ValidTarget(enemy) and enemy.visible then local qDmg = getDmg("Q", enemy, myHero) local wDmg = getDmg("W", enemy, myHero) local eDmg = getDmg("E", enemy, myHero) local iDmg = getDmg("IGNITE", enemy, myHero) if enemy.health <= qDmg then DrawText3D(tostring("Killable: Q"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) elseif enemy.health <= qDmg + wDmg then DrawText3D(tostring("Killable: Q > W"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) elseif enemy.health <= eDmg then DrawText3D(tostring("Killable: E"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) elseif enemy.health <= (qDmg + eDmg) then DrawText3D(tostring("Killable: E > Q"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) elseif enemy.health <= (wDmg + eDmg) then DrawText3D(tostring("Killable: E > W"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) elseif enemy.health <= (qDmg + eDmg + wDmg) then DrawText3D(tostring("Killable: E > Q > W"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) elseif enemy.health <= (qDmg + eDmg + wDmg + iDmg) then DrawText3D(tostring("Killable: E > Q > W > IGNITE"), enemy.x, enemy.y, enemy.z, 16, ARGB(255, 10, 255, 10), true) end end end end function AutoIgnite(unit) if ValidTarget(unit, Ignite.range) and unit.health <= 50 + (20 * myHero.level) then if Ignite.ready then CastSpell(Ignite.slot, unit) end end end ------------------------------------------------------ -- Checks, menu & stuff ------------------------------------------------------ function Checks() SkillQ.ready = (myHero:CanUseSpell(_Q) == READY) SkillW.ready = (myHero:CanUseSpell(_W) == READY) SkillE.ready = (myHero:CanUseSpell(_E) == READY) SkillR.ready = (myHero:CanUseSpell(_R) == READY) if myHero:GetSpellData(SUMMONER_1).name:find(Ignite.name) then Ignite.slot = SUMMONER_1 elseif myHero:GetSpellData(SUMMONER_2).name:find(Ignite.name) then Ignite.slot = SUMMONER_2 end Ignite.ready = (Ignite.slot ~= nil and myHero:CanUseSpell(Ignite.slot) == READY) TargetSelector:update() Target = GetCustomTarget() SOWi:ForceTarget(Target) if VIP_USER and Settings.misc.skinList then ChooseSkin() end if Settings.drawing.lfc.lfc then _G.DrawCircle = DrawCircle2 else _G.DrawCircle = _G.oldDrawCircle end Gameover() end function IsMyManaLow() if myHero.mana < (myHero.maxMana * ( Settings.harass.harassMana / 100)) then return true else return false end end function Menu() Settings = scriptConfig("Ahri - the Nine-Tailed Fox "..version.."", "DraconisAhri") Settings:addSubMenu("["..myHero.charName.."] - Combo Settings", "combo") Settings.combo:addParam("comboKey", "Combo Key", SCRIPT_PARAM_ONKEYDOWN, false, 32) Settings.combo:addParam("useR", "Use "..SkillR.name.." (R) in Combo", SCRIPT_PARAM_LIST, 1, { "To mouse", "Toward enemy", "Don't use"}) Settings.combo:addParam("comboItems", "Use Items in Combo", SCRIPT_PARAM_ONOFF, true) Settings.combo:addParam("useAA", "Use AAs in Combo", SCRIPT_PARAM_ONOFF, true) Settings.combo:permaShow("comboKey") Settings:addSubMenu("["..myHero.charName.."] - Harass Settings", "harass") Settings.harass:addParam("harassKey", "Harass Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("C")) Settings.harass:addParam("useQ", "Use "..SkillQ.name.." (Q) in Harass", SCRIPT_PARAM_ONOFF, true) Settings.harass:addParam("useE", "Use "..SkillE.name.." (E) in Harass", SCRIPT_PARAM_ONOFF, true) Settings.harass:addParam("harassMana", "Min. Mana Percent: ", SCRIPT_PARAM_SLICE, 50, 0, 100, 0) Settings.harass:permaShow("harassKey") Settings:addSubMenu("["..myHero.charName.."] - Lane Clear Settings", "lane") Settings.lane:addParam("laneKey", "Lane Clear Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("V")) Settings.lane:addParam("laneQ", "Clear with "..SkillQ.name.." (Q)", SCRIPT_PARAM_ONOFF, true) Settings.lane:addParam("laneW", "Clear with "..SkillW.name.." (W)", SCRIPT_PARAM_ONOFF, true) Settings.lane:permaShow("laneKey") Settings:addSubMenu("["..myHero.charName.."] - Jungle Clear Settings", "jungle") Settings.jungle:addParam("jungleKey", "Jungle Clear Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("V")) Settings.jungle:addParam("jungleQ", "Clear with "..SkillQ.name.." (Q)", SCRIPT_PARAM_ONOFF, true) Settings.jungle:addParam("jungleW", "Clear with "..SkillW.name.." (W)", SCRIPT_PARAM_ONOFF, true) Settings.jungle:permaShow("jungleKey") Settings:addSubMenu("["..myHero.charName.."] - KillSteal Settings", "ks") Settings.ks:addParam("killSteal", "Use Smart Kill Steal", SCRIPT_PARAM_ONOFF, true) Settings.ks:addParam("autoIgnite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true) Settings.ks:permaShow("killSteal") Settings:addSubMenu("["..myHero.charName.."] - Draw Settings", "drawing") Settings.drawing:addParam("mDraw", "Disable All Range Draws", SCRIPT_PARAM_ONOFF, false) Settings.drawing:addParam("Target", "Draw Circle on Target", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("Text", "Draw Text on Target", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("myHero", "Draw My Range", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("myColor", "Draw My Range Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255}) Settings.drawing:addParam("qDraw", "Draw "..SkillQ.name.." (Q) Range", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("qColor", "Draw "..SkillQ.name.." (Q) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255}) Settings.drawing:addParam("wDraw", "Draw "..SkillW.name.." (W) Range", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("wColor", "Draw "..SkillW.name.." (W) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255}) Settings.drawing:addParam("eDraw", "Draw "..SkillE.name.." (E) Range", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("eColor", "Draw "..SkillE.name.." (E) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255}) Settings.drawing:addParam("rDraw", "Draw "..SkillR.name.." (R) Range", SCRIPT_PARAM_ONOFF, true) Settings.drawing:addParam("rColor", "Draw "..SkillR.name.." (R) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255}) Settings.drawing:addSubMenu("Lag Free Circles", "lfc") Settings.drawing.lfc:addParam("lfc", "Lag Free Circles", SCRIPT_PARAM_ONOFF, false) Settings.drawing.lfc:addParam("CL", "Quality", 4, 75, 75, 2000, 0) Settings.drawing.lfc:addParam("Width", "Width", 4, 1, 1, 10, 0) Settings:addSubMenu("["..myHero.charName.."] - Misc Settings", "misc") Settings.misc:addParam("packets", "Cast spells using Packets", SCRIPT_PARAM_ONOFF, true) Settings.misc:addParam("prediction", "Choose your prediction", SCRIPT_PARAM_LIST, 1, { "VPrediction", "Prodiction" }) Settings.misc:addParam("skinList", "Choose your skin", SCRIPT_PARAM_LIST, 5, { "Dynasty Ahri", "Midnight Ahri", "Foxfire Ahri", "Popstar Ahri", "Classic" }) Settings:addSubMenu("["..myHero.charName.."] - Orbwalking Settings", "Orbwalking") SOWi:LoadToMenu(Settings.Orbwalking) TargetSelector = TargetSelector(TARGET_LESS_CAST, SkillE.range, DAMAGE_MAGIC, true) TargetSelector.name = "Ahri" Settings:addTS(TargetSelector) end function Variables() SkillQ = { name = "Orb of Deception", range = 840, delay = 0.25, speed = 1600, width = 90, ready = false } SkillW = { name = "Fox-Fire", range = 800, delay = nil, speed = nil, width = nil, ready = false } SkillE = { name = "Charm", range = 975, delay = 0.25, speed = 1500, width = 100, ready = false } SkillR = { name = "Spirit Rush", range = 550, delay = nil, speed = nil, width = nil, ready = false } Ignite = { name = "SummonerDot", range = 600, slot = nil } enemyMinions = minionManager(MINION_ENEMY, SkillE.range, myHero, MINION_SORT_HEALTH_ASC) VP = VPrediction() SOWi = SOW(VP) JungleMobs = {} JungleFocusMobs = {} lastSkin = 0 if GetGame().map.shortName == "twistedTreeline" then TwistedTreeline = true else TwistedTreeline = false end _G.oldDrawCircle = rawget(_G, 'DrawCircle') _G.DrawCircle = DrawCircle2 priorityTable = { AP = { "Annie", "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Gragas", "Heimerdinger", "Karthus", "Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna", "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "Velkoz" }, Support = { "Alistar", "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean", "Braum" }, Tank = { "Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Nautilus", "Shen", "Singed", "Skarner", "Volibear", "Warwick", "Yorick", "Zac" }, AD_Carry = { "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "Jinx", "KogMaw", "Lucian", "MasterYi", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir", "Talon","Tryndamere", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Yasuo", "Zed" }, Bruiser = { "Aatrox", "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nocturne", "Olaf", "Poppy", "Renekton", "Rengar", "Riven", "Rumble", "Shyvana", "Trundle", "Udyr", "Vi", "MonkeyKing", "XinZhao" } } Items = { BRK = { id = 3153, range = 450, reqTarget = true, slot = nil }, BWC = { id = 3144, range = 400, reqTarget = true, slot = nil }, DFG = { id = 3128, range = 750, reqTarget = true, slot = nil }, HGB = { id = 3146, range = 400, reqTarget = true, slot = nil }, RSH = { id = 3074, range = 350, reqTarget = false, slot = nil }, STD = { id = 3131, range = 350, reqTarget = false, slot = nil }, TMT = { id = 3077, range = 350, reqTarget = false, slot = nil }, YGB = { id = 3142, range = 350, reqTarget = false, slot = nil }, BFT = { id = 3188, range = 750, reqTarget = true, slot = nil }, RND = { id = 3143, range = 275, reqTarget = false, slot = nil } } if not TwistedTreeline then JungleMobNames = { ["Wolf8.1.2"] = true, ["Wolf8.1.3"] = true, ["YoungLizard7.1.2"] = true, ["YoungLizard7.1.3"] = true, ["LesserWraith9.1.3"] = true, ["LesserWraith9.1.2"] = true, ["LesserWraith9.1.4"] = true, ["YoungLizard10.1.2"] = true, ["YoungLizard10.1.3"] = true, ["SmallGolem11.1.1"] = true, ["Wolf2.1.2"] = true, ["Wolf2.1.3"] = true, ["YoungLizard1.1.2"] = true, ["YoungLizard1.1.3"] = true, ["LesserWraith3.1.3"] = true, ["LesserWraith3.1.2"] = true, ["LesserWraith3.1.4"] = true, ["YoungLizard4.1.2"] = true, ["YoungLizard4.1.3"] = true, ["SmallGolem5.1.1"] = true } FocusJungleNames = { ["Dragon6.1.1"] = true, ["Worm12.1.1"] = true, ["GiantWolf8.1.1"] = true, ["AncientGolem7.1.1"] = true, ["Wraith9.1.1"] = true, ["LizardElder10.1.1"] = true, ["Golem11.1.2"] = true, ["GiantWolf2.1.1"] = true, ["AncientGolem1.1.1"] = true, ["Wraith3.1.1"] = true, ["LizardElder4.1.1"] = true, ["Golem5.1.2"] = true, ["GreatWraith13.1.1"] = true, ["GreatWraith14.1.1"] = true } else FocusJungleNames = { ["TT_NWraith1.1.1"] = true, ["TT_NGolem2.1.1"] = true, ["TT_NWolf3.1.1"] = true, ["TT_NWraith4.1.1"] = true, ["TT_NGolem5.1.1"] = true, ["TT_NWolf6.1.1"] = true, ["TT_Spiderboss8.1.1"] = true } JungleMobNames = { ["TT_NWraith21.1.2"] = true, ["TT_NWraith21.1.3"] = true, ["TT_NGolem22.1.2"] = true, ["TT_NWolf23.1.2"] = true, ["TT_NWolf23.1.3"] = true, ["TT_NWraith24.1.2"] = true, ["TT_NWraith24.1.3"] = true, ["TT_NGolem25.1.1"] = true, ["TT_NWolf26.1.2"] = true, ["TT_NWolf26.1.3"] = true } end for i = 0, objManager.maxObjects do local object = objManager:getObject(i) if object and object.valid and not object.dead then if FocusJungleNames[object.name] then JungleFocusMobs[#JungleFocusMobs+1] = object elseif JungleMobNames[object.name] then JungleMobs[#JungleMobs+1] = object end end end end function SetPriority(table, hero, priority) for i=1, #table, 1 do if hero.charName:find(table[i]) ~= nil then TS_SetHeroPriority(priority, hero.charName) end end end function arrangePrioritys() for i, enemy in ipairs(GetEnemyHeroes()) do SetPriority(priorityTable.AD_Carry, enemy, 1) SetPriority(priorityTable.AP, enemy, 2) SetPriority(priorityTable.Support, enemy, 3) SetPriority(priorityTable.Bruiser, enemy, 4) SetPriority(priorityTable.Tank, enemy, 5) end end function arrangePrioritysTT() for i, enemy in ipairs(GetEnemyHeroes()) do SetPriority(priorityTable.AD_Carry, enemy, 1) SetPriority(priorityTable.AP, enemy, 1) SetPriority(priorityTable.Support, enemy, 2) SetPriority(priorityTable.Bruiser, enemy, 2) SetPriority(priorityTable.Tank, enemy, 3) end end function UseItems(unit) if unit ~= nil then for _, item in pairs(Items) do item.slot = GetInventorySlotItem(item.id) if item.slot ~= nil then if item.reqTarget and GetDistance(unit) < item.range then CastSpell(item.slot, unit) elseif not item.reqTarget then if (GetDistance(unit) - getHitBoxRadius(myHero) - getHitBoxRadius(unit)) < 50 then CastSpell(item.slot) end end end end end end function getHitBoxRadius(target) return GetDistance(target.minBBox, target.maxBBox)/2 end function PriorityOnLoad() if heroManager.iCount < 10 or (TwistedTreeline and heroManager.iCount < 6) then print("<b><font color=\"#6699FF\">Ahri - the Nine-Tailed Fox:</font></b> <font color=\"#FFFFFF\">Too few champions to arrange priority.</font>") elseif heroManager.iCount == 6 then arrangePrioritysTT() else arrangePrioritys() end end function GetJungleMob() for _, Mob in pairs(JungleFocusMobs) do if ValidTarget(Mob, SkillQ.range) then return Mob end end for _, Mob in pairs(JungleMobs) do if ValidTarget(Mob, SkillQ.range) then return Mob end end end function OnCreateObj(obj) if obj.valid then if FocusJungleNames[obj.name] then JungleFocusMobs[#JungleFocusMobs+1] = obj elseif JungleMobNames[obj.name] then JungleMobs[#JungleMobs+1] = obj end end end function OnDeleteObj(obj) for i, Mob in pairs(JungleMobs) do if obj.name == Mob.name then table.remove(JungleMobs, i) end end for i, Mob in pairs(JungleFocusMobs) do if obj.name == Mob.name then table.remove(JungleFocusMobs, i) end end end function TrueRange() return myHero.range + GetDistance(myHero, myHero.minBBox) end -- Trees function GetCustomTarget() TargetSelector:update() if _G.MMA_Target and _G.MMA_Target.type == myHero.type then return _G.MMA_Target end if _G.AutoCarry and _G.AutoCarry.Crosshair and _G.AutoCarry.Attack_Crosshair and _G.AutoCarry.Attack_Crosshair.target and _G.AutoCarry.Attack_Crosshair.target.type == myHero.type then return _G.AutoCarry.Attack_Crosshair.target end return TargetSelector.target end -- shalzuth function GenModelPacket(champ, skinId) p = CLoLPacket(0x97) p:EncodeF(myHero.networkID) p.pos = 1 t1 = p:Decode1() t2 = p:Decode1() t3 = p:Decode1() t4 = p:Decode1() p:Encode1(t1) p:Encode1(t2) p:Encode1(t3) p:Encode1(bit32.band(t4,0xB)) p:Encode1(1)--hardcode 1 bitfield p:Encode4(skinId) for i = 1, #champ do p:Encode1(string.byte(champ:sub(i,i))) end for i = #champ + 1, 64 do p:Encode1(0) end p:Hide() RecvPacket(p) end function ChooseSkin() if Settings.misc.skinList ~= lastSkin then lastSkin = Settings.misc.skinList GenModelPacket("Ahri", Settings.misc.skinList) end end function GetBestLineFarmPosition(range, width, objects) local BestPos local BestHit = 0 for i, object in ipairs(objects) do local EndPos = Vector(myHero.visionPos) + range * (Vector(object) - Vector(myHero.visionPos)):normalized() local hit = CountObjectsOnLineSegment(myHero.visionPos, EndPos, width, objects) if hit > BestHit then BestHit = hit BestPos = Vector(object) if BestHit == #objects then break end end end return BestPos, BestHit end function CountObjectsOnLineSegment(StartPos, EndPos, width, objects) local n = 0 for i, object in ipairs(objects) do local pointSegment, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(StartPos, EndPos, object) if isOnSegment and GetDistanceSqr(pointSegment, object) < width * width then n = n + 1 end end return n end -- Barasia, vadash, viseversa function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength) radius = radius or 300 quality = math.max(8,round(180/math.deg((math.asin((chordlength/(2*radius))))))) quality = 2 * math.pi / quality radius = radius*.92 local points = {} for theta = 0, 2 * math.pi + quality, quality do local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta))) points[#points + 1] = D3DXVECTOR2(c.x, c.y) end DrawLines2(points, width or 1, color or 4294967295) end function round(num) if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end end function DrawCircle2(x, y, z, radius, color) local vPos1 = Vector(x, y, z) local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z) local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z)) if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then DrawCircleNextLvl(x, y, z, radius, Settings.drawing.lfc.Width, color, Settings.drawing.lfc.CL) end end function Gameover() if GetGame().isOver then UpdateWeb(false, ScriptName, id, HWID) startUp = false; end end

bol icon bol

Collection of scripts for BoL by Draconis.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.