Jump to content
Sign in to follow this  
SABATG

Help fixing script made by someone else

Recommended Posts

SABATG

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.

Share this post


Link to post
Share on other sites
Melba23

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Venix

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 by Venix

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×