Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Scriptwise antiban measures

Featured Replies

Hi

 

I just made my first script, I used it for like an hour or two with breaks, next day it was banned.

I wanted to ask what are the most obvious things I screwed up in the script.

For context, the account was created ~ 2years ago, it was about 300 total and f2p, I did play manually on it till this point (2 years ago) It was fishing trouts in lumbridge. I used built in breaks ~ 15-50 min of botting with 5-20 min breaks.

Used stealth client, on mac with java17 in case it makes any difference 😉

My thoughts are that I probably should avoid some parts of api, and somehow implement my own mouse movement patterns, but dunno whether it is valid ideas.

Let's ignore the code quality I am not java dev ;-;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Condition;
import org.osbot.rs07.utility.ConditionalSleep;

import java.util.Arrays;
import java.util.stream.IntStream;


@ScriptManifest(author = "Nzb", info = "Lumbridge trout fisher", logo = "", name = "Lumbridge Fisher", version = 1)
public class Fisher extends Script {
    static final String[] SUPPORTED_FISHES = {"Raw trout", "Raw salmon"};
    private final Area fishArea = new Area(3238, 3255, 3242, 3235);


    @Override
    public void onStart() throws InterruptedException {
        checkPreconditions();
        setUpInventory();
        log(getInventory().getSlotBoundingBox(0));

    }

    @Override
    public int onLoop() throws InterruptedException {

        if (!fishArea.contains(myPlayer())) {
            walkToFishingSpot();
        } else {
            fishTrouts();
        }
        return 0;
    }

    private void walkToFishingSpot() {
        if (getWalking().webWalk(fishArea)) {
            new ConditionalSleep(random(1542, 2534), random(5129, 7412)) {
                @Override
                public boolean condition() {
                    return fishArea.contains(myPlayer());
                }

            }.sleep();
        }
    }

    private void fishTrouts() throws InterruptedException {
        if (getInventory().isFull()) {
            sleep(random(500, 6000));
            dropFish();
        }
        if (!myPlayer().isAnimating()) {
            NPC fishingSpot = getNpcs().closest("Rod Fishing Spot");
            fishingSpot.interact("lure");
            getMouse().moveOutsideScreen();
            sleep(random(2421, 6521));
        }


    }

    private void dropFish() throws InterruptedException {
        int[] slotsWithFish = IntStream.rangeClosed(0, 25).toArray();
        if (getSettings().isShiftDropActive()) getKeyboard().pressKey(16);
        for (int slotId : slotsWithFish) {
            log(slotId);
            Item item = getInventory().getItemInSlot(slotId);
            if (item != null) {
                log(item.getName());
                if (Arrays.asList(SUPPORTED_FISHES).contains(item.getName())) {
                    if (getSettings().isShiftDropActive()) {
                        item.interact();
                    }

                }
                sleep(random(1052, 1370));
            }
        }
        if (getSettings().isShiftDropActive()) getKeyboard().releaseKey(16);

    }

    private void checkPreconditions() {
        if (!getInventory().containsAll("Feather", "Fly fishing rod")) {
            stop();
        }
    }

    private void setUpInventory() {
        int featherPosition = getInventory().getSlot("Feather");
        int rodPosition = getInventory().getSlot("Fly fishing rod");

        if (featherPosition != 26 & rodPosition != 27) {
            moveItemInSlot(featherPosition, 26);
            moveItemInSlot(rodPosition, 27);
        }
    }

    private void moveItemInSlot(int startSlot, final int endSlot) {
        if (getInventory().isItemSelected()) {
            getInventory().deselectItem();
        }
        getMouse().continualClick(getInventory().getMouseDestination(startSlot), new Condition() {
            @Override
            public boolean evaluate() {
                getMouse().move(getInventory().getMouseDestination(endSlot), true);
                return getInventory().getMouseDestination(endSlot).getBoundingBox().contains(getMouse().getPosition());
            }
        });
    }


}

 

Edited by nzb96

In my experience, if you're botting any common activity in f2p expect a ban. 

  • Author

Ok, thanks guys - btw are there any guidelines of what not to do in scripts? From what you all wrote it seems like if you get flagged for "macroing scan" you are doomed, is that correct?

Best script antiban is creating a script with 0 code in it. 

"Antiban" has not been shown to do anything. Jagex uses a flag system to monitor and ban accounts.

If you were botting yesterday, you might've got caught in the w400 bot busting event.

For a fishing script I do the following. 
I generate a gaussian mean and std dev at script start. 


- AFK when fishing (mouse offscreen) + AFK afterwards for a gaussian random amount of time.

- Drop fish even if inventory is nearly full after afking

- Random shift click drop orders (ex: snake left/right, snake up down, ect...)

F2p is just high ban rate. Pretty sure there are tons of false positives too. 

Edited by yfoo

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.