Hello everyone.
So i decided i'd release this small code that checks if you have certain items and spells on hotkeys, with a easy configuration and a easy to understand error message.
-- Checks hotkeys
-- If hotkey was not found, a error will display
-- Strahowski 2014-09-09
init start
local Config = {
Spells = {"exura", "exura gran", "exura vita", "exori frigo", "utani gran hur"},
Items = {"Great mana potion", "avalanche rune"}
}
init end
auto(1000)
local Errors = {} -- Holder for errors
for _, item in ipairs(Config.Items) do
if(clientitemhotkey(itemid(item)) == "not found") then
table.insert(Errors, "Missing item '"..item.."' on hotkeys")
end
end
for _, spell in ipairs(Config.Spells) do
if(clientspellhotkey(spell) == "not found") then
table.insert(Errors, "Missing spell '"..spell.."' on hotkeys")
end
end
if(next(Errors) ~= nil) then
local ErrorText = "The following errors occured: "
for _, error in ipairs(Errors) do
ErrorText = ErrorText.." - "..error
end
printerror(ErrorText)
ErrorText = nil
end
Suggestions are always welcome, I'm quite new to programming and lua as a whole but I find LUA quite easy atleast from what I've tried thus far.
// Strahowski the great