Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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

Posted

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

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
×
×
  • Create New...