AzScript : AzPriority

AzPriority is an User Interface to let the user to choose the priority for the scripts/actions and an API to avoid conflict between scripts/action
The users just need to press [F8] and choose the priority order (of course, user preferences are saved)
Getting started for the script developers:
1) Add AzPriority.lua into Common folder
2) Register your script or actions, like that:
-- Include the library
require('AzPriority')
-- Register your script/actions
AzPriority:register('SuperEvade')
AzPriority:register('SuperKillSteal')
-- Lock if you need
-- Lock function will return true if you are allowed
function IncomingSkillshot()
if (AzPriority:lock('SuperEvade')) then
...
end
end
-- The player is now safe ? No need anymore to dodge ?
-- Then lest's go to unlock
-- You can call unlock even if it wasn't lock
AzPriority:unlock('SuperEvade')
-- Be careful, you can lose the lock, if another action that has priority requests the lock
-- A function can be called if the lock got aborted by a bigger priority
AzPriority:lock('Movement', function() print('LOCK GOT STEALED!!!') end)
-- My recommandation:
-- unlock() at the start of each of your ticks and lock everytime you need an action
-- If you lock when you have already lock, you will just replace the callback
-- Best pratices:
local script_name = 'KarthusKillSteal'
function OnTick()
AzPriority:unlock(script_name)
if (EnemyIsLowLife()) then
if (AzPriority:lock(script_name)) then
KarthusPressR()
end
end
end
-- GGWP, now the user can just choose if he preff KillSteal or DodgeSpell in priority :)
Download: https://gist.githubu.../AzPriority.lua
DOCUMENTATION:
AzPriority:register(<string> name) AzPriority:unregister(<string> name) AzPriority:lock(<string> name, <function> abort_callback) boolean -- return true on success AzPriority:unlock(<string> name) boolean -- return true on success
Sign In
Create Account

Back to top
Report









