Jump to content

How do I manipulate strings in Autoit?

Recommended Posts

I'm trying to distinguish between two colors (a silvery color and a redish color) that are on a gradient (i can't have an exact color code, just a range). The problem is the decimal code is within the same range (1.3-1.5 mil for both).

I was thinking to distinguish them I could Hex the color code and then isolate the two hex characters for red (00AABBCC -- the AA would be for red) and then compare them together.

However, I don't know how to do string manipulations on autoit. Is there a way to turn the hex code 00AABBCC to a string and then run a function that returns the 3rd and 4th character?

Then I can convert the letters to their values (ie: F = 15 or 16 or whatever it is, etc) and do a simple comparison.

I'm sure autoit can do this since it seems to be able to do everything and anything. Can anyone direct me to the functions that would help me?

Link to comment
Share on other sites

You probably need to convert individual RGB components into integers, then follow hints from that post to determine where that pixel lies in the color cube.

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 here
RegExp tutorial: enough to get started
PCRE 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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...