Jump to content



Photo

Time functions


  • Please log in to reply
No replies to this topic

#1 sohfeyr

sohfeyr

    Prodigy

  • Active Members
  • PipPipPip
  • 194 posts

Posted 29 August 2006 - 02:39 AM

I ran into a situation where I needed to set the system clock ahead, and did some poking around. At another time, I needed a delay function that would work on multiprocessor machines (has that happened to anyone else?). Finally, I decided to put it all together. Enjoy.


Depending mostly on
MSDN documentaion

Usage:
$t1=API_GetLocalTime() Consolewrite($t1 & @crlf) API_SetLocalTime(+5, "hours") ; set clock forward five hours API_SetLocalTime(-3, "days") ; set clock back three days API_SetLocalTime("2006:8:2:29:15:46:55:521") ; set to a specific time (yyyy:month:dayofweekisignored:dayofmonth:hourofday:minute:second:millisecond) API_SetLocalTime($t1) _TimeDelayForMS(10000) _TimeDelayUpToMS(10000, "MouseAt00()") ; just a sample function that returns a 0 or 1 Func MouseAt00() ; As Boolean     If MouseGetPos(0) + MouseGetPos(1) = 0 then Return 1     Return 0 EndFunc









0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users