Sign in to follow this  
Followers 0
rahulkghosh

Close a window every 30 minutes?

10 posts in this topic

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?

Share this post


Link to post
Share on other sites



lol you were supposed to replace the "*precess.exe*" with "game.exe"

Share this post


Link to post
Share on other sites

lol you were supposed to replace the "*precess.exe*" with "game.exe"

I know..

While 1

$Timer = TimerInit()

Do

Sleep(100)

Until TimerDiff($Timer) > 1000000

ProcessClose(game.exe)

WEnd

Still get error when I put this into an .au3 file and run it.

Share this post


Link to post
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

Share this post


Link to post
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(). :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Paulie's script should work great. I dont see a reason why we're still talking about how many loops there should be. And if there should be Timer...() or Sleep()

Edited by kip

Share this post


Link to post
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
Sign in to follow this  
Followers 0