SABATG Posted May 17, 2012 Posted May 17, 2012 We used to have an employee here who built lots of 'scripts' for us to automate some tasks. He is no longer here, and due to changes in some of our programs, some important scripts no longer work. I am not at all familiar with writing code and have no experience with AutoIt. But I would greatly appreciate if someone could help me with this. I believe that the problem comes in when the programs that we used changed the colors for selected options. Originally it was whitish letters highlighted in black. Now it is blue letters highlighted in a aquaish color. I believe that this is the code where is looks for this: If Hex(PixelGetColor(333, 48), 6) <> "000000" Then BlockInput(0) MsgBox(0, "Error", "Your gate does not have the cursor on 'Select'," & @LF & "please correct this and rerun the script.", 5) Exit 0 Can anyone tell me what I need to do to change this? Please explain as simply as possible. Thanks for your help.
Moderators Melba23 Posted May 17, 2012 Moderators Posted May 17, 2012 SABATG,The lines you have posted are looking for the colour "000000" = Black. If the screen colours have changed (which seems to be the case from the rest of your post) you need to change the value for which you are searching.Use the Autoit Window Info tool (C:\Program Files\AutoIt3\Au3Info.exe if you did a standard install), select the "Mouse" tab and drag the "Finder Tool" over the place onscreen you would normally have placed the cursor - you will see the colour of that spot appear in the tool.Replace "000000" in the lines you posted with the value you found, omitting the initial "0x", and see if that does the trick. 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
Venix Posted May 17, 2012 Posted May 17, 2012 (edited) I am not exactly sure what this application is used for but i will try my best to explain it. In the first line the program is grabbing the number value of the colour of the pixel located at the coordinates 333, 48 and then converting this into a 6 digit hexadecimal value. It then checks if this number isn't the same as 000000, if they are not the same then it will enable user input. After it has enabled user input it will display a message and exit. I am not entirely sure if this is the whole code and maybe the problem resides somewhere else within the code but the code will not execute unless the two numbers compared in the first line are not the same. (I may be wrong someone feel free to correct me if i am.) With this small piece of code i am not sure i can help however hopefully explaining things to you might help you understand it a little better. If this is not the full code and you add the rest then ill come back and see if i can help . Oops looks like someone beat me 2 it at least i learnt something in the process. Edited May 17, 2012 by Venix
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