[TC] Gaming Forums

Full Version: Autohotkey
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys this is a question for those familiar with AutoHotkey,

I have a script which I use to run LFS, it first opens LFS Strobe - then opening the strobe file, LFS Cops, then LFS using the run commands..

There are two things I would like to add to the script to do which is the following;

Check if the program is already running before running it, and if it is already running don't run it again.

If I close LFS, close all the other programs it opened.

This is the script atm;

Code:
Run D:\Stuff to keep\Live For Speed\strobe\LfsStrobe.exe
WinWait, Lfs Strobe by Tommy,
WinMove -1244, 170
WinWait, Lfs Strobe by Tommy,
IfWinNotActive, Lfs Strobe by Tommy, , WinActivate, Lfs Strobe by Tommy,
WinWaitActive, Lfs Strobe by Tommy,
MouseClick, left,  33,  346
Sleep, 100
WinWait, Open,
IfWinNotActive, Open, , WinActivate, Open,
WinWaitActive, Open,
Sleep, 400
MouseClick, left,  252,  384
Sleep, 100
MouseClick, left,  252,  384
Sleep, 100
WinWait, OK!,
IfWinNotActive, OK!, , WinActivate, OK!,
WinWaitActive, OK!,
MouseClick, left,  94,  128
Sleep, 100
Winmove,Lfs Strobe by Tommy,,,,201,206
Run D:\Junk\25 July 11\Si.lnk
WinWait, LFS Cops v1.1,
Winmove,-1034,174
Sleep, 100
Run D:\Lfs\LFS.exe

Anybody can help? Smile
From a cursory look, I'm not sure you can do those things from a script.

By thebprogram, i guess yiu mean lfs. It does have conditional statements, but I don't know if there would be a library for a sort of process explorer.

A script isn't a program, it can't have event handling afaik.
That's ok, I found out it's acheivable through IfWinNotExist

Also there is a WinWaitClose so all my problems are solved Tongue
Reference URL's