Sign in to follow this  
Followers 0
sumkid

Detect time from server

10 posts in this topic

making a bot for WoW the needs to do different things at different times. pretty much what i need is a way to detect the servers time. is this possible?

Share this post


Link to post
Share on other sites



Bump.

I would like to know this also, for a different reason.

Can someone point me in the right direction.

Thanks in advance.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Bump.

I would like to know this also, for a different reason.

Can someone point me in the right direction.

Thanks in advance.

taurus905

I would imagine that being server specific... do you have more details that you could provide that would help with what you're asking?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

I would imagine that being server specific... do you have more details that you could provide that would help with what you're asking?

SmOke_N,

I want to be able to run an .exe on my computer and get the time from the server where my website is hosted.

I appreciate you taking the time to think about this.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Isn't there a way to write a script that gets the time from somewhere on the internet so it can be assigned to a variable? This task seems like it should be easy to do.

Thanks for any ideas.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Throw a .php file on your server that echoes out the servers current time, then have an AutoIT script InetGetSource() that file.. it will be returned the file.

As for WoW, thats a tricky one, I seriously doubt that you could write a program capable of polling the server directly for its time.

Share this post


Link to post
Share on other sites

Why do you have to do things at a certain time according to the server time? (BTW I dont play WOW)

Share this post


Link to post
Share on other sites

Throw a .php file on your server that echoes out the servers current time, then have an AutoIT script InetGetSource() that file.. it will be returned the file.

As for WoW, thats a tricky one, I seriously doubt that you could write a program capable of polling the server directly for its time.

tAKTelapis,

Thank you for the suggestion. From my research, I was leaning in that direction. Just to be clear, I am not doing anything with WoW. I am just trying to get my .exe to get the time from my server that hosts my website.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

tAKTelapis,

Thank you for the suggestion. From my research, I was leaning in that direction. Just to be clear, I am not doing anything with WoW. I am just trying to get my .exe to get the time from my server that hosts my website.

taurus905

I know why your doing it ... nanny nanny boo boo ... lol...

Try this:

#include <inet.au3>
#include <array.au3>;Only for Array display
#cs
[0] = Day of Week
[1] = Month (string)
[2] = Day of Month
[3] = Year
[4] = Hour
[5] = Minute
[6] = Second
[7] = AM/PM
#ce

Global $aArray = _ThereCanBeOnlyOneTimeLord()
_ArrayDisplay($aArray, "Returned Time Info")

Func _ThereCanBeOnlyOneTimeLord($nZone = 179);179 New York time
    Local $aSRE = StringRegExp( _
        _INetGetSource("http://www.timeanddate.com/worldclock/city.html?n=" & $nZone), _
        'Current time\<\/th\>\<td\>\<strong id="ct"\>(.*?)\<', 3)
    If IsArray($aSRE) = 0 Then Return SetError(1, 0, 0)
    Local $aINF = StringRegExp($aSRE[0], "(?i)(\w+), (\w+) (\d+), (\d+).*? (\d+):(\d+):(\d+) (\w+)",3)
    If IsArray($aINF) = 0 Then Return SetError(2, 0, 0)
    If UBound($aINF) <> 8 Then Return SetError(3, 0, 0)
    Return $aINF
EndFunc

Edit2:

Damn, when I replaced the code tags, I forgot to put back all the info.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

I know why your doing it ... nanny nanny boo boo ... lol...

Try this:

#include <inet.au3>
#include <array.au3>;Only for Array display
#cs
[0] = Day of Week
[1] = Month (string)
[2] = Day of Month
[3] = Year
[4] = Hour
[5] = Minute
[6] = Second
[7] = AM/PM
#ce

Global $aArray = _ThereCanBeOnlyOneTimeLord()
_ArrayDisplay($aArray, "Returned Time Info")

Func _ThereCanBeOnlyOneTimeLord($nZone = 179);179 New York time
    Local $aSRE = StringRegExp( _
        _INetGetSource("http://www.timeanddate.com/worldclock/city.html?n=" & $nZone), _
        'Current time\<\/th\>\<td\>\<strong id="ct"\>(.*?)\<', 3)
    If IsArray($aSRE) = 0 Then Return SetError(1, 0, 0)
    Local $aINF = StringRegExp($aSRE[0], "(?i)(\w+), (\w+) (\d+), (\d+).*? (\d+):(\d+):(\d+) (\w+)",3)
    If IsArray($aINF) = 0 Then Return SetError(2, 0, 0)
    If UBound($aINF) <> 8 Then Return SetError(3, 0, 0)
    Return $aINF
EndFunc

Edit2:

Damn, when I replaced the code tags, I forgot to put back all the info.

SmOke_N,

As always, "You're the man!" :-)

I knew you had the solution and I appreciate you sharing.

And I have no doubt that you know why I am doing this because I am sure you have done something similar in the past.

Thanks for taking the time.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0