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.

Need some help with powermining script

Featured Replies

Hey, I used a code from someones powerfisher and thought I'd just turn it into a powerminer for educational purposes, trying to get to learn scripting properly.
 
I editted some of the code etc but the scipt is constantly clicking different rock IDs when I have specifically told it mine 1 ID. Here is the code.

import java.awt.Graphics2D;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Area;


@ScriptManifest(author = "Cleggy", info = "kPower", name = "kPowerminer", version = 0, logo = "")
public class main extends Script {



	public static final int[] ORE = {438};
	public static final int[] ROCKS = {14863};
	private static final Area MININGAREA = new Area(3227, 3153, 3222, 3142);
	
    @Override
    public void onStart() {
		log("kPowerminer Activated - Beginning to get dem levels bruh");

    }
    
    private enum State {
    	DROP, MINE
    };
    
	private State getState() {
        if (inventory.isFull() && MININGAREA.contains(myPlayer()))
            return State.DROP;
		return State.MINE;
	}
    	

    @Override
    public void onExit() {


    }



	public int onLoop() throws InterruptedException {
		switch (getState()) {
		case MINE:
		 if (inventory.isEmptyExcept(438)); {
			Entity Spot = objects.closest(ROCKS);
			if (Spot != null) {
				Spot.interact("Mine");
				sleep(random(400, 600));
			}
		 }
		default :
			break;
		}
		
        return 400;
    }
	@Override
	public void onPaint(Graphics2D g) {

	}

} 

any help? I want it to mine a rock until it gets a full inventory then empty, but it just mines 1 ore then instantlly drops it.

 

cheers

Hey, I used a code from someones powerfisher and thought I'd just turn it into a powerminer for educational purposes, trying to get to learn scripting properly.

 

I editted some of the code etc but the scipt is constantly clicking different rock IDs when I have specifically told it mine 1 ID. Here is the code.

import java.awt.Graphics2D;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Area;


@ScriptManifest(author = "Cleggy", info = "kPower", name = "kPowerminer", version = 0, logo = "")
public class main extends Script {



	public static final int[] ORE = {438};
	public static final int[] ROCKS = {14863};
	private static final Area MININGAREA = new Area(3227, 3153, 3222, 3142);
	
    @Override
    public void onStart() {
		log("kPowerminer Activated - Beginning to get dem levels bruh");

    }
    
    private enum State {
    	DROP, MINE
    };
    
	private State getState() {
        if (inventory.isFull() && MININGAREA.contains(myPlayer()))
            return State.DROP;
		return State.MINE;
	}
    	

    @Override
    public void onExit() {


    }



	public int onLoop() throws InterruptedException {
		switch (getState()) {
		case MINE:
		 if (inventory.isEmptyExcept(438)); {
			Entity Spot = objects.closest(ROCKS);
			if (Spot != null) {
				Spot.interact("Mine");
				sleep(random(400, 600));
			}
		 }
		default :
			break;
		}
		
        return 400;
    }
	@Override
	public void onPaint(Graphics2D g) {

	}

} 

any help? I want it to mine a rock until it gets a full inventory then empty, but it just mines 1 ore then instantlly drops it.

 

cheers

 

 

well you are checking whether the inventory is empty except for the ore, and so it will drop it since you have just mined it. instead you want to check if the !getInventory().isFull() then mine else drop ^_^

  • Author

Is this better? I cant test it due to my main account botting. but heres the script, seems to make sense to me.

import java.awt.Graphics2D;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Area;


@ScriptManifest(author = "Cleggy", info = "kPower", name = "kPowerminer", version = 0, logo = "")
public class main extends Script {



	public static final int[] ORE = {438};
	public static final int[] ROCKS = {14863};
	private static final Area MININGAREA = new Area(3227, 3153, 3222, 3142);
	
    @Override
    public void onStart() {
		log("kPowerminer Activated - Beginning to get dem levels bruh");

    }
    
    private enum State {
    	DROP, MINE
    };
    
	private State getState() {
        if (!getInventory().isFull() && MININGAREA.contains(myPlayer()))
            return State.DROP;
		return State.MINE;
	}
    	

    @Override
    public void onExit() {


    }



	public int onLoop() throws InterruptedException {
		switch (getState()) {
		case MINE:
		 if (!getInventory().isEmpty()); {
			Entity Spot = objects.closest(ROCKS);
			if (Spot != null) {
				Spot.interact("Mine");
				sleep(random(400, 600));
			}
		 }
		default :
			break;
		}
		
        return 400;
    }
	@Override
	public void onPaint(Graphics2D g) {

	}

} 

what if inventory is empty? it wont mine happy.png just read through the logic and see for yourself ^_^

Edited by Precise

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.