Jump to content

Total Noob - need help with script - (Locked)


 Share

Recommended Posts

Hello,

 

I've ran a few searches and can't quite find an answer to something I need to do.

I need a basic script that will open with Win 10 and 'sit waiting' for a certain program to be launched.
At that point I want another program to launch, but not for 90 seconds after the first program opens.

When the first program closes, the second program should also close.

It's important that this script is in some kind of hibernation until events are detected as I've been seeing high CPU load on scripts I've tried to create, yet they are sitting in my system tray and shouldn't be doing much.

I'm attaching an example of a script I use that works very well for another purpose (with none to a tiny CPU load), so I guess I need to add the code that waits 90 seconds before launching the other program?

Opt("TrayIconDebug", 1)
Opt("WinTitleMatchMode", 2)

While 1
    Sleep(10)
    If WinExists("iRacing.com Simulator") Then
        ShellExecute("irAmbience.exe - Shortcut")
        WinWait("iRacingAmbience")
        WinWaitClose("iRacing.com Simulator")
        WinClose("iRacingAmbience")
    EndIf
WEnd

Appreciate all and any help.

Thanks!

Link to comment
Share on other sites

  • Developers

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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