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 Fighter Script in 10 Minutes??? (Part 1)

Featured Replies

In this video, I write the beginnings of an "AIO" Fighter script which can be extended in future videos. Feel free to use the source code for any purpose.

Source code:

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.ConditionalSleep;

import java.util.Arrays;

@ScriptManifest(name = "10MinFighter", version = 1.0, info = "", author = "", logo = "")
public class Driver extends Script {
    String npcName;

    @Override
    public int onLoop() throws InterruptedException {
        // 1. decide which type of npcs to attack
        if (npcName == null) {
            if (myPlayer().getInteracting() != null) {
                npcName = myPlayer().getInteracting().getName();
            } else {
                return 500;
            }
        }
        // 2. attack them
        if (!myPlayer().isAnimating() && myPlayer().getInteracting() == null) {
            NPC next = getNpcs().closest(npc -> npc.getName().equals(npcName) &&
                    npc.isAttackable() && !npc.isUnderAttack() &&
                    npc.getInteracting() == null);
            if (next != null) {
                next.interact("Attack");
                new ConditionalSleep(5000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return myPlayer().getInteracting() != null;
                    }
                }.sleep();
            }
        }
        // 3. eat food so we don't die
        if (myPlayer().getHealthPercent() < 50) {
            Item food = getInventory().getItem(item ->
                    Arrays.asList(item.getActions()).contains("Eat"));
            if (food != null) {
                food.interact("Eat");
                sleep(2500);
            }
        }
        // 4. (optional) loot and bank
        return 500;
    }
}

Previous tutorial: 

 

 

Thanks I was able to make a fighter because of this

  • Author
17 minutes ago, Ericthecmh said:

I love your voice @Eliot will listen to this instead of music

Thanks bb, now join the Discord. :)

Really nice that your explaining it with voice aswell. thanks was entertaining to watch 

1 hour ago, Czar said:

Time to write a fighter script :doge: 

bout time you learned eh

You actually sound really good! Would appreciate removing the BGM though.

Edited by Tempest

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.