DarkCloud Posted January 5, 2007 Share Posted January 5, 2007 Hello, im new to autoit and I wanted to start off with something small. I have this little program on my computer that pops up with a "Buy it now" popup. It's not a real popup, its like a little box that just pops up in the exe. I want autoit to scan for the window, then close it. WinWaitActive() I figured that statement would wait for the window to become active. but how do i close it, and how do i do a loop properly? yes im a newb... flame away =D Thank you all for viewing, and especally thanks to the people who try to help! Link to comment Share on other sites More sharing options...
AutoChris Posted January 5, 2007 Share Posted January 5, 2007 (edited) First, please be more descriptive in your title.Second, use the AutoIt Window Info Tool to find out the real title of the window (sometimes has leading spaces) and the control names. Then you can use something like ControlClick("Window Title", "", "Button1") to close the pop-up after you use the WinWait("WindowTitle") to look for the window.<edit>However, the best thing to do would be to use AdAware and/or SpyBot S&D to search for whatever malware/crimeware/spyware is on your computer making the pop-up in the first place. Edited January 5, 2007 by SerialKiller Link to comment Share on other sites More sharing options...
DarkCloud Posted January 5, 2007 Author Share Posted January 5, 2007 First, please be more descriptive in your title.Second, use the AutoIt Window Info Tool to find out the real title of the window (sometimes has leading spaces) and the control names. Then you can use something like ControlClick("Window Title", "", "Button1") to close the pop-up after you use the WinWait("WindowTitle") to look for the window.<edit>However, the best thing to do would be to use AdAware and/or SpyBot S&D to search for whatever malware/crimeware/spyware is on your computer making the pop-up in the first place.Thanks.It's not spyware or malware.Its just some program im useing as a trial verson and it pops up asking me to buy it like every 5 minutes.Problem is, when it pops up, the program stops working untill I close it. And usualyl when i run the program im not at the computer.I know how to control click, but the "X" button at the top right does not have a control name..So what would I do in this situation? Link to comment Share on other sites More sharing options...
hearurscream Posted January 5, 2007 Share Posted January 5, 2007 When it becomes active, kill it with WinKill(). Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
DarkCloud Posted January 5, 2007 Author Share Posted January 5, 2007 WinWaitActive(Buy Now!) WinKill(Buy Now!) How do I loop this? Also, Does WinWaitActive mean its active?? Can it be minimzed or not selected for the winkill to take place? Link to comment Share on other sites More sharing options...
theguy0000 Posted January 5, 2007 Share Posted January 5, 2007 no, it means it will wait until it is actually active. Change the WinWaitActive to WinWait if you need it to work when not selected. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
hearurscream Posted January 5, 2007 Share Posted January 5, 2007 Try This while 1 if winexists("Buy Now!") Then WinKill("Buy Now!") EndIf WEnd Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
NELyon Posted January 5, 2007 Share Posted January 5, 2007 (edited) Maybe this will help you: Opt("WinTitleMatchMode", 2) $WinTitle = "Buy Now!" ;change this to the title of the window While 1 If WinExists($WinTitle) Then Do WinKill($WinTitle) Until Not WinExists($WinTitle) EndIf Wend Edited January 5, 2007 by D-Generation X Link to comment Share on other sites More sharing options...
Helge Posted January 5, 2007 Share Posted January 5, 2007 (edited) Pauses execution of the script until the requested window is active.Couldn't have been explained any clearer in my eyes, so what's to be confused by ? Edited January 5, 2007 by Helge Link to comment Share on other sites More sharing options...
DarkCloud Posted January 5, 2007 Author Share Posted January 5, 2007 Maybe this will help you: Opt("WinTitleMatchMode", 2) $WinTitle = "Buy Now!" ;change this to the title of the window While 1 If WinExists($WinTitle) Then Do WinKill($WinTitle) Until Not WinExists($WinTitle) EndIf Wend Ok, i understand all of that except for the very very first line you have there. Whats "Opt("WinTitleMatchMode", 2)" do??? Link to comment Share on other sites More sharing options...
hearurscream Posted January 5, 2007 Share Posted January 5, 2007 The Mode 2 of that option says that it will match any substring in the title. So if the title has trailing spaces or weird characters before or after it, it will still recognize the window. Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
DarkCloud Posted January 5, 2007 Author Share Posted January 5, 2007 The Mode 2 of that option says that it will match any substring in the title. So if the title has trailing spaces or weird characters before or after it, it will still recognize the window.Ok, I took out the option because both of my titles are close.Title of the popupTitle: Online Hold'em InspectorTitle of the actual program i need.Title: Online Hold'em Inspector 2.33d4Even when I take out the option, It closes both programs.Why is that? Link to comment Share on other sites More sharing options...
hearurscream Posted January 5, 2007 Share Posted January 5, 2007 Try mode 3 instead of 2: Opt("WinTitleMatchMode", 3) Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
DarkCloud Posted January 5, 2007 Author Share Posted January 5, 2007 Nope, still closes both. Link to comment Share on other sites More sharing options...
hearurscream Posted January 5, 2007 Share Posted January 5, 2007 Use the Autoit Window Information tool to get some text from the pop-up you want to kill. Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
DarkCloud Posted January 5, 2007 Author Share Posted January 5, 2007 (edited) What code would I use to kill it then??? $WinTitle = "Online Hold'em Inspector" While 1 If WinExists($WinTitle) Then Do WinActivate($WinTitle) WinKill($WinTitle) Until Not WinExists($WinTitle) EndIf Wend >>>>>>>>>>> Visible Window Text <<<<<<<<<<< Buy Now (web) evaluate Party Poker Coral Poker UltimateBet Poker Stars Gaming Club Royal Vegas Empire Poker Full Tilt Poker PokerRoom Eurobet Poker Paradise Poker Absolute Poker WPEX 7 Sultans Poker Ladbrokes Poker Hollywood Poker (29 days left) InterPoker Littlewoods Poker William Hill Poker Unibet Poker Bet365 Poker River Belle Poker Intertops Poker BetHoldem Crazy Poker Poker Plex Sun Poker Edited January 5, 2007 by DarkCloud Link to comment Share on other sites More sharing options...
hearurscream Posted January 8, 2007 Share Posted January 8, 2007 $WinTitle = "Online Hold'em Inspector" While 1 If WinExists($WinTitle, "Buy Now") Then Do WinKill($WinTitle,"Buy Now") Until Not WinExists($WinTitle,"Buy Now") EndIf Wend Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. 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