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.

importing class

Featured Replies

Hi guys i want to make a woodcutting script but I have problems with importing classes can somebody tell me what I´m doing wrong ?

Thanks in advance.

This is the first class:

package script;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import tasks.GoChopTree;


@ScriptManifest(author = "GUANGZHOU", logo = "", info ="Cuts trees" , version = 1.0 , name = "Tree chopper")
public final class Main extends Script {

        private final GoChopTree goChopTree = new GoChopTree();

        @Override
        public void onStart() {


        }



        @Override
        public void onExit() {
            

        }

        @Override
        public int onLoop() {
            try {
                goChopTree.onLoop();
            } catch (InterruptedException e) {
                log("doesn´t work");
            }

            return 1000;

        }

    }

 

This is the second class:

package tasks;

import org.osbot.rs07.script.MethodProvider;


public final class GoChopTree extends MethodProvider {
    public final void onLoop() throws InterruptedException {
        long coinsininventory = inventory.getAmount(995);
        int coinsininv = Math.toIntExact(coinsininventory);
        log(coinsininv);
    }
}

 

Try this:

public void onStart() {
    goChopTree.exchangeContext(getBot());
}

Edited by Lordsthan
Indentation

  • Author

Warning:(14, 19) java: exchangeContext(org.osbot.rs07.Bot) in org.osbot.rs07.script.MethodProvider has been deprecated

This is the warning that i am receiving + the script does not show up in my local files.

35 minutes ago, Guangzhou said:

Warning:(14, 19) java: exchangeContext(org.osbot.rs07.Bot) in org.osbot.rs07.script.MethodProvider has been deprecated

This is the warning that i am receiving + the script does not show up in my local files.

Try this instead:

@SuppressWarnings("deprecation")
@Override
public void onStart() {
    goChopTree.exchangeContext(getBot());
}

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.