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.

Help add on or organize? Anything to make this better?

Featured Replies

Thanks to @imateamcape for helping me through writing this first one and helping me understand allot of the functioning of how the script works. Any help or opinions on what I could change/add to make it better would be appreciated, after this has been refined (Since it obviously is from Apa's tutorial) I will try and make another script based off the foundations I have learned.

 

 

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;

@ScriptManifest(author = "Drewyboyo", info = "noob script x d", name = "Tea Thiever", version = 0, logo = "")
public class main extends Script {

@@Override
public void onStart() {
log("Welcome to TeaCx.");
log("If you experience any issues while running this script please report them to me on the forums.");
log("Enjoy the tea :D.");
}


private enum State {
TO_BANK,
OPEN_BANK,
USE_BANK,
TO_STALL,
STEAL
};

private Area myBank = (Banks.VARROCK_EAST);
private Area thievingArea = (new Area(3267, 3415, 3271, 3409));

private State getState() {
if(inventory.isFull()) {
if(myBank.contains(myPlayer())) {
if(getBank().isOpen()) {
return State.USE_BANK;
}
return State.OPEN_BANK;
}
return State.TO_BANK;
}
if(thievingArea.contains(myPlayer())) {
return State.STEAL;
}
return State.TO_STALL;
}

@@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case TO_STALL:
getWalking().webWalk(thievingArea);
break;
case TO_BANK:
getWalking().webWalk(myBank);
break;
case OPEN_BANK:
break;
case USE_BANK:
getBank().depositAll();
break;
case STEAL:
RS2Object stall = getObjects().closest("Tea Stall");
if(stall != null) {
if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) {
return random(1900, 2500);
}
}
break;
}
return random(200, 300);
}

@@Override
public void onExit() {
log("Thanks for running my Tea Thiever!");
}

@@Override
public void onPaint(Graphics2D g) {

}

}

case STEAL:
RS2Object stall = getObjects().closest("Tea Stall");
if(stall != null) {
if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) {
return random(1900, 2500);
}
}
break;

Use conditional sleeps so you don't have to worry about sleeping for too little or too long. It's a good idea to get used to using conditional sleeps now for later down the road if you decide to make other scripts that involve interacting with NPCs/objects.

case STEAL:
RS2Object stall = getObjects().closest("Tea Stall");
if(stall != null) {
    if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) {
        new ConditionalSleep(3_000) {
            @[member='Override']
            public boolean condition() throws InterruptedException {
                return myPlayer().isAnimating();
            }
        }.sleep();
    }
}
break;

Edited by Hayase

  • Author
case STEAL:
RS2Object stall = getObjects().closest("Tea Stall");
if(stall != null) {
if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) {
return random(1900, 2500);
}
}
break;

Use conditional sleeps so you don't have to worry about sleeping for too little or too long. It's a good idea to get used to using conditional sleeps now for later down the road if you decide to make other scripts that involve interacting with NPCs/objects.

case STEAL:
RS2Object stall = getObjects().closest("Tea Stall");
if(stall != null) {
    if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) {
        new ConditionalSleep(3_000) {
            @[member='Override']
            public boolean condition() throws InterruptedException {
                return myPlayer().isAnimating();
            }
        }.sleep();
    }
}
break;

I was just starting to make a f2p miner, how do i differ rocks from eachother? ex: They're just called rocks, not iron, copper, etc.

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.