Sign in to follow this  
Followers 0
Arez

Make Program Not Run If Game Isn't Open

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Copy and paste.....

Share this post


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

Share this post


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

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