nodefreak Posted December 13, 2015 Share Posted December 13, 2015 Hi! I have made two diffrent scripts to check colores on 4 different placeses. The only problem is that none of the two diffrent scripts (see under) seems to work. I am new to Autoit so i have realy no idea about what is going on, but I hope some of you guys understand what i am trying to do with looking at the scripts under and see whats wrong about it. And also if someone can tell me if the sleep statement is actualy necessary that would be great! Because the faster the program checks the colores of the 4 different places, the better it is Thank you in advance!script 1:#include <MsgBoxConstants.au3>HotKeySet("{F1}", "FindCol1")HotKeySet("{ESC}", "Terminate")Dim $xX = 1300, $yY = 365Func FindCol1() Check($xX, $yY)EndFuncFunc Check1($X, $Y) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is", $var) MsgBox(0, "The hex color is", Hex($var, 6))EndFuncDim $xX = 1190, $yY = 365Func FindCol2() Check($xX, $yY)EndFuncFunc Check2($X, $Y) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is", $var) MsgBox(0, "The hex color is", Hex($var, 6))EndFuncDim $xX =1070, $yY = 365Func FindCol3() Check($xX, $yY)EndFuncFunc Check3($X, $Y) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is", $var) MsgBox(0, "The hex color is", Hex($var, 6))EndFuncDim $xX = 960, $yY = 365Func FindCol4() Check($xX, $yY)EndFuncFunc Check4($X, $Y) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is", $var) MsgBox(0, "The hex color is", Hex($var, 6))EndFuncFunc Terminate() ExitEndFunc script 2:#include <MsgBoxConstants.au3>HotKeySet("{F1}", "FindCol")HotKeySet("{ESC}", "Terminate")Dim $xX = 1300, $yY = 365While 1 Sleep(500)WEndFunc FindCol() Check($xX, $yY)EndFuncFunc Check($X, $Y) Do $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is1", $var) MsgBox(0, "The hex color is1", Hex($var, 6)) Dim $xX = 1300, $yY = 365 sleep(500) Check($xX, $yY) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is2", $var) MsgBox(0, "The hex color is2", Hex($var, 6)) Dim $xX = 1190, $yY = 365 sleep(500) Check($xX, $yY) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is3", $var) MsgBox(0, "The hex color is3", Hex($var, 6)) Dim $xX = 1080, $yY = 365 sleep(500) Check($xX, $yY) $var = PixelGetColor($X, $Y) MsgBox(0, "The decmial color is4", $var) MsgBox(0, "The hex color is4", Hex($var, 6)) Dim $xX = 970, $yY = 365 Check($xX, $yY) sleep(500) Until _IsPressed("71")EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted December 13, 2015 Developers Share Posted December 13, 2015 Correct,Script one doesn't run anything and ends right away.script 2 restarts Check(() endlessly so will end in a recursion stack error.What are you trying to do?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...
nodefreak Posted December 13, 2015 Author Share Posted December 13, 2015 I am trying to make a script that checks the color of 4 diffrent cordinates in a loop Link to comment Share on other sites More sharing options...
Developers Jos Posted December 13, 2015 Developers Share Posted December 13, 2015 Jeez.. wonder why I didn't get that looking at the first post. 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...
nodefreak Posted December 13, 2015 Author Share Posted December 13, 2015 But is this possible? Link to comment Share on other sites More sharing options...
JohnOne Posted December 13, 2015 Share Posted December 13, 2015 Yes it is. 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...
nodefreak Posted December 13, 2015 Author Share Posted December 13, 2015 This works:#include <MsgBoxConstants.au3>HotKeySet("{F1}", "Check")HotKeySet("{ESC}", "Terminate")While 1 Sleep(500)WEndFunc Check() Do $var = PixelGetColor(1300, 365) MsgBox(0, "The decmial color is1", $var) MsgBox(0, "The hex color is1", Hex($var, 6)) Dim $xX = 1300, $yY = 365 $var = PixelGetColor(1190, 365) MsgBox(0, "The decmial color is2", $var) MsgBox(0, "The hex color is2", Hex($var, 6)) Dim $xX = 1190, $yY = 365 $var = PixelGetColor(1080, 365) MsgBox(0, "The decmial color is3", $var) MsgBox(0, "The hex color is3", Hex($var, 6)) $var = PixelGetColor(970, 365) MsgBox(0, "The decmial color is4", $var) MsgBox(0, "The hex color is4", Hex($var, 6)) Until $var = 10EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted December 13, 2015 Developers Share Posted December 13, 2015 @nodefreak,Please stop with sending these PM's and start first with reading our forum rules.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...
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