Jump to content
Sign in to follow this  
IceKontroI

Pattern Breaking and Account Preference

Recommended Posts

Hello, everyone. Recently I've been interested in how Jagex's pattern detection works. I ran a simple easily detected script which opens the GE, buys 1 lobster at 100 GP, waits 30 seconds, then cancels the offer and closes the GE on a loop with tribot's AI antiban turned off. After a few minutes of runtime some abnormal things started happening. Most commonly my input to the game was blocked, meaning I could move my mouse around, but the game server never accepted my input, and as a result my account's actions had no effect on the game world. I've been able to semi-reliably recreate this scenario multiple times on different accounts and IP addresses. It's worth noting that players and NPCs continue their normal action while my account's been frozen, which also indicates no connection errors. The input blockage happens fairly often to the point that it's very unlikely it has anything to do with my network connection or Jagex servers. I believe this is Jagex's first line of defense against bots (or at least one of them).

  • Real players will typically try to perform various actions in-game like arranging inventory, clicking on random tiles or objects, world hopping, and even restarting the client.
  • Bots may repeatedly click the same action (big red flag) or do nothing (moderate red flag)

I have no doubt that botters/scripters with more experience than me have noticed this, but this is not a thread about Jagex input blocking, it's about preventing it from happening through pattern breaking.

Pattern breaking is centered around the imperfections and variability of the human mind and judgment. Regular player activity does form patterns to some degree, but typically it isn't as pronounced as those of bots. There are two categories of pattern breaking:

  • Large scale
    • More useful for public scripts or large farms
    • Focuses on creating differences between accounts through account preference
      • Different methods of performing tasks
      • Different subsets of antibans per account
        • Each account may be only able to use 7 out of 12 generic antibans available for the script
        • This increases the longevity of the script by allowing less opportunities for Jagex to group accounts via similar actions
      • Different frequencies of antibans per account
        • Account A may perform one antiban more frequently than account B
      • Changes in sleep and delay times per account
      • Accounts all have different run times
        • This is mainly for farm detection, not for public scripts
      • Different accounts running the script in different worlds/locations if possible
      • Unique break patterns per account
      • Different muling cycles
  • Small scale
    • Focuses on preventing accounts from producing patterns through their actions
      • Changes the order of sub-actions within a larger action when order does not matter
      • More useful when incorporated as part of a complex script process
      • Avoid hardcoding script processes as first A, then B, finally C
        • Instead use fluid condition checks to see what action should be performed
        • Then use account preference and probability to determine which of several actions it prefers over the others
        • Action[] actions = getActions(situation); // This should perform action condition checks and return only relevant actions
          
          boolean performed = false;
          
          for (action : actions) {
          	if (accountPrefers(action) && accountProbability(action)) {
          		performed = performAction(action);
          		if (performed) {
          			break;
          		}
          	}
          }
          
          if (!performed) {
          	performAction(action[General.random(0, action.length)];
          }

          While this may seem excessive, this is how players decide what to do next in a sequence of events

    • Antiban is a large part of pattern breaking
      • Performing actions you don't usually do is an effective way to break patterns
      • Misclicking can be seen as a form of antiban as it's infrequent but deviates from your normal activity
    • Avoid randomization
      • Randomizing everything from antibans to sub-actions within a larger action schedule may seem like an appealing idea
      • While it's likely to work to some degree, it will make accounts on the large scale appear too similar to each other
      • We're trying to get our accounts to operate in the grey area between a well defined pattern and no pattern at all
      • If all accounts operate in this grey area their patterns will be loosely defined but dissimilar from each other

The idea of pattern breaking shows promise, however it has many requirements. One of which is account preference which is something Tribot has some support for, but this support is limited. For example a scripter has no way of applying Tribot preference to custom made functions. The solution is to make your own preference system where the account's username and a seed value is used to derive a value from 0 to 100. Below is my own way of doing so:

    /**
     * Performs a probability check on the input value. Input a percentage (0 - 100).
     */ public boolean chance(double chance) {

        return General.random(0, 100) <= chance;
    }
                                               
    /**
     * Scales a value based on its original range so that its position in that range is in the same position in the new range.
     */ public double normalizeValue(double value, double oldMin, double oldMax, double newMin, double newMax) {

        double percentage = (value - oldMin) / (oldMax - oldMin);

        return newMin + percentage * (newMax - newMin);
    }
    
    /**
     * Generates a username based preference value for the given seed (0 - 100).
     */ public double preference(double seed) {

         try {

             String hash = Double.toString(Player.getRSPlayer().getName().hashCode() * Math.sqrt(seed)).replaceAll("[^\\d.]", "").replaceAll("\\.", "");

             String int1 = Character.toString(hash.charAt(hash.length() - 1));
             String int2 = Character.toString(hash.charAt(hash.length() - 2));
             String int3 = Character.toString(hash.charAt(hash.length() - 3));

             return normalizeValue(Double.parseDouble(int1 + int2 + "." + int3), 0, 99, 0, 100);

         } catch (NullPointerException e) {return 50.0;}
    }

    /**
     * Generates a username based preference value for the given seed, but normalized to match the provided range.
     */ public double preference(double seed, double min, double max) {

        return normalizeValue(preference(seed), 0, 100, min, max);
    }

    /**
     * Performs a probability check on a preference value normalized to match the given range.
     */ public boolean preferenceChance(double seed, double min, double max) {

        return chance(preference(seed, min, max));
    }

Hopefully I've included all the necessary functions for the above to work. If you for example wanted to test an account's preference for performing Action A over Action B, you could take the hashcode of each actions, remove all non-integer characters from each, input them into the functions above, and receive a preference for each. I recommend using custom ranges like preference(100, 15, 85), where 100 is the seed, 15 is the min chance, and 85 is the max chance. That way the preference range will always be within 15% and 85% and you won't ALWAYS or NEVER perform that action above other actions. It should also be mentioned that you shouldn't be using these preferences to determine which actions to do, only to determine which actions should be performed above other actions. All actions should be performed as long as they're part of your script.

This post ended up being much longer than I originally wanted but it's good to get your thoughts out in writing so I'm glad I spent the time. Going forward I would appreciate a healthy discussion, please add to the thread with your comments rather than just taking up space with pointless nay saying.

Edited by IceKontroI
  • Like 3
  • Thanks 5

Share this post


Link to post
Share on other sites
3 hours ago, Encoded said:

I've never had input blocked.

Your "pattern breaking" is ABC2.
Of course they aren't the same, but the general concept is the same.

I never noticed it until I started looking for it which was recently, but you can semi-reliably make it happen like I stated at the beginning. 

Yes, ABC2 does use this, but doesn't allow a scripter to apply it to custom methods. A scripter can add in multiple ways of doing a process and prioritize those ways across different accounts by using the functions I've provided at the end. I'm really just publicly advocating variety in activity both from a single account perspective and across multiple accounts. This could be used to improve the longevity of both the account and script.

Edited by IceKontroI
  • Like 2

Share this post


Link to post
Share on other sites

idea sounds great.. i think the biggest issue i see is i can easily tell bots using the same script because some functions they all act exactly the same.
though when selecting anti ban options they should become a saved set, with say there being 12 options but of those 12 there are 5 more sub options of pattern and the chosen patterns will be saved with the account info so they're always performing the same kind of options because no human acts alike and they usually perform the same way every day some may do things a little slower than others like clicking precision or mouse movement always being within a range of pace.

Share this post


Link to post
Share on other sites
On 10/28/2017 at 10:31 PM, Crystal Elite said:

I think the point IceKontrol made is the ideal script creates actions that are separate and distinct, but not bot-like.

And he's suggesting "preferences" in order to accomplish this goal, so that each bot can have its own habits and operate within them. Is this the case? Feel free to reply.

Yeah, basically that. I went into a lot of detail but the idea boils down to what you said. For any action that can be performed more than one way, each account should have its own "preference" for which variant method to use. When I say preference I mean 75% of the time they may do it the preferred way, and the remaining times it's a selection of the remaining possibilities.

Edited by IceKontroI

Share this post


Link to post
Share on other sites

I know I'm a bit late to this, but ABC antiban can be extended/replaced. It's my current project.

Just do "class x extends ABCUtil". Let's you override the methods that you don't think are right, and possibly deprecate them if you don't think they are useful.

You can also add new functionality. 

 

Adding new antiban must be taken with care. It must be something that humans definitely do. You must implement with the same timing as humans. You must also implement it with the same distribution frequency.

If any of those above conditions aren't met, you could very easily end up giving Jagex another heuristic factor for detecting bots. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×