Jump to content

Recommended Posts

Posted

or something with more fun, lets see who first can confuze him :)

#Include <Array.au3>
Dim $temperror[3][4] = [['Blue','','',''],['Red','','',''],['Green','','','']]
Global $error, $noterror, $x = 0
While 1
    _error(PixelSearch(100, 300, 200, 512, 0x0000ff, 10)) ;Blue
    _error(PixelSearch(250, 310, 400, 512, 0xfa0000, 10)) ;Red
    _error(PixelSearch(500, 300, 600, 512, 0x00ff00, 10)) ;Green
    For $z = 0 To 2
        If $temperror[$z][1] Then $error = $error&' '&$temperror[$z][0]
        If Not $temperror[$z][1] Then $noterror = $noterror&' '&$temperror[$z][0]
    Next
    If $noterror Then $noterror='Found'&$noterror
    If $error Then $error='Not found'&$error
    If $noterror And $error Then $error = ', '&$error
    MsgBox(0,'Message',$noterror&$error)
    _ArrayDisplay($temperror)
    $error=''
    $noterror=''
WEnd
Func _error($a)
    If IsArray($a) Then
        $temperror[$x][1] = ''
        $temperror[$x][2] = $a[0]
        $temperror[$x][3] = $a[1]
    Else
        $temperror[$x][1] = 1
    EndIf
    $x += 1
    If $x = 3 Then $x = 0
EndFunc

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Posted (edited)

i try it out :)

Lol.. after i learn it ^^

Dude BogQ .. wtf ^^ i don't know half of what youre doing, can you give a short description so i have a easier time Reading up on it?

Edited by Schoening
Posted

you could save the errors on an array, and then run a loop to make sure that all three pixelsearch functions worked as planned.

$pixelsearch1 = PixelSearch(100,300,200,512,0x0000ff,10)
$pixelSearchError[0] = @error
Sleep(10)
$pixelsearch2 = PixelSearch(250,300,400,512,0xfa0000,10)
$pixelSearchError[1] = @error
Sleep(10)
$pixelsearch3 = PixelSearch(500,300,600,512,0x00ff00,10)
$pixelSearchError[2] = @error
Sleep(10)
For $tempCounter = 0 To 2 Step 1
   If $pixelSearchError[$tempCounter] = 1 Then  $errorExists = True
Next

Though it depends on how you want this to run, you could have all the pixelsearching in a function, and then when you are testing for the errors, if an error exists, have it run the pixelsearching function again. That way, it will keep looping until none of the pixelsearching throws an error.

So something like

For $tempCounter = 0 To 2 Step 1
   If $pixelSearchError[$tempCounter] = 1 Then pixelSearch()
Next

:)

No, i dont want it to search until No @Error Occurs. I just Want it To Tell Me How Many Where @error and Not @Error so i can proceed to what i want the Function to do. Finding the Closest of the Two compared to the Y axe

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...