Get OS Time

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Budzer
Posts: 99
Joined: Fri Sep 23, 2011 12:44 am

Get OS Time

#1 Post by Budzer » Tue Dec 04, 2012 3:29 am

I think I have seen it somewhere, but couldn't find.

Is there a way to execute some path on certain hour. For example my char is doing waypoint file a1 and after reaching waypoint 4 in that file it checks time. If it is past 0:00 and before 0:05 it loads waypoint file a2.

Thanks ahead.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Get OS Time

#2 Post by rock5 » Tue Dec 04, 2012 4:22 am

"os.date("*t")" returns a table with current time values. eg.

Code: Select all

table.print(os.date("*t"))
table: 01EEC9B8
hour:   20
min:    16
wday:   3
day:    4
month:  12
year:   2012
sec:    59
yday:   339
isdst:  true
So you could do something like

Code: Select all

local time = os.date("*t")
if time.min >= 0 and 5 >= time.min then
    loadProfile("a2")
end
Of course if you want it to wait there until that time then you would put it into a loop.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Budzer
Posts: 99
Joined: Fri Sep 23, 2011 12:44 am

Re: Get OS Time

#3 Post by Budzer » Tue Dec 04, 2012 8:59 am

Thanks a lot ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests