Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my clock
#2
Create function that ends the macro.
Use tim to run the function after 6 hours.

Function start_my_macro
Code:
Copy      Help
mac "my_macro" ;;run macro "my_macro"
tim 6*60*60 end_my_macro ;;after 6 hours run function "end_my_macro"

Function end_my_macro
Code:
Copy      Help
tim ;;stop this timer
shutdown -6 0 "my_macro" ;;end macro "my_macro"

---------

Or let the macro end itself after 6 hours. Probably the macro does something repeatedly. Then it can use GetTickCount to see how long it is running.
Macro Macro1582
Code:
Copy      Help
;add this at the beginning of the macro
int t1=GetTickCount
int t2=6000*60*60 ;;6 hours

rep
,;add this at the beginning of the loop
,if(GetTickCount-t1>=t2) ret ;;end this macro if 6 hours passed
,;then your code
,1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)