Googler24022 Posted May 24, 2005 Share Posted May 24, 2005 (edited) While 1 If PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "You have made 0 clicks today. You have 350/350 clicks remaining today") Then MouseClick("Left", 566, 388, 1) EndIf WEnd While 2 If PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Due to players using automated programs which hurt our site, refreshing has been disabled. Please use the recruit! button on the recruiter. Click here to continue") Then MouseClick("Left", 577, 484, 1) EndIf WEnd While 3 If PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "You have already clicked the maximum number of members for today") Then MsgBox(48, "Done", "You have finished Clicking!") EndIf WEndHere i have three things to do. How would i make it so it would go to the second one if the first one was not true and so on? Edited January 29, 2012 by Googler24022 Link to comment Share on other sites More sharing options...
GaryFrost Posted May 24, 2005 Share Posted May 24, 2005 You mean something like the following? While 1 If PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "You have made 0 clicks today. You have 350/350 clicks remaining today") Then MouseClick("Left", 566, 388, 1) ElseIf PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Due to players using automated programs which hurt our site, refreshing has been disabled. Please use the recruit! button on the recruiter. Click here to continue") Then MouseClick("Left", 577, 484, 1) ElseIf PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "You have already clicked the maximum number of members for today") Then MsgBox(48, "Done", "You have finished Clicking!") ExitLoop EndIf WEnd SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Googler24022 Posted May 24, 2005 Author Share Posted May 24, 2005 (edited) That is not working for me atm. The third function should go off, but when i visit the page the program starts the first function. Edited January 29, 2012 by Googler24022 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 24, 2005 Moderators Share Posted May 24, 2005 (edited) If PixelGetColor(600, 500) = 0Never seen a pixel color at 0 before?But I would put this at top anyway:Opt("WinTitleMatchMode", 4) Opt("PixelCoordMode", 0); sets the pixel to search in active window Opt("MouseCoordMode", 0); makes sure mouse click is in active window not screen Winactivate("Dark Throne") While 1 If PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "You have made 0 clicks today. You have 350/350 clicks remaining today") Then MouseClick("Left", 566, 388, 1) ElseIf PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "Due to players using automated programs which hurt our site, refreshing has been disabled. Please use the recruit! button on the recruiter. Click here to continue") Then MouseClick("Left", 577, 484, 1) ElseIf PixelGetColor(600, 500) = 0 And WinGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer", "You have already clicked the maximum number of members for today") Then MsgBox(48, "Done", "You have finished Clicking!") ExitLoop EndIf WEndGood luckEDIT: "/" whoda thunk it means so much Edited May 24, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
buzz44 Posted May 24, 2005 Share Posted May 24, 2005 0(Decimal) = 0x000000(Hexadecimal), both equal black. qq Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted May 25, 2005 Share Posted May 25, 2005 Usually if its not 1 of 2 possible options, I would use Select...Case...EndSelect over If...ElseIf...Else...EndIf just so that you don't start nesting If statements within If statements. I'm not into structual engineering along side my code, I'll let the architects build the pyramids (stupid joke) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
Googler24022 Posted May 25, 2005 Author Share Posted May 25, 2005 (edited) While 1 Select Case StatusbarGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer") = "Done" And WinGetText ( "Dark Throne (beta) Recruitloop - Microsoft Internet Explorer" , "clicked today" ) MouseClick ( "Left" , 566, 388 , 1) Case WinGetText ( "Dark Throne (beta) Recruitloop - Microsoft Internet Explorer" , "Due to players using automated programs which hurt our site, refreshing has been disabled" ) MouseClick ( "Left" , 575, 475 , 1) EndSelect WEndNope nothing works. I don't want to exit the loop. The weird thing is that the second case keeps repeating itself even though it isnt not true. Do you think i should add more functions to try and identify the page more? Edited January 29, 2012 by Googler24022 Link to comment Share on other sites More sharing options...
TuMbLeWeEd Posted May 25, 2005 Share Posted May 25, 2005 While 1 Select Case StatusbarGetText("Dark Throne (beta) Recruitloop - Microsoft Internet Explorer") = "Done" And WinGetText ( "Dark Throne (beta) Recruitloop - Microsoft Internet Explorer" , "clicked today" ) MouseClick ( "Left" , 566, 388 , 1) Case WinGetText ( "Dark Throne (beta) Recruitloop - Microsoft Internet Explorer" , "Due to players using automated programs which hurt our site, refreshing has been disabled" ) MouseClick ( "Left" , 575, 475 , 1) EndSelect WEndNope nothing works. I don't want to exit the loop. The weird thing is that the second case keeps repeating itself even though it isnt not true. Do you think i should add more functions to try and identify the page more?<{POST_SNAPBACK}>If i look at the code, tour trying to get text from IEWinGetText from IE returns "" =nothing, does not work on IE window textHave to use com for that like:;Autor: DaleHohm $url = "http://www.amazon.com" ; Create IE Object $ObjIE=ObjCreate("InternetExplorer.Application") ; Set IE visible, navigate to URL and wait for load complete With $ObjIE .Visible = True .Navigate($url) Do; Idle until load complete Sleep(50) Until .ReadyState = 4 EndWith ; These variables collect everything inside the BODY tag $theText = $ObjIE.document.body.innerText; gets just text $theHTML = $ObjIE.document.body.innerHTML; gets everything including HTML My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers Link to comment Share on other sites More sharing options...
Googler24022 Posted May 25, 2005 Author Share Posted May 25, 2005 (edited) Can i not retreive text from firefox? If not i will try and figure out how to use this Com.Thank you! Edited January 29, 2012 by Googler24022 Link to comment Share on other sites More sharing options...
TuMbLeWeEd Posted May 25, 2005 Share Posted May 25, 2005 Can i not retreive text from firefox? If not i will try and figure out how to use this Com.Thank you!<{POST_SNAPBACK}>Not at all as far as i know My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers Link to comment Share on other sites More sharing options...
Googler24022 Posted May 25, 2005 Author Share Posted May 25, 2005 Your com does not work. I downloaded the latest beta but it says its a undefined function. Link to comment Share on other sites More sharing options...
TuMbLeWeEd Posted May 25, 2005 Share Posted May 25, 2005 Your com does not work. I downloaded the latest beta but it says its a undefined function.<{POST_SNAPBACK}>Not my com, DaleHolm's com , should workIf you use SciTE you must do "tools"=>"Beta run Alt + F5"GivesnNo problem on my pc's! (win2000 & WinXP sp2) My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers Link to comment Share on other sites More sharing options...
Googler24022 Posted May 25, 2005 Author Share Posted May 25, 2005 (edited) Problem Solved! Thanks! Sorry for my many questions. Also!? Do coms work with the autoit script well? Another q : Will i be able to open firefox with this? Anoter Question : Where do i find out about coms? i find it very hard to get any info on them. Thanks! Edited May 25, 2005 by Googler24022 Link to comment Share on other sites More sharing options...
TuMbLeWeEd Posted May 25, 2005 Share Posted May 25, 2005 Problem Solved!Thanks!Sorry for my many questions.Also!? Do coms work with the autoit script well?Another q : Will i be able to open firefox with this?Anoter Question : Where do i find out about coms? i find it very hard to get any info on them. Thanks!<{POST_SNAPBACK}>1) You did it in AutoIt =>so yes2)Firefox does not work with com objects3)It's all on MSDN, IE objectsHave to convert the exaples to AutoIt (if there are any)Hope this helps My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers Link to comment Share on other sites More sharing options...
Googler24022 Posted May 25, 2005 Author Share Posted May 25, 2005 Theres a certain piece of text i want now, so when the program finds this text it will do something and if its not the right text, do something else? How would i go about getting the text from the page? The page also changes so it would pointless using the $theText = $ObjIE.document.body.innerText; gets just text Im not sure though? Link to comment Share on other sites More sharing options...
TuMbLeWeEd Posted May 25, 2005 Share Posted May 25, 2005 (edited) Theres a certain piece of text i want now, so when the program finds this text it will do something and if its not the right text, do something else? How would i go about getting the text from the page? The page also changes so it would pointless using the $theText = $ObjIE.document.body.innerText; gets just textIm not sure though? <{POST_SNAPBACK}>I think you want to do somthing like:see if "clicked today" or "Due to players using automated programs which hurt our site, refreshing has been disabled" is in the text $url = "http://www.darkthrone.com/";dont know rest of url ; Create IE Object $ObjIE=ObjCreate("InternetExplorer.Application") ; Set IE visible, navigate to URL and wait for load complete With $ObjIE .Visible = True .Navigate($url) Do; Idle until load complete Sleep(50) Until .ReadyState = 4;would be statusbartext done then EndWith While 1 $theText = $ObjIE.document.body.innerText; gets just text if StringInStr($theText ,"clicked today") then ;do the suff you want ElseIf StringInStr($theText ,"Due to players using automated programs which hurt our site, refreshing has been disabled") then ;do other stuff you want Endif sleep(1000);checks every second WendIf the $ObjIE.document.body.innerText gets the refreshed text that isIt shoud do the trickIf you have to refresh the page over and over include this in the while loopWith $ObjIE .Visible = True .Navigate($url) Do; Idle until load complete Sleep(50) Until .ReadyState = 4;would be statusbartext done then EndWith Edited May 25, 2005 by TuMbLeWeEd My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers 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