Null33 Posted October 19, 2012 Share Posted October 19, 2012 (edited) Hi , I've a problem whit my code.This is a part of my func:$checksum= PixelChecksum (x) While $checksum= PixelChecksum (x) Sleep (10) $pixel3= PixelGetColor (x) If $pixel3= x Then $checksum2= PixelChecksum (x) Sleep (500) While $checksum2= PixelChecksum (x) Sleep (10) WEnd Sleep (10) EndIf WEndThe problem is that it doesn't consider the if $pixel3...I want the program to checks a part of pixel and then, if something change it checks an other part of pixel (or also the same but sleep for a few seconds). So it check some pixel, then if a pixel becomes colored, start to check an other part. I tried also whit Do...Until but probably I something wrong. How I can solve?I don't know if you understand Sorry for my english. Thanks Edited October 19, 2012 by Null33 Link to comment Share on other sites More sharing options...
JohnOne Posted October 19, 2012 Share Posted October 19, 2012 Show your whole code. And While $checksum2= PixelChecksum (x) means nothing it is error. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Null33 Posted October 19, 2012 Author Share Posted October 19, 2012 (x) are the coordinates ... sorry but at the moment I haven't all the code , when I can I will post it... the rest of the code works well, the problem is in if $pixelgetcolor... I want that if something change the program restarts (and this work fine because after pixelchecksum there is a sleep), but I need that it checks if a pixel becomes colored and then checks an other area and if something change the program restart... Maybe I was not clear, sorry... Link to comment Share on other sites More sharing options...
JohnOne Posted October 19, 2012 Share Posted October 19, 2012 Sorry, maybe a language barrier but sounds like nonsense to me. If you know what you want to do, explain it to your self in short bursts, and code it as you go. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Null33 Posted October 19, 2012 Author Share Posted October 19, 2012 I want that while pixelchecksum is running if a pixel becomes for example red it stops to check the first region of pixels and starts to check an other region of pixels, Is this possible? Why with (if...) it doesn't work? The problem is in pixelchecksum? if you don't understand I will try to explain it better. Thanks Link to comment Share on other sites More sharing options...
JohnOne Posted October 19, 2012 Share Posted October 19, 2012 It does work, you just refuse to post your code so it can be debugged. Good luck anyway. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Null33 Posted October 19, 2012 Author Share Posted October 19, 2012 (edited) This is the code , don't kidding me if it is written wrong, but if you can help me to write it better, thanks expandcollapse popupFunc _Func_1() $fSTOP = False While 1 $pixel= PixelGetColor ($var1, $var2) if $pixel= (code of color) then sleep ($var9) $pixel2= PixelGetColor ($var1, $var2) if $pixel2= (code of color) Then $checksum= PixelChecksum ($var11, $var12, $var13, $var14) While $checksum= PixelChecksum ($var11, $var12, $var13, $var14) Sleep (10) $pixel3= PixelGetColor ($var9, $var10) If $pixel3= 16737792 Then $checksum2= PixelChecksum ($var5, $var6, $var7, $var8) Sleep (500) While $checksum2= PixelChecksum ($var5, $var6, $var7, $var8) Sleep (10) WEnd Msgbox ;(OR ONLY SLEEP, BECAUSE I NEED THAT THE PROGRAM RESTART FROM THE BEGINNING, SO FROM LINE 5) Sleep (10) EndIf WEnd Sleep (10) else Sleep (10) EndIf EndIf If $fSTOP Then Return EndIf Sleep (100) WEnd EndFunc If I write only: Func _Func_1() $fSTOP = False While 1 $checksum= PixelChecksum (coordinates) While $checksum= PixelChecksum (coordinates) Sleep (10) $pixel3= PixelGetColor (coordinates) If $pixel3= (color code) Then $checksum2= PixelChecksum (coordinates) Sleep (500) While $checksum2= PixelChecksum (coordinates) Sleep (10) WEnd MsgBox (0,"","yeah") Sleep (10) EndIf WEnd MsgBox (0,"","oooo") If $fSTOP Then Return EndIf Sleep (100) WEnd EndFunc it seems to work, it's late I'm so confused now :S Thanks Edited October 20, 2012 by Null33 Link to comment Share on other sites More sharing options...
Null33 Posted October 21, 2012 Author Share Posted October 21, 2012 Please help me, why in the first func it doesn't consider the "if $pixel3"? What's wrong? Thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted October 21, 2012 Developers Share Posted October 21, 2012 (edited) Maybe you have a bit of a complex way of coding? Anyway, you are not clear what you are trying to do and we can't run your script the way you posted it. expandcollapse popupFunc _Func_1() $fSTOP = False While 1 $pixel = PixelGetColor($var1, $var2) If $pixel = (code of color) Then Sleep($var9) $pixel2 = PixelGetColor($var1, $var2) If $pixel2 = (code of color) Then $checksum = PixelChecksum($var11, $var12, $var13, $var14) While $checksum = PixelChecksum($var11, $var12, $var13, $var14) Sleep(10) $pixel3 = PixelGetColor($var9, $var10) If $pixel3 = 16737792 Then $checksum2 = PixelChecksum($var5, $var6, $var7, $var8) Sleep(500) While $checksum2 = PixelChecksum($var5, $var6, $var7, $var8) Sleep(10) WEnd Msgbox ;(OR ONLY SLEEP, BECAUSE I NEED THAT THE PROGRAM RESTART FROM THE BEGINNING, SO FROM LINE 5) Sleep(10) EndIf WEnd Sleep(10) Else Sleep(10) EndIf EndIf If $fSTOP Then Return EndIf Sleep(100) WEnd EndFunc ;==>_Func_1 Edited October 21, 2012 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Null33 Posted October 21, 2012 Author Share Posted October 21, 2012 (edited) I try to explain it better: I need a program that tests a pixel ($pixel1), if is red (for expample) it sleep for 10 seconds, then it tests an other pixel ($pixel2) and if it is red then mouseclick, after the click it must check a region of pixel ($checksum1) and if something changes sleep for a few seconds (sleep 10) and so restart from the beginning (if $pixel1...), while is checking region of pixel ($checksum1), if a pixel3 becomes red it must checks an other region of pixel ($checksum2) and if something changes in this region it must sleep for a few seconds (Sleep 10) and then restart from the beginning (if $pixel1...) Help me if you can. Thanks Edited October 21, 2012 by Null33 Link to comment Share on other sites More sharing options...
Developers Jos Posted October 21, 2012 Developers Share Posted October 21, 2012 Doesn't explain much about your intent. Post a clear description what you want to do and a script that you have problems with that we can also run. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Null33 Posted October 21, 2012 Author Share Posted October 21, 2012 I've edited the post #10... I hope I'm clear, thanks Link to comment Share on other sites More sharing options...
JohnOne Posted October 21, 2012 Share Posted October 21, 2012 (edited) What will make it clear, is your full runnable code to test and debug. This whole thread is just farting around trying to drag basic information from you while you kick and scream. pseudo code is not enough. Edited October 21, 2012 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 21, 2012 Developers Share Posted October 21, 2012 I've edited the post #10... I hope I'm clear, thanksNo it is not and you are not answering my question.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
gnomic Posted October 21, 2012 Share Posted October 21, 2012 (edited) im new to all this, so just say, if i should stop talking $pixel3= PixelGetColor ($var9, $var10) Msgbox(0,"",$pixel3) If $pixel3= 15539236 Then what does the msgbox say? Edited October 21, 2012 by gnomic 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