ivoryfire Posted January 8 Posted January 8 So running a modded MC server and wanted to automate a daily restart around 6am. But been trying to figure out how i can make auto-it see system time and run the script i have below. I'm very new to scripting so any and all help would be appreciative. If WinExists("C:\Windows\system32\cmd.exe") WinActivate("C:\Windows\system32\cmd.exe") Send("say Server restarting in 30 seconds") Send("{Enter}") Send("save-all") Send("{Enter}") Sleep(30000) Send("stop") Send("{Enter}") EndIf
Nine Posted January 8 Posted January 8 Best way is to create a scheduled task (taskschd.msc) to run every day at 6am. SOLVE-SMART and AutoBert 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
emcodem Posted January 8 Posted January 8 taskschd.msc is really good for scheduling tasks Alternatively you can do something like this (insert your lines in the Func DoSomething) While True If @HOUR = 5 And @MIN = 59 Then DoSomething() EndIf Sleep(31000) WEnd Func DoSomething() ConsoleWrite("Something was done " & @CRLF) EndFunc
Nine Posted January 8 Posted January 8 Why would anyone want a process to run ALL the time that could crash or get deleted or get stopped, or....??? If you restart the comp, you will need to restart your script. I know there is ways to start automatically a script. But if you insist of doing the wrong way, I suppose the previous proposal would work. Understand that @HOUR and @MIN return strings not integer. So he is comparing wrongly 2 different types of variables. Just so OP knows. ioa747 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now