The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

Developing Bot

Started by Antidote · Dec 5, 2014

1,033 replies21,297,466 viewsLocked
Dec 22, 2014#221

I think I know where the mistake is. Can you look through the code for this line:

If getDarkElixir($x_default+1, $y_default+58) <> "" &  getDarkElixir($x_default, $y_default+57) <> "" Then

change & to OR

If getDarkElixir($x_default+1, $y_default+58) <> "" Or  getDarkElixir($x_default, $y_default+57) <> "" Then

it's written in Autoit. It's a very simple language to learn, I only had basic C++ lesson since high school but manage to learn it very fast

Dec 22, 2014#222

@frequent AutoIT has its own language, but it is similar to VBScript in my opinion. Also, I too was receiving the same error when searching for bases and I know it is due to the x and y value of the starting pixel being in the wrong place. I'll work on making a small code to automatically finding the correct location for that.

Dec 22, 2014#223

yeah autoit is a very good-natured language!
im gonna screen all types of error messages to check for similarities.
they current attacking type works pretty good for me though always extremly good pickings. since i screenshot every after-fight message i cant ell you that i usually gain over 100k of both gold and elixir as an average value. best was a LOSE with 300.000 gold and 300.000 elixis as profit 😉

Dec 22, 2014#224

@antidote u already fixed the color pick of the attack button that errors with the level 5 wall?
thank for your hard work.
--MDMA

Dec 22, 2014#225

@GkevinOD: I think we'll have to rely on you to work out the pixel as I haven't fully understood your implementation, just merely bruteforcing the correct first pixel lol
@kojometa: I'm having good loots too, if it's just for personal use I'm happy with the current one now xD
i'm thinking how to allow bluestacks to run in background. it would be a killer feature imo

Dec 22, 2014#226

since the bot is not memory-based background work will probably be hard to do.
in the past i already read out the values for gold and elixir with cheatengine but the problem is that you cant find any pointer due to bluestacks.

you would have to root bluestacks and run a program inside of it which is a lot too lavishly!
but im gonna have a look at it since controlclick is more good-natured with that than mouseclick or mousemove

Dec 22, 2014#227

Strange... I have AutoIT installed, I downloaded all 3 files and placed them in the same folder.
I launch the exe and click on "start" it asks me to locate the barracks and that is as far as it goes :S.
use the start button! all other buttons are only for testing purposes!

Dec 22, 2014#228

I got a problem on bot, he's dont recognize the ''popup'' when click train troops
he saw pixels in background only... i have no idea how to fix PixelGetColor, on bot script for he read ''popup'' window on bs...
Can someone give me a hand ? XD

Dec 22, 2014#229

@GkevinOD: You may refer to this GNU organization of steps to register GPL. http://www.gnu.org/licenses/gpl-howto.html
Secondly, I would like to ask how did u obtained the first pixel coordinate of the gold digit. Based on MS paint, the coordinate of the most left and most top of first gold digit is (59,99) from the most left and most top of BlueStack windows

Dec 22, 2014#230

@GkevinOD: You may refer to this GNU organization of steps to register GPL. http://www.gnu.org/licenses/gpl-howto.html
Secondly, I would like to ask how did u obtained the first pixel coordinate of the gold digit. Based on MS paint, the coordinate of the most left and most top of first gold digit is (59,99) from the most left and most top of BlueStack windows

Well, the bot located the position of the window first and using that, I found where the first pixel is relative to the window.
Now the way the bot locates the position of the window is weird, it ignores parts of the window handle and 0,0 of the window would be:

This is not actually the way I did it. I used AutoIT tool and used the Finder Tool and manually placed it in the first pixel which requires some accuracy 🙂
Using the method above is much easier and does not require you to look super close into your computer screen to see the individual pixels

This discussion is closed.