Hi every one, something really important is missing on script -> Targetting priority
to get priority working on every script i change some line of code into "Inspired.lua"

Search this function into "inspired.lua" :
function GetTarget(range, damageType)
damageType = damageType or 2
local target, steps = nil, 10000
for _, k in pairs(GetEnemyHeroes()) do
local step = GetCurrentHP(k) / CalcDamage(GetMyHero(), k, DAMAGE_PHYSICAL == damageType and 100 or 0, DAMAGE_MAGIC == damageType and 100 or 0)
if k and ValidTarget(k, range) and step < steps then
target = k
steps = step
end
end
return target
end
replace by :
function GetTarget(range, damageType)
if PriorityConfig.priority then
for _, k in pairs(GetEnemyHeroes()) do
if k and ValidTarget(k, range) and loadstring("return PriorityConfig." .. GetObjectName(k))() then
-- PrintChat(GetObjectName(k))
return k
end
end
end
damageType = damageType or 2
local target, steps = nil, 10000
for _, k in pairs(GetEnemyHeroes()) do
local step = GetCurrentHP(k) / CalcDamage(GetMyHero(), k, DAMAGE_PHYSICAL == damageType and 100 or 0, DAMAGE_MAGIC == damageType and 100 or 0)
if k and ValidTarget(k, range) and step < steps then
target = k
steps = step
end
end
return target
end
then add just before the function you re-write :
-- ADD PRIORITY MENU-------------------
local priorityMenuDraw = 0
OnLoop(function(myHero)
if priorityMenuDraw == 0 then
PriorityConfig = scriptConfig("Inspired priority", "Inspired.lua")
PriorityConfig.addParam("priority", "Use priority", SCRIPT_PARAM_ONOFF, true)
for _, k in pairs(GetEnemyHeroes()) do
PriorityConfig.addParam(GetObjectName(k), GetObjectName(k) .. " priority", SCRIPT_PARAM_ONOFF, false)
end
priorityMenuDraw = 1
end
end)
----------------------------
You can Active/Desactive the priority, and put true or false to choose witch heroe will be focus.
Update for Inspired v16
This fonctionnality isnt great actually because we cant make a list of priority, the list is directly create by the api when we iterate with GetEnemyHeroes(), that mean you can only focus your priority on 1 heroe.
if someone know how to make a sortable list with the menu, this will be perfect
if you wana try the beta version and dont have knowledge to modify the file ->
https://github.com/E...er/Inspired.lua
Sign In
Create Account

Back to top
Report








