Can AHK be detected?
I mainly use pixelgetcolor from the window its played in (ifwinactive)
I also use tooltips to let me know if the scripts are active
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.
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 !!
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
I'm still fairly new to ahk
But that code looks good, would I just add it in near the start of my script?
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!
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 !!
I wasn't able to check up on this thread like I'd wanted to.
@ None...I love that NormalRand ;p
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 !!
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 !!