Jump to content
Sign in to follow this  

Parsing the results of an _ArraytoClip

Recommended Posts


So this is a newbie question. I have a very limited amount of experience with C++ (a semester in school) and decided to take the plunge into AutoIT. I'm currently working on a bot for Magic Online and have been working on a system to convert the name of a card to one long string of hexadecimal (derived from a loop to determine image checksum values along the name of a card.)

The following is the code for the function I wrote to perform the task of the checksum. Below I'll try to explain the issue.

Func TradeChecksum()

;Checks for changes in pixel checksum values in trade window, and reacts to those changes

$checksumloop = 1

dim $cardchecksum[159]

while $checksumloop = 1

;If player cancels trade, press okay and return to waiting for trade state

$canceldetect = PixelGetColor (418, 257)

$yougivedetect = PixelGetColor (25, 635)

if $canceldetect = 0x594B32 Then

MouseClick ("left", 509, 466)

$checksumloop = 0



;Collects and displays checksum data for the first card in a listview in the "you give" line

if $yougivedetect <> 0x000000 Then

$x = 51

$y = 633

While $x < 210

$tempchecksum = PixelGetColor ($x, $y)

$cardchecksum[$x - 51] = $tempchecksum

$x = $x + 1


;Display contents of array (for testing purposes; this needs to be removed later)



sleep (100)



On that last while loop, I'm basically just creating an array and dumping all of the checksum values for $x and $y associated with every card. If I were in a trade, and someone potentially selected a card, the following is what I see when I paste the contents of the clipboard into notepad.

Posted Image

So basically, I'm looking to see if there's a way to parse out those little high rectangles that are being included in _ArrayToClip command. I appreciate any advice you guys can give me. Thanks for your time!

Share this post

Link to post
Share on other sites

First of all, I use the variable $text in place of the input ofcourse. I guess you allready know this if you read this piece, but maybe this var info is usefull for beginners.

I would first detect what char that is.

Something like:

$ascii_character = Asc(StringMid($text, 1, 1))

Example to show ascii code of 2nd character:

MsgBox(0, "char?", Asc(StringMid($text, 1, 1)))

Then you know the ascii character code for that rectangle.

Then use:

StringReplace($text, Chr($ascii_character), ""); Replaces the content of $ascii_character (which is converted back to the character) with nothing.

To replace the now known character with nothing, thus removing it.

Edit: MsgBox example is wrong 'cause a MsgBox ofcourse won't assign a character to a variable...

Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post

Link to post
Share on other sites

Hey, just wanted to let you guys know my result.

I was able to use your response to figure out the conclusion here. That little high rectangle symbol was a carriage return. Hopefully this will help others if they find this topic.

Thanks for your help, Triblade! ;)

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.