Jump to content

Close a window every 30 minutes?


Recommended Posts

Hey, I need some help making a script. I'm trying to work on something that will close a process(the process will start up again automatically after it is closed) every 30 minutes. I have the window name of the process and the file that its file name under task manager (.exe). Can someone help me with this?

Link to comment
Share on other sites

Why used 2 loops, when can use one loop?

HotKeySet("{Pause}", "Quit")

While 1
    Sleep(1000 * 60 * 30)
    ProcessClose("game.exe")
WEnd

Func Quit()
    Exit
EndFunc
The idea is not bad but this script will not exactly do what Piano_Man wants because the Sleep() function uses seconds as unit while TimerInit()/TimerDiff() uses Milliseconds. Your script would sleep 500hours everytime between killing the process.

Just remove the *1000 to get the desired effect

Greets tannerli

Link to comment
Share on other sites

The idea is not bad but this script will not exactly do what Piano_Man wants because the Sleep() function uses seconds as unit while TimerInit()/TimerDiff() uses Milliseconds. Your script would sleep 500hours everytime between killing the process.

Just remove the *1000 to get the desired effect

Greets tannerli

What? See in the help file, what uses a Sleep(). :)
Link to comment
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
 Share

  • Recently Browsing   0 members

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