Jump to content

WinClose help please.


Scinner
 Share

Recommended Posts

Hi, Ive made a little "Attack Warning" script for a game.

The problem I have is if I have two IE´s running with the same name AI will close both windows when I run the script in "hidden" mode.

It doesn´t occur if I run it in "visible" mode. Is this a bug? If not could you take a look at it and tell me what you think.

I´ve tried with WinKill also but I get the same result. And also with WinSetState("Travian", "", @SW_SHOW) before WinClose.

#include <IE.au3>

$i = 0
While $i <= 100000

Global $Link = "http://s4.travian.se"
$oIE = _IECreate($Link & "/dorf1.php?newdid=59648", 0, 0)
_IELoadWait ($oIE)

$sText = _IEBodyReadText ($oIE)
$Start = StringInStr($sText, "»")
$End = StringInStr($sText, "«")
$Quote = StringMid($sText,$Start,$End-$Start)
    Sleep(200)

Dim $Pattern = "Attack"
Dim $Matches = StringRegExp($Quote, $Pattern, 1)
Dim $Match = $Matches

If Not @error Then
     SoundPlay("C:\Program Files\Alarm\alarm.wav")
 EndIf
 WinSetState("Travian", "", @SW_SHOW)
 WinClose("Travian")
Sleep(20000)
$i = $i + 1
WEnd
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...