Results 1 to 2 of 2

Thread: Function Time()

  1. #1
    Normal User
    Join Date
    May 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5

    Lightbulb Function Time()

    Hello Guys,

    I need help with this function time(), i want use this to logout my chars on determined hour, on reconnect made by Jonatas have this function, but i dont know how i make action.

    Code:
    local accounts = 
        {
            {acc = 'account', pass = 'password', name = 'Char Name'}
        }
    local serversavetime = {from = '6:00', to = '6:20'}
    serversavetime = {from = tosec(serversavetime.from), to = tosec(serversavetime.to)}
    local randdelay = {min = 0, max = 300}
    local startlabel = ''
    local curchar = 1
    
    --dont change things below
    
    local randomdelay = math.random(randdelay.min, randdelay.max)
    if not connected then
        setcavebot('off')
        local curtime = tosec(time())
        if curtime < serversavetime.from or curtime > serversavetime.to+randomdelay then
            connect(accounts[curchar].acc, accounts[curchar].pass, accounts[curchar].name)
            wait(3000,4000)
            updateworld()
            if connected then
                if startlabel ~= '' then
                    gotolabel(startlabel)
                end
                setcavebot('on')        
            end
        end
    end
    Rep + if i help you!
    Rep + se eu te ajudei!

  2. #2
    Normal User
    Join Date
    May 2012
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    So you want a reconnect script that does not connect during server save?

    Like this?
    Code:
    if (connected == false) and time() <= '3:00:00' or (connected == false) and time() >= '3:10:00' then
        while (connected == false) do
            connect('ACCTNAME', 'PASSWORD', 'CHARNAME')
            wait(3000,5000)
        end
    end

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •