Search the Community
Showing results for tags 'deviation'.
-
This post is mostly intented for scripters I suppose. So anways I just started scripting again after a long break, and thought of the following while making my script: If Jagex can monitor mouse movements, what would be the easiest way to detect bots? For instance take magic; high alching. Thinking about making a script like that I'm sure I would have used sleep(random(min, max)) between mouse clicks until now. Let's take sleep(random(500, 700)) and see what Jagex would see if they're monitoring the time between the clicks for let's say 10k alchs, by using this snippet: int[] numbers = new int[750]; for (int i = 0; i < 10000; i++) { numbers[MethodProvider.random(500, 700) - 1]++; } int i = 0; for (int n : numbers) { if (i++ < 450) { continue; } System.out.println("" + i + ", " + n + ""); } Entering the output in a scatter plot produces the following data visualisation: I'm sure that you would realize that no human could ever hit so perfectly random between 500 and 700, but never go below or past those respectively. So I started digging into this and found out there is a common method which is used for this sort of thing, called standard deviation. It turns out that OSBot already has this in their API at MethodProvider#gRandom, so you can already use this. I had already made my own snippet for it though: public static void main(String[] args) { int[] numbers = new int[750]; for (int i = 0; i < 10000; i++) { numbers[rand(500, 700) - 1]++; } int i = 0; for (int n : numbers) { if (i++ < 450) { continue; } System.out.println("" + i + ", " + n + ""); } } public static int rand(int min, int max) { return rand(min, max, (max - min) / 8); } public static int rand(int min, int max, int deviation) { Random r = new Random(); int avg = min + ((max - min) / 2); int rand; do { double val = r.nextGaussian() * deviation + avg; rand = (int) Math.round(val); } while (rand < min || rand > max); return rand; } Now, running the output data through the same scatter plot produces the following image: Which doesn't drop off to zero without ever hitting one past it. It is important to note that when using this, you might want to make your intervals wider...it is kinda unlikely that you'd be as accurate as the above plot. For example 300, 900 produces this, which is what I think would be a lot more human like: Anyways, you do not always need to use this but I strongly recommend it for scripts that use repetitive clicking and such, because it seems very easy to detect botters from Jagex's side if you use regular sleeps in some cases. Thought I'd share since I had never seen sleep used with such a random distribution before and it may prevent some bans Goodluck & hf :p