Sign in to follow this  
Followers 0
Donace

Supress error messages

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Donace

Share this post


Link to post
Share on other sites

try to make sure it gives focus to the error box before pressing enter.


~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK

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  
Followers 0