Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Can AHK be detected?


  • Please log in to reply
13 replies to this topic
Bred
  • Members
  • 48 posts
  • Last active: Jun 21 2012 10:22 PM
  • Joined: 21 Jun 2012
The game I play deletes botters often and I made a few healing scripts and so on and was wondering if they could detect that?

I mainly use pixelgetcolor from the window its played in (ifwinactive)

I also use tooltips to let me know if the scripts are active

girlgamer
  • Moderators
  • 3263 posts
  • Last active: Feb 01 2015 09:49 AM
  • Joined: 04 Jun 2010
Depends on what game you're playing and the anti-cheat software that's embedded in that game. Usually no. sometimes yes.

The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter   KeyLooperDemo   Key Spammer   TinyClickRecorder  GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
Rock-on%20kitten.gif


G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011
Adding to what Girlgamer said, it also depends on what you do to hide your script.

Do keep in mind that AutoHotkey (AFAIK) doesn't have hiding routines of it's own (developers never cared about it because AHK is not specifically aimed at bot creation).

Merely executing a *.ahk script will create a process named AutoHotkey.exe (unless you changed the name of the AutoHotkey executable). So, if a given game is monitoring the active processes in your computer, it may very well have a conditional flagging "AutoHotkey.exe" as bot suspicious since it is capable of making bots and is a pretty well known application.

There are some ways to change the process name however: either compile the script or rename the autohotkey.exe file.

But that was just an example to ilustrate how a bot-checking routine may work and how you can "try and hide" a botting script based on possible bot-checking routines. Do keep in mind that developers of anti-bot software usually have additional (and more clever) ways to detect botting and you can only counter them if you can find out how they work.

Best wishes :wink:

"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!


xxmarkxx
  • Members
  • 76 posts
  • Last active: Oct 12 2014 11:23 PM
  • Joined: 02 Oct 2009
I'd also like to add this bit of advice. I don't know how your script works or what it actually does but think random. The human hand does not move a mouse from point a to point b in a straight line. It would take one gifted player to move his cursor instantly from one pixel to another with dead on accuracy and in a time-frame that never changes. And no player clicks an image in the same location (let alone same pixel) every time. This can be detected. Build randomness into your scripts when ever possible or at least practical. Randomize not only coordinates but timing as well.

Rino
  • Members
  • 250 posts
  • Last active: Dec 18 2015 05:09 PM
  • Joined: 12 Apr 2012
With your randomizing of pixels and sleep time an example would be
Random, randsleep, 500, 2500 ;500 is half a second, 2500 is 2 1/2 seconds 1 second= 1000. 
Random, randomx, (range low), (range high) ; this lets you grab different pixels for the x coordinate
random, randomy, (range low), (range high) ; this lets you grab a different pixel for the y coordinate
sleep, %randsleep% ; humans get distracted by things this is to be more believeable obviously 2 1/2 seconds won't always fly for a ;duration
mousemove, %randomx%,%randomy%, delayhere ;I don't know what sort of a delay would be believeable but moves your move ;where you want without being the same spot each time if you change randomx and randomy be sure to update this


Bred
  • Members
  • 48 posts
  • Last active: Jun 21 2012 10:22 PM
  • Joined: 21 Jun 2012
When you say randomx/y lets you grab different pixels for coordinate, I'm not sure exactly how to work that?
I'm still fairly new to ahk :p

But that code looks good, would I just add it in near the start of my script?

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011

But that code looks good, would I just add it in near the start of my script?


Nope. It was an example, so you have to study it, understand the concepts involved and apply them accordingly
in a new routine.

When you say randomx/y lets you grab different pixels for coordinate, I'm not sure exactly how to work that?


All right. But before we talk about how to correctly syntax the Random command, Let's discuss more in-depth how this
whole "random" idea comes into play in botting softwares. And let's just say you whant a simple script to click on a "healing button" over and over again...

Perhaps you already know that you can isolate the coordinates of a single pixel (XY addresses on the screen; X for horizontal, Y for Vertical) that you know will always belong to the image of the button when the clicking routine is to be executed, and then merely set the script to click at those coordinates.

click, 235, 438

So the code above will work if 235,438 is any XY-coordinates of a pixel belonging to this button. The action of clicking the healing button should than have been correctly automatized in as much as a handfull of code lines right :?:

Right! But if there is an anti-bot software in play, the action could get flagged as being performed by a bot quite easily if repeated over and over again.

And why :?:

:arrow: Because many anti-bot softwares are well aware that scripting a bot to click on the same spot of an image is quite easy. And they are also aware that a human being moving a mouse cursor and clicking on a button will usually NOT hit the exact same pixel of the image all the time. So they can easily rule that any player clicking the exact same pixel of the button over and over again is a botter!

Than Oh my! botters are done for! :O

Not really... think about it first: botters can still make their bot pass that test... if they implement clicks on varying coordinates, always clicking in the same healing button (to have the action performed), but not in the same pixel right?

Indeed! 8-)

And how can an author implement something like that on AutoHotkey :?:

:arrow: You should know that if humans are usually unable to click at an exact pixel all the time comfortably, this "healing button" is obviously NOT 1-pixel-wide-only on a game that is meant to entertain humans.

So clicking in a coordinate that is 1 pixel away from your choosen coordinate should activate the button just aswell (provided that you have not choosen the coordinates of a pixel belonging to the border of the button). The same usually happens untill you reach the borders of the image of the button. So all a botter has to have it's script do, is to isolate the leftmost, uppermost, lowermost and rightmost pixels of an image and than set the routine to click on random coordinates that are always between these values!

And how can AutoHotkey allow something like this :?:

Simple!

:arrow: AutoHotkey can do that by the means of a built-in command called "Random" that allows the script to generate a random number based on a min/max value and store that number in a variable. So if you have the image of the button between pixel X-coordinates (horizontal coordinates) 1000 and 1200 of the screen, you can use random to get an X-address varying between 1000 and 1200, and than perform the click on that X-address. The same can be set to have the script choose a random Y-address (a random vertical address) that fits between the lowermost and the uppermost pixels of the image. The final output is an address that can be used as a parameter of the click routine to always click the same button, but not on the same pixel coordinates!

Cleverly simple huh? 8-)

But let's discuss another problem here. If the anti-bot software is even more clever that we originally thought, it could still flag a botter despite of being this cautious...

:shock: How?

:arrow: The time between mouse clicks can also be tracked. And again, it is quite easy to create a routine that executes the clicks at every 3 seconds. But once again too, humans usually DO NOT click something at every exact 3 second intervals. So If an anti-bot software perceives any user sending click commands on exact 3-second intervals, it may also flag that user as a botter quite quickly. This is where Random comes into play again: the intervals of the clicks must be random, so you can (in example) script the click command to operate in between 1-10 second intervals by the means of setting the interval times with Random command.

But of course, anti-bot software can still be much smarter. No human will click at 1-10 second intervals FOR 20 WHOLE HOURS.

Hmm... If that is true, you are probably thinking by now: Oh well... We have to randomize that too! :)

True... but wait a second... if you have understood that, perhaps discussing this is no longer necessary.

You already know how and why to randomize a single routine, and so, at this moment, this is no longer going to be my point. Let's just hurry the explanations to a general idea :wink:

:arrow: We cannot be sure as to whether the anti-bot software is well prepared to realise someone has been clicking on 1-10 second intervals for 20 whole hours, as much as cannot be sure that it even cares about the timing of the clicks or the even the coordinates. But if it does, we will have to resort to implement randomness, wich always a shot in the dark unless you know how the anti-bot software operates. But in a big game such as a maintream MMO, if you ever hear about an anti-bot software in play, you can quite easily expect a big ammount of checks on the actions of the user, looking to point out whether they are human-like or not. And that is why the most succesfull MMO bots are usually thousands of lines long and are updated all the time.

Random command syntax:

Random, OutputVar [, Min, Max]


The first word should always be "Random". It is the name of the command. The second (separated by a comma) is the name of a variable that should hold the output randomized number. The third word (also separated by a comma) rules a number that can never be bigger than the output randomized number. If 10 is there, OutPutVar can never be set hold less than 10 by the command. This word is optional. The fourt (also separated by a comma, and also optional) word should rule a number that can never be less than the output randomized number. If the fourth parameter is 15, the OutPutVar will never contain any number bigger than 15. If these two last parameters are omitted, the command will have no minimum or maximum output: It will output any number!

So something like:

Random, Var1, 20, 30

Will set a random number between 20 and 30 into Var1.

Best wishes :wink:

"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!


None
  • Members
  • 3199 posts
  • Last active: Nov 05 2015 09:55 PM
  • Joined: 28 Nov 2009
Speaking of Random Humans also don't click on a button in a random manner. Most human actions have a normal distribution where you are more likely to click in the center of a button than at the edge. Smarter anti-bot software could detect a pattern that is too Random. You may want to use a normalized random number function like the one I posted here NormalRand.

xxmarkxx
  • Members
  • 76 posts
  • Last active: Oct 12 2014 11:23 PM
  • Joined: 02 Oct 2009
Thank you for that amazing comment G. Sperotto.
I wasn't able to check up on this thread like I'd wanted to.

@ None...I love that NormalRand ;p

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011

Speaking of Random Humans also don't click on a button in a random manner. Most human actions have a normal distribution where you are more likely to click in the center of a button than at the edge. Smarter anti-bot software could detect a pattern that is too Random. You may want to use a normalized random number function like the one I posted here NormalRand.


Yea, i was refraining from going that deep into the discussion. But thanks for pointing that out and specially for the link, the function will be quite handy in the future :)

"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!


Bred
  • Members
  • 48 posts
  • Last active: Jun 21 2012 10:22 PM
  • Joined: 21 Jun 2012
Wow thanks
I got a lot to work with now :)

Bred
  • Members
  • 48 posts
  • Last active: Jun 21 2012 10:22 PM
  • Joined: 21 Jun 2012
Also this is offtopic from the original question but I just found out that this games client is made in C++, would it be best/easiest to make the bot in the same coding? Or does that not matter?

G. Sperotto
  • Members
  • 539 posts
  • Last active: Jun 20 2015 04:54 PM
  • Joined: 12 Dec 2011

would it be best/easiest to make the bot in the same coding? Or does that not matter?


It doesn't matter. A source may be written in C++ or any other language, but the compiling process reworks the source to machine code so your computer can actually run it.

"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!


TakeNoPrisoners
  • Guests
  • Last active:
  • Joined: --
See here's the thing about bots. Some games are fanatical about banning them. Some games actually welcome them, and some just don't much care as long as the game balance is preserved. The trick to botting is to [*:3fdbz45g]Don't bot during peak hours or on heavily populated servers. Someone's going to notice and report you.[*:3fdbz45g]Keep your bot focused on a single task like grinding coin or weaps. Automated but flexible fight sequencing. Or crafting. Make separate bots for different parts of the game.[*:3fdbz45g]Use stand-in-place bots with the ability to interrupt the bot at any point to respond to unexpected in game events. Bots that track from place to place often get hung up on in-game objects like trees, rocks, and other obstacles and then you're just looking really "botty". Manually move your bot from place to place. [*:3fdbz45g]Don't run your bot unattended or overnight or while you're away from the computer. Repetitive in-game actions are a dead giveaway.[*:3fdbz45g]Always provide your loops with a way to exit in case someone talks to you or someone is nearby watching you. This way you can provide a "personal" response to any in game chat or unexpected "teleport". Try to limit botting to like at most an hour at a time with a break in between. Long periods spent in a single area killing the same monsters over and over is going to get you noticed.[*:3fdbz45g] intersperse your kill bot with a quest bot or a crafter bot. Variation in activity shows human involvement if anyone is watching.The thing to take away from all this is that the word "bot" means different things to different people. A grinder type game gets really old if you can't offload some of the boring stuff to an automated grinder script. A game that has a repetitive crafting style gets way boring if you can't hand some of the grunt work off to an automated sequence. Is a semi-autonomous controller a bot? Is it botting if you're actually at the computer but you hit one key for an entire fight sequence instead of several dozen keys again and again and again? Some people would say yes and some would say no. If you use automation to gain an advantage over other players in a pvp game you are likely to get banned real fast but if you use automation to pick up dropped loot after a fight then that is stuff you actually earned. You just offloaded some of the work the game normally requires. Safe, sane and Sensible are the big 3 when automating game routines. Greedy botting will get you noticed every time.