Ir para conteúdo

Featured Replies

Postado
dP5F18b.png 
-- Waypoint Buttons by Forgee
-- Inspired by Sirmate
init start
    -- Buttons
    local Buttons = {
        {text = "Walk", id = -1, action = function() addwaypoint('walk', $posx, $posy, $posz) end},
        {text = "Node", id = -1, action = function() addwaypoint('node', $posx, $posy, $posz) end},
        {text = "Stand", id = -1, action = function() addwaypoint('stand', $posx, $posy, $posz) end},
        {text = "Shovel", id = -1, action = function() addwaypoint('shovel', $posx, $posy, $posz) end},
        {text = "Rope", id = -1, action = function() addwaypoint('rope', $posx, $posy, $posz) end},
        {text = "Machete", id = -1, action = function() addwaypoint('machete', $posx, $posy, $posz) end},
        {text = "Ladder", id = -1, action = function() addwaypoint('ladder', $posx, $posy, $posz) end},
        {text = "Use", id = -1, action = function() addwaypoint('use', $posx, $posy, $posz) end},
        {text = "Action", id = -1, action = function() addwaypoint('action', $posx, $posy, $posz) end},
        {text = "Lure", id = -1, action = function() addwaypoint('lure', $posx, $posy, $posz) end},
        {text = "North", id = -1, action = function() addwaypoint('stand', $posx, $posy-1, $posz) end},
        {text = "South", id = -1, action = function() addwaypoint('stand', $posx, $posy+1, $posz) end},
        {text = "East", id = -1, action = function() addwaypoint('stand', $posx+1, $posy, $posz) end},
        {text = "West", id = -1, action = function() addwaypoint('stand', $posx-1, $posy, $posz) end},
    }
    local lastPressed = {id = -1, time = $timems}
    local rectHeight, rectWidth = 20 + (#Buttons * 25), 100
    setposition($clientwin.left, $clientwin.top)
    setfontsize(9)

    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(Buttons) do
                if (e.elementid == button.id) then
                    lastPressed = {id = button.id, time = $timems}
                    button.action()
                end
            end
        end
        if (e.type == IEVENT_RMOUSEDOWN) then
            Moving, Temp = true, {$cursor.x - Moved[1], $cursor.y - Moved[2]}
        end
 
        if (e.type == IEVENT_RMOUSEUP) 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
 
setposition($clientwin.left-1 + Moved[1], $clientwin.top + Moved[2])

setfillstyle('color', color(55, 55, 55, 50))
drawrect(0, 0, rectWidth, rectHeight)

local spacing = 0
for i = 1, #Buttons do
    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 25)
    if Buttons[i].id ~= lastPressed.id then
        addgradcolors(0, color(155, 155, 155), 1.0, color(50, 50, 50))
    else
        addgradcolors(0, color(50, 50, 50), 1.0,color(155, 155, 155))
    end
    Buttons[i].id = drawroundrect(10, 10 + spacing, rectWidth-20, 20)
    local w,h = measurestring(Buttons[i].text)    
    drawtext(Buttons[i].text, (rectWidth/2) - (w/2), 20 + spacing - (h/2))
    spacing = spacing + 25
end
if $timems - lastPressed.time > 100 then
    lastPressed.id = -1
end 
Créditos: tibiawindbot

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo