DeadPk3r Posted January 6, 2018 Share Posted January 6, 2018 Im trying to get my script to walk from location1 to location2 and on the way to location2 there is a door that needs to be opened once opened i want to use a item in my inventory on a object but the problem im having is on the way there when i get to the door script tries to use my inventory item on object even though door is closed, but sometimes rarely will open door then use item on object, posted code below kinda-iffy just really tired atm. if(!UI.cookingArea.contains(myPlayer())) { setStatus("Walking to range/fire."); getWalking().webWalk(UI.cookingArea); if(getDoorHandler().handleNextObstacle(UI.cookingArea)) { new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getMap().canReach(range); } }.sleep(); } } if (!getWidgets().isVisible(270, 14)) { setStatus("Using food on range/fire."); getInventory().interact("Use", UI.foodType); if (range.interact("Use")) { new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return getWidgets().isVisible(270, 14); } }.sleep(); } } else { if (getWidgets().interact(270, 14, "Cook")) { setStatus("Cooking food."); new ConditionalSleep(100_000) { @Override public boolean condition() throws InterruptedException { return !inventory.contains("Raw") || getDialogues().isPendingContinuation(); } }.sleep(); if(getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); } } } Quote Link to comment Share on other sites More sharing options...
Alek Posted January 6, 2018 Share Posted January 6, 2018 Don't handle doors if you are using web walking. Right now it looks like you're trying to web walk to the area first and then open the door? Since these are static areas and I'm sure you're not traversing the map, save 1-2GB of member and don't use web walking. If the door is in the same region as the bank (I sure as hell hope it is), then on the script start grab the door object. Create a WalkingEvent and set the break condition to if the door is closed. If the door is closed, WalkingEvent will break, then you can handle the door. Additionally: You aren't disposing your GUI, this is lost memory. Dispose of your GUI and keep your variables contained in the script (aka no more GUI.getArea). Also your script will break within a month with all those static ids. 1 Quote Link to comment Share on other sites More sharing options...