futahito Posted March 12, 2013 Share Posted March 12, 2013 Hi guys. I'm total noob at all this scripting, so sorry if my question is stupid. I want to make script that constantly tracks certain color at (x,y), and sends "a", "v","o" and "t" if certain conditions are met. Better explanation: color 1 appears at x,y check if color 2 appears at x2, y2 if true then send "a" else (there's no color 2) send "v" same is performed for "o" and "t" (but with another coordinates) at the same time I've found this little script but it seems that I did something wrong or it's just broken. While 1 $a = PixelSearch( 428, 428, 622, 622, 0xe8e7e7 ) $v = PixelSearch( 563, 563, 772, 772, 0x660000 ) if $a = true then send("a") endif if $v = true then send("v") endif WEnd Can somebody help me with this? P.S. Sorry for my english, I know I'm terrible. Link to comment Share on other sites More sharing options...
FireFox Posted March 12, 2013 Share Posted March 12, 2013 Hi Welcome to the autoit forum What do you need this script for ? Link to comment Share on other sites More sharing options...
futahito Posted March 12, 2013 Author Share Posted March 12, 2013 (edited) HiWelcome to the autoit forum What do you need this script for ?Hi ThanksUmmm I don't sure how this is translated to english correctly. "Университетский проект для автоматизации геоинформационных систем" Edited March 12, 2013 by futahito Link to comment Share on other sites More sharing options...
FireFox Posted March 12, 2013 Share Posted March 12, 2013 Let's say you're not lying. When you don't know how a function works, read the help file for this last. You will learn that the PixelSearch function returns an array if the color is found. $a = PixelSearch(... If IsArray($a) Then ;found ... Br, FireFox. Link to comment Share on other sites More sharing options...
futahito Posted March 12, 2013 Author Share Posted March 12, 2013 Let's say you're not lying. When you don't know how a function works, read the help file for this last. You will learn that the PixelSearch function returns an array if the color is found. $a = PixelSearch(... If IsArray($a) Then ;found ... Br, FireFox. x) Are there a lot of newcomers-liars on this forum? -_ how did I missed that? I'm stupid... So, basically, array $a is created when pixel is found, but will it work after one "found" operation? After first check array will be present in all next checks, would it? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 12, 2013 Moderators Share Posted March 12, 2013 futahito,x) Are there a lot of newcomers-liars on this forum?Unfortunately, when they ask about PixelSearch the answer is often: Yes. Each call to PixelSearch returns an array - you would need to check it each it each time. Do you realise there are better ways of automating GUIs that searching for pixels? Have you tried any of them? Why not post a screenshot of the GUI you are trying to automate with some explanation of what exactly you are trying to do so that we can see if we can get you on a better path. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
futahito Posted March 12, 2013 Author Share Posted March 12, 2013 (edited) futahito,Unfortunately, when they ask about PixelSearch the answer is often: Yes. Each call to PixelSearch returns an array - you would need to check it each it each time. Do you realise there are better ways of automating GUIs that searching for pixels? Have you tried any of them? Why not post a screenshot of the GUI you are trying to automate with some explanation of what exactly you are trying to do so that we can see if we can get you on a better path. M23Oh, of course. I want to use it with GIS to make automatic notificathion, when certain map area combinations are present on the working space of program, while program is constantly updating.We were studying Pascal but there's no function of tracking pixel colors. Edited March 12, 2013 by futahito Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 12, 2013 Moderators Share Posted March 12, 2013 futahito,certain map area combinations are presentAnd how do you determine this? Which pixels are you currently checking? Is there anything else on the GUI (preferably in a fixed location if those pixels are not) that could act as a trigger ? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jchd Posted March 12, 2013 Share Posted March 12, 2013 Simple question: is there any chance the GIS you are using is based on Spatialite? If it is, maybe you can find a better way by querying the SQLite database the GIS is based on. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
futahito Posted March 12, 2013 Author Share Posted March 12, 2013 futahito,And how do you determine this? Which pixels are you currently checking? Is there anything else on the GUI (preferably in a fixed location if those pixels are not) that could act as a trigger ? M23Umm I don't clearly understand what you are asking. I want Autoit to check changes certain spots of the map, if you're asking about this. Simple question: is there any chance the GIS you are using is based on Spatialite? If it is, maybe you can find a better way by querying the SQLite database the GIS is based on.I should ask my teacher, he gave me it. Actually, working with SQL db will be easier, i think. Thanks for advice^_^ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 12, 2013 Moderators Share Posted March 12, 2013 futahito,I want Autoit to check changes certain spots of the mapI guessed that much from your original question. I was asking if anything else on the GUI changed when the condiditons for which you are looking exist as it might be easier to detect that rather then looking for pixels on the map itself. But if there are none, we will have to deal with the map. Please explain exactly what it is you are looking for on that map. Where are these specific pixels that you wish to check? M23P.S. And in future please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - we know what we wrote and it just pads the thread unneccessarily. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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