Jump to content
Sign in to follow this  

WinClose help please.

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)

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

If Not @error Then
     SoundPlay("C:\Program Files\Alarm\alarm.wav")
 WinSetState("Travian", "", @SW_SHOW)
$i = $i + 1

Share this post

Link to post
Share on other sites

Try this:

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


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.