Ir para conteúdo

Featured Replies

Postado
Versão do Servidor: TFS - 0.4
Tipo de Script: Globalevent

Código:

Spoiler

local msg = {
    ['20:20'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    ['20:25'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    ['20:30'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    ['20:35'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21}
}

function onThink(interval, lastExecution)
    local h = msg[os.date('%X'):sub(1, 5)]
    return h and doBroadcastMessage(h.text, h.type) or true
end

 

 

Queria que falasse apenas em dias específicos (configurável), no caso seria Sábado, Domingo, Terça E Quinta

Resolvido por So volto tarde

Ir para solução
Postado
  • Solução
local msg = {
    ["Sunday"] = { --segunda
        ['20:20'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    },
    ["Tuesday"] = { --terça
        ['20:25'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    },
    ["Thursday"] = { --quinta
        ['20:30'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    },
    ["Saturday"] = { --sexta
        ['20:35'] = {text = 'Evento Up Aberto No Segundo Andar Do Temple', type = 21},
    },
}

function onThink(interval, lastExecution)
    local day = os.date("%A")
    local hours = os.date('%X'):sub(1, 5)
    if (msg[day][hours]) then
        local tab_val = msg[day][hours]
        return tab_val and doBroadcastMessage(tab_val.text, tab_val.type) or true
    end
end

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo