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.

RS13159265

Members
  • Joined

  • Last visited

  1. Similarly, inventory.dropAll(f) always returns true, regardless of whether or not it dropped an item.
  2. @Explv ahh that makes sense, thank you very much. How did you manage to get the source code?
  3. package MasterScripts; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.ui.EquipmentSlot; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author="RS", info="Test small snippets", logo="", name="TestFunctions", version=1) public class TestFunctions extends Script { @Override public void onStart() {} @Override public int onLoop() throws InterruptedException { try { boolean ew = getEquipment().equip(EquipmentSlot.WEAPON, "Iron axe"); log("Result of equip: "+ew); } catch (Exception e) { log("Exception occurred: "+e); } stop(false); } } Equip a bronze axe. Load an iron axe into your inventory. The above script equips the axe, BUT returns false. Bug?
  4. Thanks. For my understanding: 1) What does new Bank() do / refer to? 2) And, reiterating, why does a non-null object raise a Null exception?
  5. The following code: package MasterScripts; import org.osbot.rs07.api.Bank; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author="Me", info="NA", logo="", name="TestFunctions", version=1) public class TestFunctions extends Script { @Override public int onLoop() throws InterruptedException { log("Starting script..."); Bank b = new Bank(); log("b is "+b); if (b == null) { log("b is null"); } try { log("Calling b.open()"); b.open(); } catch (Exception e) { log("b.open() generating exception e: "+e); } return 10000; } } Generates What??? As we check, b is a valid pointer, not null. Despite that, calling b.open() generates a NullPointerException. I really have no idea what could be going on. Ideas?
  6. Hey, I would like some way to count the number of times the bot clicks. My primary motive for this is that I want to make sure that the conditional sleeps are performing correctly i.e. after clicking on a tree the bot doesn't click again until the tree is dead. I took a look at BotMouseListener, and got that to work (in a somewhat hacky manner). Unfortunately, while that seems to be correctly counting my manual clicks on the screen, it is not recording the clicks that the bot itself makes. (AAARRGHRGHRGHR). I searched through the snippets and such but I wasn't able to find any post addressing this. Any help would be appreciated. (If someone wants to tell me the none hacky way of implementing BotMouseListener that would also be great) ClickCounter File: package Helpers; import java.awt.event.MouseEvent; import static java.awt.event.MouseEvent.MOUSE_CLICKED; import org.osbot.rs07.input.mouse.BotMouseListener; import org.osbot.rs07.script.MethodProvider; public class ClickCounter extends BotMouseListener { // This allows us to reroute our output to the same log console as our main script. // The script writes, "ClickCounter.MP = this". public static MethodProvider MP = null; public static int clickCount = 0; @Override public void checkMouseEvent(MouseEvent mouseEvent) { MP.log(mouseEvent); if (mouseEvent.getID() == MOUSE_CLICKED) { assert(MP != null); MP.log("MINE: Mouse Clicked!"); clickCount++; } } } Script File: package Attempt1; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import Helpers.ClickCounter; @ScriptManifest(author="RS3141", info="Test1", logo="", name="Example Script 1", version=1) public class ExampleScript1 extends Script { @Override public void onStart() { // Allow the ClickCounter to log to the output. ClickCounter.MP = this; this.bot.addMouseListener(new ClickCounter()); } @Override public int onLoop() throws InterruptedException { // Do stuff return 500; } }

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.