Jump to content

World widgets


Recommended Posts

Posted (edited)

Hi! Havent worked with widgets too much so ran it to some problems. My main goal is to make a snippet which solves world hopping's first time dialogue. But it crashes when I try to sellect a specific worlds widget to get that dialogue. Maybe I dont know what exact widget to select, but I tried them all.

RS2Widget world = getWidgets().get(69,17,4);

getLogoutTab().open();
sleep(1000,2000);
getWidgets().get(182, 4).interact("World Switcher");
sleep(2000,3000);
world.interact();

image.png.3d0ba11cd42e05c405f02c6970864b96.png

Edited by kramnik
Posted

Few things,

First of all, you can look at the widgets by the color of the frame, looks like the specific one you use is the amount of people in the world.

Secondly, you aren't doing any checks, make sure your widget is visable and is not null.

Lastly, i would recommand declaring your world variable at the start but setting it only after you preformed all of your other actions. Might help.

Posted (edited)

I just looked in game and you should be using the white highlighted numbers. An easy way to check is to open the widget debugger, query the suspect widget, and if it has the action you want you found it. In this case the white widget has the action "Switch." Also the subchild is the world number

Use world.interact("Switch") because it has 2 actions, add favorite being the second

Edited by NoFloob

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...