Jump to content

Help with OR statement


Go to solution Solved by Jos,

Recommended Posts

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
Link to comment
Share on other sites

  • Developers
  • Solution

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

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

  • Developers

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

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

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