local header, closeButton, closed, moving
local cursorPosition = {}
local engines = {'Cavebot', 'Looting', 'Targeting', 'Spell Healer', 'Potion Healer', 'Condition Healer', 'Mana Trainer'}
filterinput(false, true, false, false)
function inputevents(e)
if e.type == IEVENT_LMOUSEUP then
if e.elementid == closeButton then
closed = true
return
end
for _, v in ipairs(engines) do
if e.elementid == v.shape then
toggle(v.name:gsub(' ', '') .. '/Enabled')
return
end
end
elseif e.elementid == header then
if e.type == IEVENT_MMOUSEDOWN then
moving = true
cursorPosition.x = $cursor.x
cursorPosition.y = $cursor.y
return
elseif e.type == IEVENT_MMOUSEUP then
moving = false
return
end
end
end
auto(100)
if moving then
auto(10)
local curPosition = getposition()
setposition(
curPosition.x + ($cursor.x - cursorPosition.x),
curPosition.y + ($cursor.y - cursorPosition.y)
)
cursorPosition.x = $cursor.x
cursorPosition.y = $cursor.y
end
if closed then
return
end
local isEnabled
for k, v in ipairs(engines) do
addgradcolors(table.unpack(blackGradient))
addshape('roundrect', 0, k * 23, 150, 20, 3, 3)
addtext(v.name, 6, k * 23 + 3)