Jump to content

Make Program Not Run If Game Isn't Open


Recommended Posts

So far I have this code:

If WinExists ("Diablo II") Then

WinActivate ("Diablo II")

WinWaitActive ("Diablo II")

$WinPos = WinGetPos ("Diablo II")

Sleep(595)

Send("{ESC}")

Else

Exit

EndIf

How would I make that come up with an error message saying, "Game not found" or something like that instead of excecuting the code if diablo II wasn't open?

thanks

Edited by Arez
Link to comment
Share on other sites

hmm try my script

If WinExists("Diablo II") Then
    HotKeySet("{Space}", "close")
Else
    MsgBox(64, "Info", "The game isn´t running!")
    Exit(0)
EndIf

Func Close()
    Send("!{F4}")
EndFunc

While 1
    Sleep(100)
WEnd

this was meant for hardcore if space is hit it exits right out of the game if that gives you a idea

Edited by Evil_Has_Survived
Thanks in advance
Link to comment
Share on other sites

I am dumb and don't understand how to put that in my script. HELP

so say

.............

.............

.............

.............

see the dots just say thats the script ok

step 1 highlight it (not to hard right ok)

step 2 rightclick

step 3 copy

step 4 open autoit script

step 5 edit

step 6 paste

easy steps or

step 1 highlight

step 2 hold ctrl and c at the same time

step 3 open autoit script

step 4 ctrl and hold v at the same time

or

step 6 edit,,, paste

Thanks in advance
Link to comment
Share on other sites

If WinExists ("Diablo II") Then
HotKeySet("{Space}", "close")
WinActivate ("Diablo II")
WinWaitActive ("Diablo II")
$WinPos = WinGetPos ("Diablo II")
Sleep(595)
Send("{ESC}")
Else
MsgBox(64, "Info", "The game isn´t running!")
Exit
EndIf

Func Close()
    Send("!{F4}")
EndFunc

While 1
    Sleep(100)
WEnd

That's really all there is to it....

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...