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.

Getting back on nodes, needing some help!

Featured Replies

Hello, I am reconstructing my script, and having just a tad of a issue with my brief code wondering if anyone has any time to give a hand or just put in your opinions on what is goiing on so I can troubleshoot it through that way.

 

 

Here is the code, I will Highlight the issues that my eclipse is reading.

package nodes;
import org.osbot.rs07.script.ScriptManifest;

import org.osbot.rs07.api.Client;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.Objects;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;

import data.Data;
import Scripts.Node;

public class ClayMine extends Node{
	final int clay = 7454;


	final String ClayOre = "Clay";
	Entity Ore = Objects.closest(data.clay);
	public ClayMine(Script sA) {
		super(sA);
		// TODO Auto-generated constructor stub
	}

	private Script s;
	private Data data;
	private Player me;
	private Inventory inv;
	@[member=Override]
	public boolean validate() throws InterruptedException {
		// TODO Auto-generated method stub
		return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer());
		String status = "We're at north mining area";
	}

	@[member=Override]
	public boolean execute() throws InterruptedException {
		if(Ore != null && data.ClayAreaN.contains(s.myPlayer())){
			if(!s.myPlayer().isAnimating()){
				Ore.interact("Mine");
				String status = "Mining ore";
			}
			return random(250,400);
		}
		break;
	}
}

The issues are highlighted in red, I am not entirely sure why I have to create a random method when its in the script package, and also if I am declaring entity wrong because its giving me a suggestion but I am pretty sure I am doing it right. I am grabbing the Clay Int from the data class.

sA.random(250,400)

or

MethodProvider.random(250, 400);



return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer());

script is already pass through. just do

return sA.inventory.isEmpty() && data.ClayAreaN.contains(sA.myPlayer());

public boolean validate() throws InterruptedException {
		// TODO Auto-generated method stub
		return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer());
		//String status = "We're at north mining area";
	}

status will never be reached i dont think

Edited by Chris

im very confused by what youre doing

 

 theres a lot about what you're doing that i dont understand, but maybe this will help.

public class ClayMine extends Node{
	final int clay = 7454;
	final String ClayOre = "Clay";
        private String status = "";
        private Script sA;
	public ClayMine(Script sA) {
		super(sA);
                this.sA = sA; //you'll only need this if the parent class has
                //Script sA as private
	}

	@[member='Override']
	public boolean validate() throws InterruptedException {
           if(sA.inventory.isEmpty() && Data.ClayAreaN.contains(s.myPlayer()) {
		status = "We're at north mining area";
                return true;
           }
           return false;
	}

	@
	Override

	public boolean execute() throws InterruptedException {
              Entity ore = sA.objects.closest(data.clay);
		if(ore != null && Data.ClayAreaN.contains(sA.myPlayer())){
			if(!sA.myPlayer().isAnimating()){
				ore.interact("Mine");
				status = "Mining ore";
			}
			return random(250,400);
		}
		break;
	}
}

also, you're aware that you just keep defining a new string status, but never use it, right? this code needs to be seriously restructured and heavily changed, would recommend starting over tbh. also i would recommend making any data from 'Data' public and static instead of defining an object 'Data' without apparent purpose...

 

Edited by Imateamcape

  • Author

Entity Ore is also giving me suggestions but not entirely sure. I fixed the random sleeps. Tyvm Chris for the extra example!.


s.objects.closest(data.clay); is giving me a suggestion// error also.


Tried using RS2Object also...

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.