Sign in to follow this  
Followers 0
Scinner

WinClose help please.

3 posts in this topic

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

Share this post


Link to post
Share on other sites



Try this:

WinClose("[TITLE:Travian; LAST]")

or

WinClose("[TITLE:Travian; ACTIVE]")
Thanks alot man, the first one worked like a charm!

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