Signup Now
Results 1 to 4 of 4

Thread: Time Chcker

  1. #1
    Free User
    Join Date
    Feb 2014
    Posts
    45
    Reputation
    10
    Rep Power
    0

    Time Chcker

    I've searched for some sort of time checker but for the real time from the OS clock. Cant seem to find one, am I blind or does this not exist? I'm searching for this because I'd like to make the bot go to depot 20-30 minutes before server save, logout, and then reconnect after. I've seen the available options, but I don't know if reloging after server save in the middle of a spawn is safe in a lot of cases. Thats why I'm looking for a go to depot option.

  2. #2
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,579
    Reputation
    149
    Rep Power
    27
    init start
    local minStamina = "14:30"
    init end

    if (sstime() < 60*30) then
    gotolabel("leaveCave", "SpawnToTown")
    else
    gotolabel("cont0", "Spawn")
    end
    Last edited by Imba; 02-12-2014 at 07:40 PM.

  3. #3
    Free User
    Join Date
    Feb 2014
    Posts
    45
    Reputation
    10
    Rep Power
    0
    Can't find sstime() in the official docs, is it from someones library?
    If this counts time in ms(?) until server save, then for reloging after it, I would need to do something like this:


    if (sstime() < 24*3600*1000) then
    connect() blabla
    end


    Is this correct? I know i entered the value for a full day in ms, cant be bothered to calculate the correct time for now

  4. #4
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,579
    Reputation
    149
    Rep Power
    27
    Its from Raphael's library
    --[[
    * Returns amount of seconds left for the next server save.
    *
    * @since 0.1.0
    *
    * @returns {number} - Seconds left to server save
    --]]
    function sstime()
    return (36000 - cettime()) % 86400
    end


    check his librarty for more time functions

 

 

Posting Permissions

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