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.

[10 Minute Scripts] Make an AIO Agility Script in 10 Minutes???

Featured Replies

  • Popular Post

I started a new account and needed some agility levels, so I figured I'd record myself making an agility script and post it here. The goal of this is to try and encourage others to learn to script. Apologies for those on tiny monitors, the text will be very difficult to read (I make the font bigger about 2.5 minutes in). Also sorry for pauses and random scene switches, I was trying to figure out how to work the recording software and code and talk at the same time... too many things at once.

Watch at max quality (1440p) if you want to be able to read the code.

 

Source code:

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.util.Arrays;

@ScriptManifest(author = "eliot", info = "", logo = "", version = 1.0, name = "A GOOD SCRIPT")
public class Main extends Script {
    private String[] actions = {"Climb", "Cross", "Balance", "Jump-up", "Jump", "Climb-down"};
    private String[] names = {"Rough wall", "Tightrope", "Narrow wall", "Wall", "Gap", "Crate"};
    Entity previous;

    @Override
    public void onStart() {
        getExperienceTracker().start(Skill.AGILITY);
    }

    @Override
    public int onLoop() throws InterruptedException {
        int starting = getExperienceTracker().getGainedXP(Skill.AGILITY);
        Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) &&
                Arrays.asList(actions).contains(obj.getActions()[0]) &&
                (getMap().canReach(obj) || obj.getName().equals("Crate")) &&
                !obj.equals(previous));

        if (nextObj != null  && !myPlayer().isMoving()) {
            if (nextObj.interact(nextObj.getActions()[0])) {
                new ConditionalSleep(10000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return getExperienceTracker().getGainedXP(Skill.AGILITY) > starting;
                    }
                }.sleep();
            } if (getExperienceTracker().getGainedXP(Skill.AGILITY) > starting) {
                previous = nextObj;
            }
        }
        return 250;
    }
}

 

Edited by Eliot

Beautiful voice, just FYI you don't need the action name if you're using .interact() because it uses the first action in the menu index anyways. 

Why not use a Map with both the object and the action as strings or an Enum?

 

P.S - You have a perfect narrator's voice. <3 

Edited by ProjectPact

I like ur voice fren, and nice video, A+

 

2 minutes ago, ProjectPact said:

Why not use a Map with both the object and the action as strings or an Enum?

 

P.S - You have a perfect narrator's voice. <3 

Cuz it's for beginner noobs

  • Author

Thanks for the feedback friends. The code certainly isn't perfect, but it's definitely a good starting point and demonstrates the simplicity of some scripts!

I've added the source code to the original post. Some things for aspiring script writers to try and add on:

  • Make the bot pick up marks of grace
  • Make the bot eat food if it becomes damaged
1 hour ago, ProjectPact said:

Why not use a Map with both the object and the action as strings or an Enum?

 

P.S - You have a perfect narrator's voice. <3 

Arrays are a smaller data structure, also easier to understand as a beginner. 

This is an awesome tutorial, I'm new to programming with java and would like to start scripting for some projects.

 

If anyone wants a good book to learn java, I've found this one pretty useful: http://greenteapress.com/thinkjava6/thinkjava.pdf

Good tutorial, I have been thinking about doing a little series or weekly scripting sessions where I either stream or post a walk through. My idea is just to try and get as many people involved as I can.

  • Author

A couple more ideas I have are a code review series where I go over someone's script and offer advice, etc.

Also a "What is antiban?" video I think @Alek would get a kick out of. ?

58 minutes ago, Eliot said:

A couple more ideas I have are a code review series where I go over someone's script and offer advice, etc.

Also a "What is antiban?" video I think @Alek would get a kick out of. ?

I'd prove that we can convert a script into a two tape turing machine which is reducible to an NFA.

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.