Kinesis Posted July 2, 2008 Share Posted July 2, 2008 (edited) I have a do-until loop with 7 if-then statements that look for a certain color at a certain pixel coordinate, and press a button when true. My problem is that the loop is really slow, taking a few seconds to process each if-then statement. Just one pass through the loop could take 10 seconds or more... I dont understand why it is so slow... Shouldnt AutoIt fly through this loop many times per second? Any tips on how I can speed it up would be greatly appreciated. Here is my code: func test() If PixelGetColor(1215,736) <> 0xFF9898 Then ;do something EndIf If PixelGetColor(84,135) <> 0xFFFFFF Then ;do something EndIf If PixelGetColor(163,55) <> 0xC20307 AND PixelGetColor(190,56) <> 0xC20307 AND PixelGetColor(216,56) <> 0xC20307 Then ;do something EndIf If PixelGetColor(1165,738) = 0x06BF06 Then ;do something EndIf If PixelGetColor(158,59) <> 0xF81C21 Then ;do something EndIf If PixelGetColor(160,57) <> 0xF80000 AND PixelGetColor(187,58) <> 0xF80000 AND PixelGetColor(213,58) <> 0xF80000 Then ;do something EndIf If PixelGetColor(24,143) <> 0xFFFFFF or PixelGetColor(24,129) <> 0xFFFFFF Then ;do something EndIf until PixelGetColor(1230,685) <> 0xB6595C AND PixelGetColor(1248,685) <> 0xB6595C endfunc Edited July 2, 2008 by Kinesis Link to comment Share on other sites More sharing options...
ofLight Posted July 2, 2008 Share Posted July 2, 2008 I just tried on my box and its flying like u whould expect, 1000's of Cycles within seconds expandcollapse popupGlobal $count = 0 Test() func test() Do If PixelGetColor(1215,736) <> 0xFF9898 Then ;do something EndIf If PixelGetColor(84,135) <> 0xFFFFFF Then ;do something EndIf If PixelGetColor(163,55) <> 0xC20307 AND PixelGetColor(190,56) <> 0xC20307 AND PixelGetColor(216,56) <> 0xC20307 Then ;do something EndIf If PixelGetColor(1165,738) = 0x06BF06 Then ;do something EndIf If PixelGetColor(158,59) <> 0xF81C21 Then ;do something EndIf If PixelGetColor(160,57) <> 0xF80000 AND PixelGetColor(187,58) <> 0xF80000 AND PixelGetColor(213,58) <> 0xF80000 Then ;do something EndIf If PixelGetColor(24,143) <> 0xFFFFFF or PixelGetColor(24,129) <> 0xFFFFFF Then ;do something EndIf $count = $count+1 Tooltip($count) until False ;had to Rem the below line because it was true everytime for me ;until PixelGetColor(1230,685) <> 0xB6595C AND PixelGetColor(1248,685) <> 0xB6595C endfunc There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
Kinesis Posted July 2, 2008 Author Share Posted July 2, 2008 I did a search on slow scripts and I found a thread talking about how pixelgetcolor is a memory hog, and very slow on vista... I am running windows vista. Is there anything I can do to speed it up? Link to comment Share on other sites More sharing options...
ofLight Posted July 2, 2008 Share Posted July 2, 2008 (edited) yes, Change your Apearance Settings from "Windows Areo" to "windows Vista Basic", I tried it on Windows Server2008 and the script increased in speed 100 fold Edited July 2, 2008 by ofLight There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
Kinesis Posted July 2, 2008 Author Share Posted July 2, 2008 (edited) I adjusted the vista graphical settings for "best performance" and now my sript is doing thousands of cycles per second... Hmm does anyone know why? Thanks for your input ofLight. Edited July 2, 2008 by Kinesis Link to comment Share on other sites More sharing options...
Andreik Posted July 2, 2008 Share Posted July 2, 2008 (edited) @ofLight Nice sign. Where you find? Edited July 2, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
ofLight Posted July 2, 2008 Share Posted July 2, 2008 on desktop Right click/Personalize/Windows color and appearance There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly 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