Donace Posted August 24, 2008 Share Posted August 24, 2008 basically I am mucking about with the pixel search method and have written the following: $coord = PixelSearch ( $left, $top, $right, $bottom, 0x000000)) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) Else Sleep(1000) Send ("{ENTER}") EndIf the problem is if an error does occur it does not seem to pressing 'enter'; so is there anyway to supress it or something? thanks. and a second question ill tag on is how can you see if a page is laoded without winwait ive tried the code below and but it does not seem to loop; ideally i want it to send a site; run it through here to see if its loaded and then carry on. ;$loaded = 15460567 ;$loading1 = 11074943 ;$loading2 = 16382457 ;$var = PixelGetColor( 945 , 725 );checks the loading bar ;$load=0 ;Func _PageLoadcheck() ;If WinActive("404 Not Found - Mozilla Firefox","") Then ;Send("{F5}") ;Sleep(Random($SiteWait, $MaxSiteWait, 1)) ;ElseIf WinWaitActive("Page Load Error - Mozilla Firefox","") Then ;Send("{F5}") ;Sleep(Random($MinSiteWait, $MaxSiteWait, 1)) ;ElseIf $var = $loaded Then ;$load=1 ;;EndIf ;EndFunc Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 basically I am mucking about with the pixel search method and have written the following: $coord = PixelSearch ( $left, $top, $right, $bottom, 0x000000)) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) Else Sleep(1000) Send ("{ENTER}") EndIf the problem is if an error does occur it does not seem to pressing 'enter'; so is there anyway to supress it or something? thanks.Suppress what? You do not have to act on the @error flag. Or do you get a Terminal error message from the script engine? and a second question ill tag on is how can you see if a page is laoded without winwait ive tried the code below and but it does not seem to loop; ideally i want it to send a site; run it through here to see if its loaded and then carry on. ;$loaded = 15460567 ;$loading1 = 11074943 ;$loading2 = 16382457 ;$var = PixelGetColor( 945 , 725 );checks the loading bar ;$load=0 ;Func _PageLoadcheck() ;If WinActive("404 Not Found - Mozilla Firefox","") Then ;Send("{F5}") ;Sleep(Random($SiteWait, $MaxSiteWait, 1)) ;ElseIf WinWaitActive("Page Load Error - Mozilla Firefox","") Then ;Send("{F5}") ;Sleep(Random($MinSiteWait, $MaxSiteWait, 1)) ;ElseIf $var = $loaded Then ;$load=1 ;;EndIf ;EndFunc Is this code supposed to have a loop in it? When you use WinWaitActive the window has to be the active one before the code will continue. Is that the issue? It is possible you would be better off by using the I explore automation library <IE.au3>, if firefox ain't a strict requirement. Samples in the help file. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Donace Posted August 24, 2008 Author Share Posted August 24, 2008 (edited) woops double post; yes i get a terminal error message if it can not find the colour specified; regarding second point; Firefox is a requirement; mainly now because I have based alot of the functions around it; and i can not use winwait function because the pages are dynamic and therefore the pages names are also dynamic; so unless there is a way to find out the title I cannot think of another way. re: winwait for 404 / page not found; i only want them to come into play if that page title appears Edited August 24, 2008 by Donace Link to comment Share on other sites More sharing options...
burners Posted August 24, 2008 Share Posted August 24, 2008 try to make sure it gives focus to the error box before pressing enter. ~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK 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