Scinner Posted February 16, 2009 Share Posted February 16, 2009 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 More sharing options...
Zedna Posted February 16, 2009 Share Posted February 16, 2009 Try this: WinClose("[TITLE:Travian; LAST]") or WinClose("[TITLE:Travian; ACTIVE]") Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Scinner Posted February 16, 2009 Author Share Posted February 16, 2009 Try this: WinClose("[TITLE:Travian; LAST]") or WinClose("[TITLE:Travian; ACTIVE]") Thanks alot man, the first one worked like a charm! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now