About: - Allows You to use Hotkey's from Your Tibia Client (Just configure Hotkey in Tibia Client) - You can move HUD with middle mouse button. Thanks to @sirmate.
-- Locale
local lastPressed = {id = -1, time = $timems}
local rectHeight, rectWidth = 200, 140
setposition($clientwin.left, $clientwin.bottom)
-- Moving window
filterinput(false, true, false, false)
local Moving, Temp, Moved = false, {0, 0}, {0, 0}
function inputevents(e)
if (e.type == IEVENT_LMOUSEDOWN) then
for _, button in ipairs(ButtonsFunction) do
if (e.elementid == button.id) then
lastPressed = {id = button.id, time = $timems}
button.action()
end
end
end
if (e.type == IEVENT_MMOUSEDOWN) then
Moving, Temp = true, {$cursor.x - Moved[1], $cursor.y - Moved[2]}
end
if (e.type == IEVENT_MMOUSEUP) then
Moving = false
if math.abs(Moved[1]) <= 15 then
Moved[1] = 0
end
if math.abs(Moved[2]) <= 15 then
Moved[2] = 0
elseif math.abs(($worldwin.bottom-20) - Moved[2]) <= 15 then
Moved[2] = $worldwin.bottom-20
end
end
end
init end
if (Moving) then
auto(10)
Moved = {$cursor.x - Temp[1], $cursor.y - Temp[2]}
end
if ButtonsFunction then
if ButtonsFunction[i].id ~= lastPressed.id then
addgradcolors(0.1, color(112, 142, 149), 1.0, color(44, 68, 74))
else
addgradcolors( 0.1,color(44, 68, 74), 1.0,color(112, 142, 149))
end