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.

Preview of my noob-friendly API

Featured Replies

I'm working on an extremely high-level API that sits on top of the OSBot API, makes it a bit more beginner friendly and adds plenty of shortcuts.

 

Here's how a simple pickpocketer looks like (works flawlessly):

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.ScriptManifest;

/**
 * Created by Bjorn on 21/07/2015.
 */

@ScriptManifest(author = "Botre", info = "", logo = "", name = "PPS", version = 0.0)

public class PickpocketScript extends BasicScript {

    private EntityDefinition definition = 
            new EntityDefinition(this)
                    .name("Man")
                    .action("Pickpocket")
                    .reachable();

    private Target<NPC> target = new Target<>(definition, Searcher.closest(this, definition));

    @Override
    public void loop() {
        if(target.valid() || target.find()){
            target.get().interact("Pickpocket");
        }
    }

}

Nice dude! I had a similar idea where I was going to create my own scripting language for my scripts for presets, the following would be something that thieved from a guard:

walkto varrock
tag GUARD "Guard" NPC_TYPE
interact GUARD "Pickpocket"

My API would handle it flawlessly, with built in variables (varrock being varrock square for example), and the script would handle when to stop and restart etc.

 

Good luck :D

Nice stuff man, keep it up.

  private EntityDefinition definition = 
            new EntityDefinition(this)
                    .name("Man")
                    .action("Pickpocket")
                    .reachable(); 

Is this supposed to be more clear than using a constructor?

  • Author
  private EntityDefinition definition = 
            new EntityDefinition(this)
                    .name("Man")
                    .action("Pickpocket")
                    .reachable(); 

Is this supposed to be more clear than using a constructor?

 

new EntityDefinition(this 
.name("Man") 
.action("Pickpocket") 
.reachable());

vs

new EntityDefinition(
this,
"Man",
"Pickpocket",
true);

1 constructor

0 ambiguity

100% modular

100% extendable

 

So... yes? doge.png

 

On top of that, the class is wrapped around a predicate: the ability to add properties in the sequence you want makes tactical logical shortcutting a piece of pie among other cool things.

 

Source: 

public class EntityDefinition<T extends Entity> implements Predicate<T> {

    private Predicate<T> predicate;

    private MethodProvider mp;

    public EntityDefinition(MethodProvider mp) {
        this.mp = mp;
        predicate = o -> o != null && o.exists();
    }

    public EntityDefinition name(String name) {
        predicate = predicate.and(o -> o.getName().equals(name));
        return this;
    }

    public EntityDefinition action(String action) {
        predicate = predicate.and(o -> o.hasAction(action));
        return this;
    }

    public EntityDefinition reachable() {
        predicate = predicate.and(o -> mp.getMap().canReach(o.getPosition()));
        return this;
    }

    @Override
    public boolean test(T t) {
        return predicate.test(t);
    }
    
} 

Edited by Botre

new EntityDefinition(this 
.name("Man") 
.action("Pickpocket") 
.reachable());

vs

new EntityDefinition(
this,
"Man",
"Pickpocket",
true);

1 constructor

0 ambiguity

100% modular

100% extendable

 

So... yes? doge.png

 

On top of that, the class is wrapped around a predicate: the ability to add properties in the sequence you want makes tactical logical shortcutting a piece of pie among other cool things.

 

Source: 

public class EntityDefinition<T extends Entity> implements Predicate<T> {

    private Predicate<T> predicate;

    private MethodProvider mp;

    public EntityDefinition(MethodProvider mp) {
        this.mp = mp;
        predicate = o -> o != null && o.exists();
    }

    public EntityDefinition name(String name) {
        predicate = predicate.and(o -> o.getName().equals(name));
        return this;
    }

    public EntityDefinition action(String action) {
        predicate = predicate.and(o -> o.hasAction(action));
        return this;
    }

    public EntityDefinition reachable() {
        predicate = predicate.and(o -> mp.getMap().canReach(o.getPosition()));
        return this;
    }

    @Override
    public boolean test(T t) {
        return predicate.test(t);
    }
    
} 

 

That's actually really good use of Predicate, props to you! :doge:

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.