MarWo22 Posted April 2, 2018 Share Posted April 2, 2018 NPC Tanner = sI.npcs.closest("Ellis"); Area TANNING_SHOP = new Area(3277,3189,3270,3194); if(TANNING_SHOP.contains(sI.myPosition())) { if(!sI.getWidgets().isVisible(324)) { if(Tanner !=null) { Tanner.interact("Trade"); new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return sI.getWidgets().isVisible(324); } }.sleep(); } } else { sI.getWidgets().interact(324, 13, "Tan ALL"); new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return !sI.getWidgets().isVisible(324); } }.sleep(); } } else { sI.getWalking().webWalk(TANNING_SHOP); } Im trying to make a simple tanning script. But sometimes it gets stuck in the widget of tanning the hides. I've tried a lot to fix it but i can't seem to get it to work. Can someone pls help me fix it? Thank you! Quote Link to comment Share on other sites More sharing options...
renoweno Posted April 2, 2018 Share Posted April 2, 2018 (edited) I think the problem is with your if and else statements when you check for visibility of the widget. Remove the else and keep the code outside that the widget is now visible and the code could be performed, otherwise, it will just open the widget as the if the statement was true and it won't do the negation of it which is tanning in the else statement... Also, it would be better if you check that the inventory has the items to be tanned as kind of failsafe and so that it doesn't glitch if you have breaks enabled. Edited April 2, 2018 by renoweno Quote Link to comment Share on other sites More sharing options...
MarWo22 Posted April 2, 2018 Author Share Posted April 2, 2018 Thank you! It fixed the issue! 1 Quote Link to comment Share on other sites More sharing options...