Results 1 to 7 of 7

Thread: Day Recognising

  1. #1
    iBot User
    Join Date
    Sep 2013
    Posts
    38
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    24
    Rep Power
    4

    Day Recognising

    Hello i just wonder there is possible to use any variable (for ex days()) or any kind of script to recognise current day (not the date , but name of day: monday, saturday,sunday etc.) i need this thing to make full afk rashid script.

  2. #2
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    389 Post(s)
    Reputation
    366
    Rep Power
    10
    PHP Code:
    date() [string]: Represent the current date.
    days() [int]: Represent the number of the current day
    This is the only way to do anything with days atm

  3. #3
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    Quote Originally Posted by Drakke View Post
    PHP Code:
    date() [string]: Represent the current date.
    days() [int]: Represent the number of the current day
    This is the only way to do anything with days atm
    You are wrong.
    Lua Code:
    x = (os.date("%A"))
    say(x)

    output will be "Saturday"

  4. #4
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    389 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by RafiXWPT View Post
    You are wrong.
    Lua Code:
    x = (os.date("%A"))
    say(x)

    output will be "Saturday"
    Ah lol didnt think that would actually work in the sense that he wanted it

  5. #5
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    389 Post(s)
    Reputation
    366
    Rep Power
    10
    So should be something like this then, looks messy but should work

    Lua Code:
    local rashid = (os.date("%A"))
     
    if (rashid == 'Monday' and time() >= '10:00:00') or (rashid == 'Tuesday' and time() < '9:59:59') then
        gotolabel('to_svargrond')
    elseif (rashid == 'Tuesday' and time() >= '10:00:00') or (rashid == 'Wednesday' and time() < '9:59:59') then
        gotolabel('to_libertybay')
    elseif (rashid == 'Wednesday' and time() >= '10:00:00') or (rashid == 'Thursday' and time() < '9:59:59') then
        gotolabel('to_porthope')
    elseif (rashid == 'Thursday' and time() >= '10:00:00') or (rashid == 'Friday' and time() < '9:59:59') then
        gotolabel('to_ankrahmun')
    elseif (rashid == 'Friday' and time() >= '10:00:00') or (rashid == 'Saturday' and time() < '9:59:59') then
        gotolabel('to_darashia')
    elseif (rashid == 'Saturday' and time() >= '10:00:00') or (rashid == 'Sunday' and time() < '9:59:59') then
        gotolabel('to_edron')
    elseif (rashid == 'Sunday' and time() >= '10:00:00') or (rashid == 'Monday' and time() < '9:59:59') then
        gotolabel('to_carlin')
    end


    Change time to your serversave time

  6. #6
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    I would prefer something like that:
    Lua Code:
    local goto
    local SStime = "10:00:00"
    if (os.date("%X")) < SStime then goto = tostring(tonumber((os.date("%w"))) - 1)
    else goto = tostring((os.date("%w")))
    end
     
    gotolabel("city_"..goto) -- where goto is number of day: 0-sunday, 1-monday, etc.


    Just faster action

  7. #7
    iBot User
    Join Date
    Sep 2013
    Posts
    38
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    24
    Rep Power
    4
    thank you very much

Posting Permissions

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