PlagueDoctor Posted November 16, 2016 Posted November 16, 2016 (edited) Here's some code i cooked up real quick to run a certain distance away from my current position and hopefully escape combat. Thought i'd post it in case someone eventually finds it useful. case COMBAT: if(getStore().isOpen()) { status = "Closing store."; getStore().close(); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return !getStore().isOpen(); } }.sleep(); } if(getBank().isOpen()) { status = "Opening bank."; getBank().close(); new ConditionalSleep(10000) { @[member='Override'] public boolean condition() throws InterruptedException { return !bank.isOpen(); } }.sleep(); } int getX = myPosition().getX(); int getY = myPosition().getY(); int getZ = myPosition().getZ(); Position newPos = new Position(getX + 30, getY + 30, getZ); getWalking().webWalk(newPos); break; Might have to do some funky stuff with the getZ value if you want it to run away up/down stairs, not sure. EDIT: Will cause issues if script attempts to walk to a non walkable area. Edited November 16, 2016 by PlagueDoctor 3
House Posted November 16, 2016 Posted November 16, 2016 (edited) I don't think using a position given like that is good, like you said it will fuck you over if its not walkable and not do anything. Usually you want to deagro with changing the Z coord aka walking up a ladder What if you are in a small area also? Edited November 16, 2016 by House
PlagueDoctor Posted November 16, 2016 Author Posted November 16, 2016 (edited) I don't think using a position given like that is good, like you said it will fuck you over if its not walkable and not do anything. Usually you want to deagro with changing the Z coord aka walking up a ladder What if you are in a small area also? ye, there are a lot of possible errors, its faaaaaaaaar from perfect. Still though, might be useful to someone. Changing z coord would probs work better in this situation for sure Edited November 16, 2016 by PlagueDoctor