Kramnik Posted March 9, 2019 Share Posted March 9, 2019 (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(); Edited March 9, 2019 by kramnik Quote Link to comment Share on other sites More sharing options...
HunterRS Posted March 9, 2019 Share Posted March 9, 2019 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. Quote Link to comment Share on other sites More sharing options...
Token Posted March 9, 2019 Share Posted March 9, 2019 Make sure you open the logger (or launch with -debug port from CLI) when developing scripts, there's definitely an exception thrown in there and should be visible in the logger Quote Link to comment Share on other sites More sharing options...
NoFloob Posted March 10, 2019 Share Posted March 10, 2019 (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 March 10, 2019 by NoFloob Quote Link to comment Share on other sites More sharing options...