Lord 0 Share Posted September 7, 2015 HI Guys, I'm new here and starting to get in to making scripts. I can already script for a RSPS(parabot) but this is slightly more complex. Please could you tell me why my strategy is just clicking on the tile and now banking? Any help would be amazing!!!! https://gist.github.com/lordgmage/0eb7e91563e82cbab268 Link to comment Share on other sites More sharing options...
Nuclear Nezz 2061 Share Posted September 8, 2015 I had helped you out with this yesterday didn't I? ;o Did you ever test with a regular script to see if getBank().isOpen() or getBank().open() works outside of your framework? Link to comment Share on other sites More sharing options...
randalthor 6 Share Posted September 9, 2015 I noticed one way that you could refactor your code in many locations. If you are using java 1.8(8), wherever you have a sleepUntil() method you can use a lambda expression instead of verify. Here is a sample of your code: line 30-35 MethodProvider.sleepUntil(new Condition() { @Override public boolean verify() { return script.getWalking().walkExact(finalDestination); } }, 1000); And here is code that does the exact same thing: MethodProvider.sleepUntil(() -> script.getWalking().walkExact(finalDestination),1000); you could also encase it in an if statement where it will be true if the condition is met or false if the sleepUntil ends due to the time being reached if(MethodProvider.sleepUntil(() -> script.getWalking().walkExact(finalDestination),1000)) { //code for when condition is met here aka when (script.getWalking().walkExact(finalDestination)) } You have 5 of these verify() blocks which means you can refactor out 20 lines of code to make that class 51 line long As for why your code isn't running, could you post the AbstractScript class you are trying to use with it and the Strategy class it extends. I don't see anything here that would be causing a problem A general problem with the api banking method is it sometimes struggles to open the bank at certain camera angles. It looks botlike, but you could do getCamera().rotateToEntity(getBank()); before attempting to open the bank Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.