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 script upload requirments.

Featured Replies

when submitting a script, I was told to only use root widgets for static id's, I dont know if i understand this completely. Can anyone elaborate on what this means.

here is an example of me using a widget from the script.

RS2Widget cookingWidget = getWidgets().get(270,14);
		if(cookingWidget != null)
		{
			
			String[] availableActions = cookingWidget.getInteractActions();
			for(String s: availableActions)
			{
				if(s.equals("Make"))
				{
					if(cookingWidget.interact("Make"))
					{
						probablyMakingPies = true;
						mySleep(1000);
					}
					
				}
			}
		}

 

Edited by roguehippo

12 minutes ago, roguehippo said:

when submitting a script, I was told to only use root widgets for static id's, I dont know if i understand this completely. Can anyone elaborate on what this means.

here is an example of me using a widget from the script.

 

Widgets have 2 or 3 ids.

e.g.

123, 1

or

123, 1, 2

The root id (123) is unlikely to change, but the second and third level ids may.

So if you are going to use a fixed id at all, you should only use the root.

For example:

getWidgets().getWidgetContainingText(123, "Blah");

or

getWidgets().singleFilter(123, new Filter......

 

You should avoid using:

getWidgets().get(123, 1)

and

getWidgets().get(123, 1, 2)

Edited by Explv

There is a widget hierarchy which you can explore with the widget debugger (in the options menu). The root id defines the highest level in this hierarchy, e.g the chatbox. Each root container will host various sub-widgets (referred to as children), and these children may have grandchildren widgets etc...

The reason for the SDN static id rule is simple: With game updates, lower level widget ids frequently change and as a result your script will break

-> A better way to filter widgets would be with text, as this is more likely to remain consistent following game updates.

Naturally, the same goes for object ids.

Hope that cleared things up,

Apa

 

Edited by Apaec

19 minutes ago, roguehippo said:

when submitting a script, I was told to only use root widgets for static id's, I dont know if i understand this completely. Can anyone elaborate on what this means.

here is an example of me using a widget from the script.

 

Widgets contain max 3 ids:

* Root

* Child

* Subchild (? or how do you call it).

The requirement states that you can't use any lower id's than root id's.

Meaning if you want to use a widget in your script, which's id's are 351 2, you

SHOULDN'T do:

widgets.get(351, 2);

SHOULD do:

widgets.getWidgetContainingText(351, "Some text that is in the widget");

The reasoning behind this requirement, to my mind, is questionable, but still has it's points: If you hard code the id's in your script, there's a chance that the id's will change after an update and your script will break.

Though, in my mind, if Jagex changes any "child widget elements", I think they'll change the whole widget, meaning my previous example will fail as well.

If you search for widgets only using text, there's still a chance that your script will function even after changing the widget. 

Edited by nosepicker

26 minutes ago, nosepicker said:

Though, in my mind, if Jagex changes any "child widget elements", I think they'll change the whole widget, meaning my previous example will fail as well.

Not really, for example lets say you had some screen with root widget 123

Inside were three buttons

123, 1

123, 2

123, 3

And lets say you hardcoded the widget for the third button: getWidgets().get(123, 3)

If they then inserted another button between 2 and 3, your widget would now change to 123, 4, breaking your code (you hardcoded it to 3)

The root widget 123 wouldn't change, just the child ones.

8 hours ago, Explv said:

Not really, for example lets say you had some screen with root widget 123

Inside were three buttons

123, 1

123, 2

123, 3

And lets say you hardcoded the widget for the third button: getWidgets().get(123, 3)

If they then inserted another button between 2 and 3, your widget would now change to 123, 4, breaking your code (you hardcoded it to 3)

The root widget 123 wouldn't change, just the child ones.

I really doubt that if they added a new button, they would change previous widget id's just to make "positioning" cleaner.

Probably would end up as (just move the widgets around):

123, 1 - pos x = 1

123, 2 - pos = 2

123, 3 - pos = 4

123, 4 - pos = 3

Just thinking out loudly though.

4 hours ago, nosepicker said:

I really doubt that if they added a new button, they would change previous widget id's just to make "positioning" cleaner.

Probably would end up as (just move the widgets around):

123, 1 - pos x = 1

123, 2 - pos = 2

123, 3 - pos = 4

123, 4 - pos = 3

Just thinking out loudly though.

I mean I'm pretty sure I've seen it in an update before, and I don't think I've seen widget IDs that haven't been in order.

But let's just agree to disagree :D

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.