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.

widget.getMessage();

Featured Replies

Got it working now, thank you for the contribution.

 

This has made me scratch my head for a while now..

 

	RS2Widget wid = getWidgets().get(162, 53, 2);
		
		if (wid != null && wid.isVisible()) {
			if (wid.getMessage() == "Leather") {
				widget = "Widget is visible and text is leather";
			} else {
				widget = "Widget is visible but text is " + wid.getMessage();
			}
		} else {
			widget = "Widget is not visible";
		}

048931214fa1fb7736864caf6e9064ae.png.f77e25fc0f38c6dc2ef7cb65152a65a2.png

Notice the "Widget is visible BUT text is Leather". wid.getMessage() returns Leather so I don't understand what the issue is.

Anybody has any idea?

 

EDIT:

Now this issue has appeared. I'm also having trouble interacting with widgets (as you can see above).

			getKeyboard().typeString("5");
			getKeyboard().typeEnter();

            //Tried this method aswell a few days ago and it worked fine. Until now
			getKeyboard().pressKey((char) KeyEvent.VK_ENTER);
			getKeyboard().releaseKey((char) KeyEvent.VK_ENTER);

Why am I having these weird issues?

Edit again:

Ok so turns out this simple code works out when I use it in a basic script class that I use purely for bugtesting. But within my code it wont work. Alot of random sleeps I know it's just because I couldn't get a hang of it.

			RS2Widget pSearch = getWidgets().get(162, 53, 2);
			if (pSearch != null && pSearch.isVisible()) {
				logs = "pSearch finns";
				log("pSearch inte");
				getMouse().move(random(220, 306), random(373, 388));
				getMouse().click(false);
				sleep(random(300, 600));
			} else {
				logs = "pSearch finns inte";
				log("pSearch finns inte");
				sleep(random(500, 800));
				getKeyboard().typeString("leat");
				sleep(random(500, 700));
				getMouse().move(random(351, 403), random(371, 396));
				getMouse().click(false);
				sleep(random(500, 700));
			}
			getMouse().move(random(224, 246), random(203, 220));
			//sleep(random(300, 600));
			getMouse().click(false);
		//	sleep(random(300, 600));
			getKeyboard().typeString("5");
			sleepR();
			getKeyboard().typeEnter();
			getKeyboard().pressKey((char) KeyEvent.VK_ENTER);
			getKeyboard().releaseKey((char) KeyEvent.VK_ENTER);
			sleepR();
			sleep(random(300, 600));
			getMouse().move(random(250, 269), random(280, 295));
			sleepR();
			getMouse().click(false);

 

Edited by nills3

https://www.geeksforgeeks.org/difference-equals-method-java/#:~:text=equals() method for content,of values in the objects.&text=Explanation%3A Here we are creating two objects namely s1 and s2.

You're checking whether both Strings are pointing to the same memory location, as opposed to comparing their contents. Use #equals or #equalsIgnoreCase instead of ==.

Edited by Eagle Scripts

  • Author
21 minutes ago, Eagle Scripts said:

https://www.geeksforgeeks.org/difference-equals-method-java/#:~:text=equals() method for content,of values in the objects.&text=Explanation%3A Here we are creating two objects namely s1 and s2.

You're checking whether both Strings are pointing to the same memory location, as opposed to comparing their contents. Use #equals or #equalsIgnoreCase instead of ==.

Cheers mate, finally.

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.