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.

Simple Feather Buyer | Need a little help

Featured Replies

So it buys the Feather packs just fine but when it begins opening the packs it freezes the client. Any suggestions?

import java.awt.*;

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

@ScriptManifest(author = "Chambo", info = "A simple Feather pack buyer!", name = "Chambo's Feather Buyer", version = 0.3, logo = "")

public class Main extends Script {
 
    private enum State {
        BUY, OPEN
    };
 
    private State getState() {
        if (inventory.isFull()){
            return State.OPEN;
        }else{
        	return State.BUY;
        }
    }
 
    @Override
    public void onStart() {
        log("Script successfully started!");
    }
 
    @Override
    public int onLoop() throws InterruptedException {
        switch (getState()) {
            case BUY:
            	if (getInventory().getAmount("Coins") >= 300 ){
            		NPC shop = npcs.closest("Gerrant");
            		 
            		if (shop != null && shop.isVisible()) {
            		shop.interact("Trade");
            		sleep(random(500, 600));
            		
            		if (!inventory.isFull()){
	            		store.buy("Feather pack", 20);
						sleep(random(500, 600));
						store.buy("Feather pack", 20);
						sleep(random(500, 600));
						store.close();
            		}
            		}
            	}else{
                	log("Not enough coins! Stopping Script!");
                	stop();
                }
                break;
            case OPEN:
            	if (getInventory().contains("Feather pack")){
                	inventory.interact("Feather pack", "Open");
    				sleep(random(400, 100));
    				
                }
                break;
        }
        return random(200, 300);
    }
 
    @Override
    public void onExit() {
        log("Thanks for using Chambo's Feather Buyer!");
    }
 
    @Override
    public void onPaint(Graphics2D g) {
 
    }
 
}

U need to null check, coins I think

Shouldn't be the issue at all.

Can we get the error log output please?

  • Author

Shouldn't be the issue at all.

Can we get the error log output please?

 

I would but the client crashes and i cant get the log

I would but the client crashes and i cant get the log

Open the logger before you start your script...

You might want to do a check if the store is actually open as i'm pretty sure the sleep amount after you have interacted with npc isn't enough.

Check if store is open

 

 

You might want to do a check if the store is actually open as i'm pretty sure the sleep amount after you have interacted with npc isn't enough.

Yes, this is obviously the problem

Yes, this is obviously the problem

Very obvious doge.png

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.