Results 1 to 5 of 5

Thread: Close Tibia at XX or YY time

  1. #1
    iBot User zairax's Avatar
    Join Date
    May 2012
    Location
    Outernet
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    14
    Rep Power
    5

    Lightbulb Close Tibia between XX or YY time

    Hello there,

    I need an action that close Tibia between XX:XX or YY:YY time (random).
    Thanks in advance.
    Will +rep
    Last edited by zairax; 07-21-2013 at 01:00 AM. Reason: typo

  2. #2
    Normal User korzeniowy's Avatar
    Join Date
    Aug 2012
    Location
    Netherlands
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    18
    Rep Power
    5
    Code:
    local TIME = {FROM = '06:00', TO = '06:30', CURRENT = time()} 
    
    if (tosec(TIME.CURRENT) > tosec(TIME.FROM)) and (tosec(TIME.CURRENT) < tosec(TIME.TO)) then  
        closetibia()
    end

  3. #3
    iBot User zairax's Avatar
    Join Date
    May 2012
    Location
    Outernet
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    14
    Rep Power
    5
    Quote Originally Posted by korzeniowy View Post
    Code:
    local TIME = {FROM = '06:00', TO = '06:30', CURRENT = time()} 
    
    if (tosec(TIME.CURRENT) > tosec(TIME.FROM)) and (tosec(TIME.CURRENT) < tosec(TIME.TO)) then  
        closetibia()
    end
    I'll test it. Thanks for help, hope it works!

  4. #4
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    That won't work...

    It will just close the client if the time is between the two specified, not close at a random point between those two times.

    Also... time.current? Wtf is that? Are you assuming people are using this custom library?



    The below probably doesnt work, but you will need to do something like this:
    PHP Code:
    local logoutTime "06:00"
    local logoutInterval 30 -- Minutes

    if os.time > (tosec(logoutTime)*1000then
        wait
    (1,(logoutInterval*1000*60))
        
    closeclient()
    end 
    os.time is, I'm pretty sure, a LUA variable for your current Operating System time in milliseconds, checking to see if its past (or greater than) the time you specify, converted to seconds, then times by 1000 to convert to miliseconds also, then if it IS, it waits a random time between 1milisecond and XX minutes (also converted to milliseconds) before closing the tibia client.


    Again, I haven't tested it
    Last edited by pink_panther; 07-21-2013 at 11:58 PM.

  5. #5
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7
    Quote Originally Posted by pink_panther View Post
    That won't work...

    It will just close the client if the time is between the two specified, not close at a random point between those two times.

    Also... time.current? Wtf is that? Are you assuming people are using this custom library?
    TIME.CURRENT = CURRENT value inside TIME table
    local TIME = {FROM = '06:00', TO = '06:30', CURRENT = time()}

    you should know about it.
    Last edited by Dehan; 07-23-2013 at 10:12 AM.
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

Tags for this Thread

Posting Permissions

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