greyb3ast 0 Share Posted November 29, 2016 So i am having problem with logic i guess... When i do simple way everything works: if (getInventory().contains("Gold bar")) { //do stuff } but when i add more stuff script starts but does nothing not even throw a error or exception: WidgetChild b = getWidgets().getWidgetChild(446, 25); if (b != null && !b.isVisible() &&getInventory().contains("Gold bar")) { // do stuff } Any ideas what could i try? Link to comment Share on other sites More sharing options...
rexas 12 Share Posted November 29, 2016 Maybe because the widget is visible or maybe you meant " do stuff when b is not null and b IS visible"? Link to comment Share on other sites More sharing options...
greyb3ast 0 Author Share Posted November 29, 2016 Maybe because the widget is visible or maybe you meant " do stuff when b is not null and b IS visible"? Widget is NOT visible, and i meant do stuff when b is NOT visible. Link to comment Share on other sites More sharing options...
rexas 12 Share Posted November 29, 2016 Widget is NOT visible, and i meant do stuff when b is NOT visible. maybe when your widget is not visible it is null? Try to log them separately and see which one returns false. log(b != null + "") etc You could use b == null || !b.visible() And if you are 100% sure it should work, then restart your client and try it again. Sometimes i get weird results until i restart my client. Link to comment Share on other sites More sharing options...
greyb3ast 0 Author Share Posted November 29, 2016 maybe when your widget is not visible it is null? Try to log them separately and see which one returns false. log(b != null + "") etc You could use b == null || !b.visible() And if you are 100% sure it should work, then restart your client and try it again. Sometimes i get weird results until i restart my client. Thank you very much it works now you are my hero Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.