Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- AutoSmite 2.3
- Credits to Zynox for original AutoSmite v1.2
- Mod by Manciuszz
- Modified by Mariopart for BoL
- 1.0 : First release
- 1.1 : Update for new Animation Lib v0.3
- 1.2 : Added Nunu Q-Consume and ChoGath's R-Feast.
- : Will now attempt to use Q + Smite for Nunu and Smite + R for ChoGath
- : Will load the script on Nunu and ChoGath without Smite.
- 1.3 : Edited slightly and Modified for BoL Studio by eXtragoZ
- 1.9 : nginx "isBusy" system
- 2.0 (Husky) : Removed Bugsplatting by consequently using the isBusy system in all methods
- : Smiteable targets will now be highlighted if you are in range
- : Different colors for the highlighting when smite is on cooldown
- : Added Nashor smite spot
- 2.1 : Added Range indicator of smite
- : Added options on the menu Nashor spot, Draw Circles and Draw Text
- : Now says the percentage of life remaining will be left after use smite , Q and R in case of Nunu or Chogath
- : Added Vilemaw of Twisted Treeline
- : Removed Blue Dragon and Lizard Elder of Twisted Treeline
- 1) Hotkey for switching AutoSmite On/Off (by default: N). Remember that AutoSmite is OFF until you switch it.
- 2) Hold-Hotkey for using AutoSmite (by default: CTRL) if you want to use it in this way.
- 3) Hotkey for moving to a nashor smite spot, that enables you to smite nashor safely without moving into the pit or risking your life (by default: C)
- ]]
- function file_exists(name)
- local f=io.open(name,"r")
- if f~=nil then io.close(f) return true else return false end
- end
- local LIB_PATH = debug.getinfo(1).source:sub(debug.getinfo(1).source:find(".*\\")):sub(2).."Common/"
- local AllClassFile = LIB_PATH.."AllClass.lua"
- if file_exists(AllClassFile) then require "AllClass" end
- --[[ Config ]]
- local range = 800 -- Range of smite (~800)
- local scanInterval = 10 -- Interval for Smite part of the script. Recommended to set from 10 to 500. If it drops FPS hard for you then try to set it to 500. (default: 50 ms)
- --[[ Globals ]]
- local isBusy = false
- local scanTick = 0
- local smiteSlot = nil
- local objminionTable = {}
- local smiteDamage, qDamage, mixDamage, rDamage, mixdDamage = 0, 0, 0, 0, 0
- local canuseQ = false
- local canuseR = false
- local canusesmite = false
- local turnoff = false --true/false
- local Smiteison = false
- local Vilemaw = nil
- local Nashor = nil
- local Dragon = nil
- local Golem1 = nil
- local Golem2 = nil
- local Lizard1 = nil
- local Lizard2 = nil
- --[[ Code ]]
- function OnLoad()
- if myHero:GetSpellData(SUMMONER_1).name:find("Smite") then smiteSlot = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("Smite") then smiteSlot = SUMMONER_2 end
- if myHero.charName == "Nunu" or myHero.charName == "Chogath" or smiteSlot or not turnoff then
- SmiteConfig = scriptConfig("AutoSmite 2.3", "autosmite")
- SmiteConfig:addParam("switcher", "Switcher Hotkey", SCRIPT_PARAM_ONKEYTOGGLE, false, 78)
- SmiteConfig:addParam("hold", "Hold Hotkey", SCRIPT_PARAM_ONKEYDOWN, false, 17)
- SmiteConfig:addParam("active", "AutoSmite Active", SCRIPT_PARAM_INFO, false)
- SmiteConfig:addParam("nashorspot", "Nashor spot", SCRIPT_PARAM_ONKEYDOWN, false, 67)
- SmiteConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- SmiteConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
- SmiteConfig:permaShow("active")
- ASLoadMinions()
- Smiteison = true
- PrintChat(" >> AutoSmite 2.3 loaded!")
- end
- end
- function OnTick()
- if not Smiteison then return end
- SmiteConfig.active = ((SmiteConfig.hold and not SmiteConfig.switcher) or (not SmiteConfig.hold and SmiteConfig.switcher))
- smiteDamage = 420 + 25 * myHero.level
- qDamage = 400 + 100 * myHero:GetSpellData(_Q).level
- mixDamage = qDamage + smiteDamage
- rDamage = 1000+.7*myHero.ap
- mixdDamage = rDamage + smiteDamage
- canuseQ = (myHero.charName == "Nunu" and myHero:CanUseSpell(_Q) == READY)
- canuseR = (myHero.charName == "Chogath" and myHero:CanUseSpell(_R) == READY)
- if smiteSlot ~= nil then canusesmite = (myHero:CanUseSpell(smiteSlot) == READY) end
- if SmiteConfig.nashorspot then myHero:MoveTo(5381, 10283) end
- if GetTickCount()-scanTick<scanInterval or not SmiteConfig.active or myHero.dead then return end
- scanTick = GetTickCount()
- if canusesmite or canuseQ or canuseR then
- while isBusy do end
- isBusy = true
- if Vilemaw ~= nil then checkMonster(Vilemaw) end
- if Nashor ~= nil then checkMonster(Nashor) end
- if Dragon ~= nil then checkMonster(Dragon) end
- if Golem1 ~= nil then checkMonster(Golem1) end
- if Golem2 ~= nil then checkMonster(Golem2) end
- if Lizard1 ~= nil then checkMonster(Lizard1) end
- if Lizard2 ~= nil then checkMonster(Lizard2) end
- isBusy = false
- end
- end
- function checkMonster(object)
- if object ~= nil and not object.dead and object.visible and object.bTargetable then
- local DistanceMonster = GetDistance(object)
- if canusesmite and DistanceMonster <= range and object.health <= smiteDamage then
- CastSpell(smiteSlot, object)
- elseif canuseQ and DistanceMonster <= 125+200 then
- if canusesmite and object.health <= mixDamage then
- CastSpell(_Q, object)
- CastSpell(smiteSlot, object)
- elseif object.health <= qDamage then
- CastSpell(_Q, object)
- end
- elseif canuseR and DistanceMonster <= 150+200 then--!
- if canusesmite and object.health <= mixdDamage then
- CastSpell(_R, object)
- CastSpell(smiteSlot, object)
- elseif object.health <= rDamage then
- CastSpell(_R, object)
- end
- end
- end
- end
- function OnWndMsg(msg,key)
- if not Smiteison then return end
- SC__OnWndMsg(msg,key)
- end
- function OnDraw()
- if not Smiteison then return end
- SC__OnDraw()
- if smiteSlot ~= nil and SmiteConfig.drawcircles and not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D)
- end
- if SmiteConfig.nashorspot and SmiteConfig.drawtext then
- DrawText("Moving to nashor smite spot", 18, GetCursorPos().x-100, GetCursorPos().y-20, 0xFF00FF00)
- end
- if not myHero.dead and (SmiteConfig.drawtext or SmiteConfig.drawcircles) then
- while isBusy do end
- isBusy = true
- if Vilemaw ~= nil then MonsterDraw(Vilemaw) end
- if Nashor ~= nil then MonsterDraw(Nashor) end
- if Dragon ~= nil then MonsterDraw(Dragon) end
- if Golem1 ~= nil then MonsterDraw(Golem1) end
- if Golem2 ~= nil then MonsterDraw(Golem2) end
- if Lizard1 ~= nil then MonsterDraw(Lizard1) end
- if Lizard2 ~= nil then MonsterDraw(Lizard2) end
- isBusy = false
- end
- end
- function MonsterDraw(object)
- if object ~= nil and not object.dead and object.visible and object.bTargetable then
- local DistanceMonster = GetDistance(object)
- if smiteSlot ~= nil and SmiteConfig.drawcircles and DistanceMonster <= range then
- local circleColor = (canusesmite and 0xFF0000 or 0x0000FF)
- for j = 0, 10 do DrawCircle(object.x, object.y, object.z, 120 + j*3, circleColor) end
- DrawCircle(object.x, object.y, object.z, 115, 0x00FF00)
- end
- if SmiteConfig.drawtext and DistanceMonster <= range*2 then
- local statusdmgS = tostring(math.round((object.health-smiteDamage)*100/object.maxHealth, 2))
- local statuscolorS = (canusesmite and 0xFF00FF00 or 0xFFFF0000)
- DrawText(statusdmgS.."% - Smite", 18, GetCursorPos().x-40, GetCursorPos().y+38, statuscolorS)
- if myHero.charName == "Nunu" and myHero:GetSpellData(_Q).level>0 then
- local statusdmgQ = tostring(math.round((object.health-qDamage)*100/object.maxHealth, 2))
- local statusdmgSQ = tostring(math.round((object.health-mixDamage)*100/object.maxHealth, 2))
- local statuscolorQ = (canuseQ and 0xFF00FF00 or 0xFFFF0000)
- local statuscolorSQ = ((canusesmite and canuseQ) and 0xFF00FF00 or 0xFFFF0000)
- DrawText(statusdmgQ.."% - Q", 18, GetCursorPos().x-40, GetCursorPos().y+56, statuscolorQ)
- DrawText(statusdmgSQ.."% - Smite+Q", 18, GetCursorPos().x-40, GetCursorPos().y+74, statuscolorSQ)
- end
- if myHero.charName == "Chogath" and myHero:GetSpellData(_R).level>0 then
- local statusdmgR = tostring(math.round((object.health-rDamage)*100/object.maxHealth, 2))
- local statusdmgSR = tostring(math.round((object.health-mixdDamage)*100/object.maxHealth, 2))
- local statuscolorR = (canuseR and 0xFF00FF00 or 0xFFFF0000)
- local statuscolorSR = ((canusesmite and canuseR) and 0xFF00FF00 or 0xFFFF0000)
- DrawText(statusdmgR.."% - R", 18, GetCursorPos().x-40, GetCursorPos().y+56, statuscolorR)
- DrawText(statusdmgSR.."% - Smite+R", 18, GetCursorPos().x-40, GetCursorPos().y+74, statuscolorSR)
- end
- end
- end
- end
- function OnCreateObj(obj)
- if not Smiteison then return end
- while isBusy do end
- isBusy = true
- if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
- if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
- elseif obj.name == "Worm12.1.1" then Nashor = obj
- elseif obj.name == "Dragon6.1.1" then Dragon = obj
- elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
- elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
- elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
- elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj end
- end
- isBusy = false
- end
- function OnDeleteObj(obj)
- if not Smiteison then return end
- while isBusy do end
- isBusy = true
- if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
- if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = nil
- elseif obj.name == "Worm12.1.1" then Nashor = nil
- elseif obj.name == "Dragon6.1.1" then Dragon = nil
- elseif obj.name == "AncientGolem1.1.1" then Golem1 = nil
- elseif obj.name == "AncientGolem7.1.1" then Golem2 = nil
- elseif obj.name == "LizardElder4.1.1" then Lizard1 = nil
- elseif obj.name == "LizardElder10.1.1" then Lizard2 = nil end
- end
- isBusy = false
- end
- function ASLoadMinions()
- while isBusy do end
- isBusy = true
- for i = 1, objManager.maxObjects do
- local obj = objManager:getObject(i)
- if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
- if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
- elseif obj.name == "Worm12.1.1" then Nashor = obj
- elseif obj.name == "Dragon6.1.1" then Dragon = obj
- elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
- elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
- elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
- elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj end
- end
- end
- isBusy = false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement