Jump to content

Recommended Posts

Posted

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

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...