Graymatter Posted October 24, 2006 Share Posted October 24, 2006 Example:while 1funct()wendfunct()pickab()pickcd()EndfuncFunc pickab()$somevar = pixelsearch( parameters)if not @error thenexecute some actionendifelse$someothervar = pixelsearch(parameters)if not @error thenexecute some actionendifEndifEndfuncMy question is:if func pickab() re written as;Func pickab()if $somevar = pixelsearch( parameters) thenexecute some actionelseif $someothervar = pixelsearch(parameters) thenexecute some actionendifelsesome msgEndfuncWould this be correct ?I just want to know which option would be better off for me. Thanks for your help in advance and if some one wants to crack up a wise ("u should have done this or that before posting this blah blah) the least you could do is be polite about it. [quote]I am so clever that sometimes I don't understand a single word of what I am saying.[/quote] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 24, 2006 Moderators Share Posted October 24, 2006 (edited) My question is: if func pickab() re written as; Would this be correct ? I just want to know which option would be better off for me.No, you need to check the helpfile for what PixelSearch Returns (I sound like a broken record tonight with saying that) Edit: However, I've never done this, but I don't see why it wouldn't work: If IsArray(PixelSearch(params....)) Then ;Do Something EndIf Edited October 24, 2006 by SmOke_N 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...
Graymatter Posted October 24, 2006 Author Share Posted October 24, 2006 (edited) No, you need to check the helpfile for what PixelSearch Returns (I sound like a broken record tonight with saying that) Edit: However, I've never done this, but I don't see why it wouldn't work: If IsArray(PixelSearch(params....)) Then ;Do Something EndIf Lol i have seen most of your posts you seem to be working way to hard coz you are always tired . Take some rest. Anyways, so you are saying its good to check if pixel search has any array rather than checkin it with if NOT @ error, actually you got a point . But i know if not @ error works i just want you to focus on the if not @ error / if ... then function in this very particular case. P.S: Whats the best way to test out both on terms of Speed and accuracy. I will give a hint what i am trying to pull off. Will post the code when i can make some sense of it. I want to search pixel for bottom > if nuthing then top and left > if nuthing then right. Additionally i would try to add a timer (execution time of each function ) whichever executes faster i would be executing only that chunk of code. For this i would be storing the times into an array, perform smallest of array search value on it and execute the block on that bases. if i can pull all this off that is. So basically for that i just need to know which function would be faster also correct. Edited October 24, 2006 by Graymatter [quote]I am so clever that sometimes I don't understand a single word of what I am saying.[/quote] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 24, 2006 Moderators Share Posted October 24, 2006 Lol i have seen most of your posts you seem to be working way to hard coz you are always tired . Take some rest.Anyways, so you are saying its good to check if pixel search has any array rather than checkin it with if NOT @ error, actually you got a point . But i know if not @ error works i just want you to focus on the if not @ error / if ... then function in this very particular case.P.S: Whats the best way to test out both on terms of Speed and accuracy.I will give a hint what i am trying to pull off. Will post the code when i can make some sense of it.I want to search pixel for bottom > if nuthing then top and left > if nuthing then right.Additionally i would try to add a timer (execution time of each function ) whichever executes faster i would be executing only that chunk of code.For this i would be storing the times into an array, perform smallest of array search value on it and execute the block on that bases. if i can pull all this off that is.So basically for that i just need to know which function would be faster also correct.OCR? 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...
Graymatter Posted October 24, 2006 Author Share Posted October 24, 2006 OCR?I wonder how many times you typed "OCR?". No. I aint got that much graymatter.Simple kinder garden pixelsearch. But i think i confused you. Let me rephrase:Func picab()if something<>something thenexecutemeelseexecuteyourEndifor should it be Func picab()something=somethingif not @error thenexecute meelseif something <> something thenexecuteyouEndif [quote]I am so clever that sometimes I don't understand a single word of what I am saying.[/quote] 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