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.

Picking Up Bronze Pick Error

Featured Replies


import java.awt.Rectangle;

import org.osbot.legacy.script.mouse.RectangleDestination;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Area;










@ScriptManifest(author="Freak",info="Mines Tin in Lumb Swamp",logo="",name="Freaky Miner", version = 0.1)	
public class Tin extends Script {
	
	private enum State {     MINE, WALKTOMINE, COLLECTPICK, HOMETELE};
	public static final Area Tele = new Area(3232,3209,3215,3229);
	public static final Area Lada = new Area(3229,3214, 3230, 3225);
	public static final Area Lada2 = new Area(3228,3223, 0, 0);
;
	public static final Position Roof = new Position(3229,3214, 2);
	public static final Position Roof2 = new Position(3229,3223, 2);
	public static final Position Roof3 = new Position(3228,3213, 2);
	public static final Position Roof4 = new Position(3228,3224, 2);
	
		@Override public void onStart(){
			 
			
		
	}
		
		private State getState() {
			
			if(!inventory.contains("Bronze pickaxe")){	
	if(Tele.contains(myPlayer())){
				return State.COLLECTPICK; 
				}
		}if(!Tele.contains(myPlayer())){
			return State.HOMETELE; 
		}
			
	
	
	return State.MINE;
				
	}
	public int onLoop() throws InterruptedException {
		switch (getState()) {
		
		case COLLECTPICK:
				
			
				Entity Door = objects.closest("Door");
				if(Door.exists()){
			mouse.setSpeed(2);
			if(!Door.interact("Close")){
			Door.interact("Open");	
			}
			}
			sleep(random(250,3500));
		Entity Ladder = objects.closest("Ladder");
		Ladder.interact("Climb-up");
		
													 
						 if(myPlayer().getPosition().equals(Roof)){
							 GroundItem x = this.groundItems.closest("Bronze pickaxe");
								if (x != null && x.exists()) {
									x.interact("Take");
								}
							 
						 }if(myPlayer().getPosition().equals(Roof2)){

							 GroundItem x = this.groundItems.closest("Bronze pickaxe");
								if (x != null && x.exists()) {
									x.interact("Take");
								}
						 }if(myPlayer().getPosition().equals(Roof3)){

							 GroundItem x = this.groundItems.closest("Bronze pickaxe");
								if (x != null && x.exists()) {
									x.interact("Take");
								}
						 }if(myPlayer().getPosition().equals(Roof4)){
							 log("Here");

							 GroundItem x = this.groundItems.closest("Bronze pickaxe");
								if (x != null && x.exists()) {
									x.interact("Take");
								}
						 }
	log("error");
						 objects.closest("Ladder").interact("Climb-up");
		 
		
	
	
		sleep(random(250,3500));
		log("hometele");
		
	
	
		
		break;
		case HOMETELE:
			tabs.open(Tab.MAGIC);
				Rectangle optionRect = new Rectangle(571, 238, 10, 10);
				RectangleDestination optionDestination = new RectangleDestination (optionRect);
				if(!myPlayer().isAnimating()){
				 mouse.move(optionDestination);
				mouse.click(optionDestination,false);
				sleep(random(300000,400000));
			
				
				}
			break;
		case MINE:
			break;
		case WALKTOMINE:
			break;
		default:
			break;}
		
						 
		
		
	
			
	
			
			
			
		return 0;
			
			
		
		}
}
		
			
			
				
				
				
			
			
			
		
		  
		
	

	
	


	


	
	

gives the error

[ERROR][Bot #1][06/07 12:24:04 PM]: Error in script executor!
java.lang.NullPointerException
	at Tin.onLoop(Tin.java:63)
	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ri:145)
	at java.lang.Thread.run(Unknown Source)

  • Author

which line is 63? because that is where the error is occurring.

if(Door.exists()){

 

 

How do I check if a door is visible?

if(Door.exists()){

 

 

How do I check if a door is visible?

you are throwing a NullPointerException. to resolve, change it to

 

if(Door != null && Door.exists) {

 

}

 

to check if it is visible do

 

Door.getPosition.isVisible()

 

  • Author

you are throwing a NullPointerException. to resolve, change it to

 

if(Door != null && Door.exists) {

 

}

 

to check if it is visible do

 

Door.getPosition.isVisible()

 

 

Thank you very much! One quick question, if the door isn't visible how do I rotate the camera to the entity?

This will kill you

import org.osbot.legacy.script.mouse.RectangleDestination;

import org.osbot.rs07.api.map.Position;

import org.osbot.rs07.api.model.Entity;

import org.osbot.rs07.api.model.GroundItem;

import org.osbot.rs07.api.ui.Tab;

import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;

import org.osbot.rs07.utility.Area;

Change the first line to make it match the rest

  • 2 weeks later...
Guest
This topic is now closed to further replies.

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.