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.

Noob needs some help

Featured Replies

I'm stille getting used to the API, so it's kinda hard to find ...

Also, you gold me the coin id, bit how could I find such things myself?

 

I would use Names instead of ID's if you can, will stop the script breaking if they change the ID's in a Runescape update.. happy.png

 

Keep exploring the API. happy.png

 

Precise.

Edited by Precise

I'm stille getting used to the API, so it's kinda hard to find ...

Also, you gold me the coin id, bit how could I find such things myself?

 

the client debugger interface :)

Found under the settings icon at the client.

 

Then enable inventory debug or anything else that you want to see/debug

 

Khaleesi

this is a very good begginer script, keep doing ur thing  , knowledge is power! 

I'm stille getting used to the API, so it's kinda hard to find ...

Also, you gold me the coin id, bit how could I find such things myself?

Go to settings at the client and click debug inventory, you should get the id's of every item in your inventory.

  • Author

completeDialogue(java.lang.String... options)
Completes the current dialogue using the specified options when available.

How exactly should I use this so he picks the first option?

 

sHpgMoe.png

 

This is the code I currently have, Eclispe is giving an error at each line starting with "Dialogues.", what's the proble there and how can I solve it? DO you guys have any other suggestions on things I could improve?

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.Dialogues;

import java.awt.*;
 
@ScriptManifest(author = "Me", info = "Buys Woad leaves from Wyson the gardener in Falador Park", name = "Woad Leaf Buyer", version = 0.1, logo = "")
public class main extends Script {
 
    @Override
    public void onStart() {
        log("Woad Leaf Buyer has started.");
    }
 
    @Override
    public int onLoop() throws InterruptedException {
    	
    	if(!(inventory.getAmount(995) < 20)) {
			stop();
		}  	
		NPC gardener = npcs.closest("Wyson the gardener");
		if (gardener != null) {
			gardener.interact("Talk-to");
			return random(200, 300);
			Dialogues.clickContinue();
			return random(200, 300);
			Dialogues.clickContinue();
			return random(200, 300);
			Dialogues.selectOption(2, 1);
			return random(200, 300);
			Dialogues.clickContinue();
			return random(200, 300);
			Dialogues.clickContinue();
			return random(200, 300);
			Dialogues.selectOption(4, 4);
			return random(200, 300);
			Dialogues.clickContinue();
			return random(200, 300);
			Dialogues.clickContinue();
			return random(200, 300);
			Dialogues.clickContinue();
		}
        return random(200, 300);
    }
 
    @Override
    public void onExit() {
        log("Thanks for running my first script");
    }
 
    @Override
    public void onPaint(Graphics2D g) {
 
    }
 
}
  • Author

change Dialogues to getDialogues()

 

I did that and Eclipse is still giving me an error, it says: "getDialogues cannot be resolved".

  • Author

Now it tells me "org.osbot.rs07.api.Dialogues is never used" on line 4 and on line 26: "dialogues.clickContinue(); is unreachable code".

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.Dialogues;

import java.awt.*;
 
@ScriptManifest(author = "Me", info = "Buys Woad leaves from Wyson the gardener in Falador Park", name = "Woad Leaf Buyer", version = 0.1, logo = "")
public class main extends Script {
 
    @Override
    public void onStart() {
        log("Woad Leaf Buyer has started.");
    }
 
    @Override
    public int onLoop() throws InterruptedException {
    	
    	if(!(inventory.getAmount(995) < 20)) {
			stop();
		}  	
		NPC gardener = npcs.closest("Wyson the gardener");
		if (gardener != null) {
			gardener.interact("Talk-to");
			return random(200, 300);
			dialogues.clickContinue();
			return random(200, 300);
			dialogues.clickContinue();
			return random(200, 300);
			dialogues.selectOption(2, 1);
			return random(200, 300);
			dialogues.clickContinue();
			return random(200, 300);
			dialogues.clickContinue();
			return random(200, 300);
			dialogues.selectOption(4, 4);
			return random(200, 300);
			dialogues.clickContinue();
			return random(200, 300);
			dialogues.clickContinue();
			return random(200, 300);
			dialogues.clickContinue();
		}
        return random(200, 300);
    }
 
    @Override
    public void onExit() {
        log("Thanks for running Woad Leaf Buyer");
    }
 
    @Override
    public void onPaint(Graphics2D g) {
 
    }
 
}

Yeah, any code after a return is not executed, therefore unreachable in your code. Replace return random(200, 300) with sleep(200, 300) or better yet conditional sleeps (look at API).

  • Author

Yeah, any code after a return is not executed, therefore unreachable in your code. Replace return random(200, 300) with sleep(200, 300) or better yet conditional sleeps (look at API).

 

It's giving me another error, when I change "return random" with "sleep", Eclipse tells me: "Tha method sleep(long) in the type MethodProvider is not applicable for the arguments (int, int). So I suppose it's not possible to sleep a random amount of time?

 

And it still gives me the unreacable error on the first "dialogues.clickContinue();".

Edited by Scorncial

Sorry, do sleep(random(200, 300)). You have to remove the "return" part, else the code will remain unreachable.

  • Author

Sorry, do sleep(random(200, 300)). You have to remove the "return" part, else the code will remain unreachable.

 

Thanks a lot, everything seems to be working fine now :) How could I implement the coditionalsleep, so that it only sleeps as long as the next dialogue has been opened?

I'm stille getting used to the API, so it's kinda hard to find ...

Also, you gold me the coin id, bit how could I find such things myself?

 

To get the ID for anything, put it in your inventory, go to SETTINGS > DEBUG > [x] Interface Debugging and hover over the item.

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.