Jump to content

Window created


Recommended Posts

If you only want it to fire once add ExitLoop to the code you add when it finds the window.

Not sure whether that would work either, I probably should have thought to include the whole thing in my first post. My program is a utility for a multiplayer game. The program is not dependent on the game being run, however. The program just checks when you use a hotkey whether you are in the game window and proceeds from there. The program needs to fire a piece of code whenever the user connects to a new server, which means that the player will exit the game and then the game will re-open. I think if I use exit-loop in the while loop it will only fire when you open the game the very first time. What do you think I should do? Thanks in advance!

Regards,

Eradicator

Link to comment
Share on other sites

Hmm, that's a bit of a tough question. You could try something like

While 1
If WinExists("Untitled - Notepad") And $check = 1 Then
;do something here
$check = 0
Else
Sleep(1000)
Endif
WEnd

Then use HotKeySet to call a function to set $check to 1 when you're about to connect to a different server since you should know when you are. Also quick question, is this for F.E.A.R.?

Link to comment
Share on other sites

Hmm, that's a bit of a tough question. You could try something like

While 1
If WinExists("Untitled - Notepad") And $check = 1 Then
;do something here
$check = 0
Else
Sleep(1000)
Endif
WEnd

Then use HotKeySet to call a function to set $check to 1 when you're about to connect to a different server since you should know when you are. Also quick question, is this for F.E.A.R.?

No, it isn't. This is being used for San Andreas: Multiplayer. There is a server where its important to use specific commands on other players quickly, and I found it inefficient to be typing it myself. I thought of a way to get your code to work, all I need to do is this in a while loop.

If WinExists("GTA:SA:MP") And $check = 1 Then
;Do code.
        $check = 0
    Else
        $check = 1
    Endif

Regards,

Eradicator

Edited by Eradicator
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...