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.

Ground Decoration has been deprecated...

Featured Replies

Okay so this works:

RS2Object daisies = objects.closest("Daisies");

    if (daisies != null) {

    log("yeah iz a daiisssyyy");

    log("daisy" + daisies.getPosition());

    log("mee" + myPlayer().getPosition());

    if (daisies.getPosition() == myPlayer().getPosition()) {

    log("dis works");

    }

}

 

And this is what I get in the log:


[INFO][Bot #1][05/28 08:03:08 PM]: yeah iz a daiisssyyy
[INFO][Bot #1][05/28 08:03:08 PM]: daisy[x=3159, y=3261, z=0]
[INFO][Bot #1][05/28 08:03:08 PM]: mee[x=3159, y=3261, z=0]

 

However, it doesn't print out "dis works" even though the positions are the same...
 

 

@Chris

@Apaec

Edited by Noidlox

45 minutes ago, Chris said:

use the .equals() method not ==

HOLY SHIT LOL IT WORKED!!

And I can see why because we are comparing objects... not variables/numbers

@Chris You a legit genius :)

24 minutes ago, Polymorphism said:

It has more to do with comparing primitives vs comparing objects.

 

https://chortle.ccsu.edu/java5/Notes/chap09C/ch09C_2.html

Yeah lol that's what I meant, primitive types. 

IIRC, you have to use the equals() method with objects because of the way it is stored in memory. It has to do something with the fact that java passes by value, not reference. So when you compare int x and int y, the values are passed but when you compare obj 1 and obj 2, the references in memory are passed...? I think lol... Feel free to correct me if I'm wrong

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.