Sign in to follow this  
Followers 0
supraspecies

Help with OR statement

6 posts in this topic

#1 ·  Posted (edited)

Can't get OR statement to work with both windows. Need for script to exit if either window exists. Tried:

While Not WinExists ('[TITLE:ActiveMovie Window;CLASS:VideoRenderer]') Or Not WinExists ('[TITLE:Hover Ace;CLASS:D3D Window]')
sleep(1000)
WEnd
Exit

Tried:

While Not WinExists ('[TITLE:ActiveMovie Window;CLASS:VideoRenderer]') Or WinExists ('[TITLE:Hover Ace;CLASS:D3D Window]')

Tried:

While Not WinExists ('[TITLE:ActiveMovie Window;CLASS:VideoRenderer]') Or ('[TITLE:Hover Ace;CLASS:D3D Window]')

Neither works. Windows TITLE and CLASS are proper. Tried them separately - works. But doesn't work with both. Can't figure out what am I doing wrong. Used OR statement before, never had this problem.

EDIT:

Do/Ultil loop worked fine.

Do
ShellExecute(@ScriptDir & '\HoverAce.exe', '', @ScriptDir)
sleep(1000)
Until WinExists ('[TITLE:ctiveMovie Window;CLASS:VideoRenderer]') Or WinExists ('[TITLE:Hover Ace;CLASS:D3D Window]')

But I'm still wondering why While loop failed. It's practically the same thing here, so I dont see a reason for failure. Maybe it has something to do with NOT?

Topic can be marked as solved (looks like I can't mark my first post as a solution) unless someone cares to give an explanation to this. I'd appreciate it.

Edited by supraspecies

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

When testing for "Not WinExists: you need to change it to an And relation ;)

eg:

While Not WinExists ('[TITLE:ActiveMovie Window;CLASS:VideoRenderer]') And Not WinExists ('[TITLE:Hover Ace;CLASS:D3D Window]') 
   sleep(1000) 
WEnd 
Exit

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ohhh, I get it now. Thank you, now I see the flaw. Solved.

Share this post


Link to post
Share on other sites

Ohhh, I get it now. Thank you, now I see the flaw. Solved.

I was just made aware you seem to be doing game automation, so advice you to read our forum rules carefully!

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I was just made aware you seem to be doing game automation, so advice you to read our forum rules carefully!

Jos

No, you misunderstood. The game is not optimized for 64-bit operating systems. It does launch, but it launches from third or fifth try. What I was doing is creating a launcher that will launch the game until the game window appears (i.e. it succeeds to actually launch the game). This is my full script:

#notrayicon
#include <Misc.au3>
_Singleton("Hover Ace Launcher", 0)
While Not WinExists ('[TITLE:ActiveMovie Window;CLASS:VideoRenderer]') And Not WinExists ('[TITLE:Hover Ace;CLASS:D3D Window]')
   While Not ProcessExists ('HoverAce.exe')
      Run(@ScriptDir & '\HoverAce.exe', @ScriptDir)
WEnd
WEnd

What I do is fix games, not hack them. Besides, it's a Single Player game.

No hacks or alterations of any kind are involved.

Edited by supraspecies

Share this post


Link to post
Share on other sites

The rules aren't specific to multiplayer games.  If you need a reminder.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0