Making LAURA read - Pushing the limits of game botting

in #science7 years ago
My fascination for scripting and AI started as I was a teenager. I discovered macros and found out that "bots" could be much better than that. I found out that... A series of nested loops with variables and strings of data cycling through defined functions and adlibs could outperform many humans specially at repetitive tasks like: playing games.

The usual: Make the computer do the boring part of playing for you while you sleep, come back later to harvest the benefits. Of course, game companies do not like this, they prefer you to pay for booster/premium/whatever packs to be "better" in their platform (at least, for as long as the pack lasts). Game bots arrive into those games to "level the ground", even giving an unfair advantage.

Autopotions, damage calculation and managing (preventing overkills for the sake of efficiency), farming, grinding... It all can be done better by a computer and a few lines of script.

I have made several silly bots for a couple of online games, I jumped right out of the kiddiescripters' gang at a "cheater's community". Then, it became an addiction.

Oh, yes, antihacks are embedded in nearly any game you can imagine. Lucky me, much more skilled than me at OllyDgb provide the much needed bypasses to them, so I may script in peace. This is a cybernetic case of mutualism.

LAURA, my beloved "child"

LAURA is more than just a bot, she is a series of interconnected modules and functions under my personal standards that can adjust to pretty much anything I like with the correct adjustments. She currently "weights" over 80Gb of code, more than half is deprecated but still reserved for updates (When I no longer use a module, I do not discard it: I just move it into a special "reserve" folder to never again later look at it)

She is primarily a chatbot that evolved from a World of Warcraft bot that was in charge of raid party management. Some people would be really mad to know that they were taking orders from, at that moment, a program that did not even use 10Mb of RAM. From "chatting" to "playing" there's little distance in games: Reading variables and react accordingly. The LUA script WoW has helped a LOT in this.
But, I didn't settle for a single game...
More and more MMORPG's were played by LAURA.


Yeah, great, she is a gamebot with a rather enviable AI that allows her to pick her own gamestyle seeking for the most efficient path. I wanted to go further.


Making her "read".

Memory reading is the most usual way to gather data out of a game to interact with it, yet, this requires to find headers and pointers. I wanted LAURA to be more "human". So, I started from the basics: Her chatting functions.
Reading strings of text off the memory is a piece of cake once you find those but... What If I don't want to look for them? Can I make LAURA "read" the screen as we do?
The answer is YES, OCR.
I wanted to develop my own, primitive OCR... Having no idea on how one works!!!

And now, I'll show you my steps.



The hateful chatbox, with an uneven background color and stupidly simple font... I'm sure LAURA can outsmart that! For this, I apply a method that "we" use to "read" (at least, as we are children).
Letters are nothing but shapes, we do recognize them from others basically because of that only property. White font, a simple thing to aim the artillery to.

If we take the top left corner and "read" the pixels as we would read text we would get a mess of mixed data that can be misinterpreted later, assigning 1 to "white" and 0 to "anythingelsethatisnotwhite" the first line of the 1st two characters would become 01110001. That last "1" can be anything, an I an i and L... whatever (yes, reading multiple lines and processing the whole thing "would" differentiate one character from another one, but it can be troublesome to parse in a function).

I needed that LAURA recognized EACH character in singular, to later merge them into words and create the string of text needed for input.

Reading from top left to bottom left, and them moving pixel by pixel to the right what Laura would read would become:


This looks much better!

0110010
1001001
1001001
1001001
0100110
= S
Is that a series of seven "0" I see there? That is a "character separator"!!!
0010000
1111111
0010001
= t
The linebreaks look awful, taking the 0000000 as separator we can convert the binary data into nice strings where:
01100101001001100100110010010100110 = S
001000011111110010001= t


Oh, yes, LAURA has a primitive OCR added to her toolbox now!!! All I need to find now is a method of "packing" those strings of 0s and 1s into symbols that would be equal even when a font changes (Otherwise, I'd have to setup a list of variables for each single font that exists and that will be invented). -Math lovers, HELP ME!-

The thing is, now people will NEVER know if when they chat to me it is me that replies or "my assistant" ;)

Sort:  

This post has received a 1.12 % upvote from @booster thanks to: @renzoarg.

Loading...

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63740.26
ETH 2618.46
USDT 1.00
SBD 2.79