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.

Question about calling "Servant"

Featured Replies

So in my couple day journey I've managed to get my bot to successfully "Build" and "Remove" oak larders thanks to many users advice, tutorials, snippets, etc. Now I've ran into the problem of trying to get the bot to check inventory if I have enough planks to build larders or not. If not then call servant and un-note planks, keep building. If anyone would like to look over the script and point out how retarded I am that'd be great! ?

package simpleLarders;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

@ScriptManifest(name = "Simple Larders", author = "Imthabawse", version = 1.0, info = "Makes Oak Larders", logo = "")  //Helps the client understand and find the script we compile

public class SimpleLarders extends Script {

    @Override

    public void onStart() {
log ("Welcome to Simple Larders, Let's start building!");
        //Code here will execute before the loop is started

    }



    @Override

    public void onExit() {
log ("Thanks for using Simple Larders.");
        //Code here will execute after the script ends

    }
 // Should code for checking planks and calling servant be outside onLoop?
    @Override

    public int onLoop() {
        Entity larder_space = getObjects().closest("Larder space");
        if (larder_space != null && larder_space.interact("Build")) {
            new ConditionalSleep(4000) {
                @Override
                public boolean condition() {
                    return !larder_space.exists();
                }
            }.sleep();
        }

        RS2Widget buildlarder = getWidgets().get(458, 5, 4);
        if (buildlarder != null && buildlarder.interact("Build")) {
            new ConditionalSleep(4000) {
                @Override
                public boolean condition() {
                    return myPlayer().isAnimating();
                }
            }.sleep();
        }

        Entity larder = getObjects().closest("Larder");
        if (larder != null && larder.interact("Remove")) {
            new ConditionalSleep(4000) {
                @Override
                public boolean condition() {
                    return !larder.exists();
                }
            }.sleep();
        }
        
        RS2Widget removelarder = getWidgets().getWidgetContainingText("Yes");
        if (removelarder != null && removelarder.interact()) {
        	new ConditionalSleep(4000) {
        		@Override
        		public boolean condition() {
        			return myPlayer().isAnimating();
        		}
        	}.sleep();
        } //Script runs great till this point with a return underneath
          // But I tried to implement checking for planks and calling servant below
        if (getInventory().getAmount("Oak plank") > 5);
        RS2Widget settings = getWidgets().get(548, 35);
        if(settings != null && settings.interact()) {
        	new ConditionalSleep(4000) {
        		@Override
        		public boolean condition() {
        			return myPlayer().isAnimating(); // *Sure this is wrong
        		}                            // Because players not animating?
        	}.sleep();
        }
        
        RS2Widget house = getWidgets().get(261, 99);
        if (house != null && house.interact()) {
        	new ConditionalSleep(4000) {
        		@Override
        		public boolean condition() {
        			return myPlayer().isAnimating(); //* Same as above
        		}
        	}.sleep();
        }
        
        RS2Widget servant = getWidgets().get(370, 19, 0);
        if (servant != null && servant.interact()) {
        	new ConditionalSleep(4000) {
        		@Override
        		public boolean condition() {
        			return myPlayer().isAnimating(); //* Same as above
        		}
        	}.sleep();
        }
        
        RS2Widget unnote = getWidgets().get(219, 1, 1);
        if (unnote != null && unnote.interact()) {
        	new ConditionalSleep(4000) {
        		@Override
        		public boolean condition() {
        			return myPlayer().isAnimating(); //* Same as above
        		}
        	}.sleep();
        }
        
        RS2Widget inven = getWidgets().get(548, 51);
        if (inven != null && inven.interact()) {
        	new ConditionalSleep(8000) {
        		@Override
        		public boolean condition() {
        			return myPlayer().isAnimating(); //* Same as above
        		}
        	}.sleep();
        }
        
        return 5000; //The amount of time in milliseconds before the loop starts over
    }
}

 

thumb_please-help-me-im-dumb-memepanerator-net-me-pretending-like-i-37721104.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.