Jump to content

Explv

Scripter II
  • Posts

    2314
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    100%

Everything posted by Explv

  1. If you want to make a list like that it would be a lot cleaner to do: private final List<Position> TO_BANK = Arrays.asList(new Position[]{ new Position(random(3323, 3320), random(3137,3141), 0)); new Position(random(3318, 3321), random(3144,3147), 0); new Position(random(3307,3313), random(3146, 3152), 0); new Position(random(3301,3305), random(3149,3152), 0); new Position(random(3288,3297), random(3147, 3150), 0); new Position(random(3280, 3289), random(3150, 3153), 0); new Position(random(3276, 3279), random(3155, 3158), 0); new Position(random(3273, 3278), random(3160, 3163), 0); new Position(random(3269, 3272), random(3162,3170), 0); }); But yeah, use the web walker instead: getWalking().webWalk(new Position(0, 0, 0));
  2. No code after a return statement will be executed.
  3. Explv

    Explv's Walker

    Yeah the script is broken rn, haven't had the time to fix it.
  4. Update Java to the latest version. You should really update your OS too.
  5. 1) For your runeCheck method you should use a switch not if else statements. 2) When comparing Strings, like in your runeCheck method you should use .equals() not == For Strings, == compares references, where as .equals() compares the values. 3) Your runeCheck method can be replaced with, getMagic().canCast(teleport); 4) Formatting. 5) Stop using this. where you don't need to. This. is a reference to the current object. It is not needed to refer to fields in the current object, unless you have a parameter with the same name. 6) Use my time formatting method, it looks nicer public String formatTime(long ms){ long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24; s %= 60; m %= 60; h %= 24; return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) : h > 0 ? String.format("%02d:%02d:%02d", h, m, s) : String.format("%02d:%02d", m, s); } 7) You don't need to store currentXp, or timeRan, or any variables like that. This information can be calculated when needed, or obtained using the ExperienceTracker and are not used in any other methods. For example there is the gainedLevels and gainedXp methods in ExperienceTracker. 8) Seriously, formatting.
  6. Just do a really long ConditionalSleep. For example if you are smelting Gold bars you could do something like: private final ConditionalSleep SMELTING_SLEEP = new ConditionalSleep(100_000) { @Override public boolean condition() throws InterruptedException { return !getInventory().contains("Gold ore"); } }; When you start smelting, you can call: SMELTING_SLEEP.sleep(); And it will then sleep for up to 100 seconds, or until the inventory no longer contains Gold Ore
  7. getWalking().walk(position); or getWalking().webWalk(position);
  8. Or just go to http://www.javadecompilers.com/
  9. You should probably learn what that means..
  10. The simplest way to open a bank without spam clicking is using the following method: public void openBank() throws InterruptedException{ getBank().open(); // Open the bank new ConditionalSleep(5000) { // Sleep until the bank is open, or for 5 seconds @Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep(); } The same logic can be applied to many different tasks in scripts. For example, if you wanted to chop down a tree, to prevent spam clicking you could do something like: @Override public int onLoop throws InterruptedException { if(!myPlayer().isAnimating()){ chopDownTree(); // Chop down a tree if we're not animating } return random(200, 300); } private void chopDownTree(){ RS2Object tree = S.getObjects().closest("Tree"); if(tree != null){ tree.interact("Chop down"); // Chop down the tree new ConditionalSleep(5000) { // Sleep until the player is animating, or for 5 seconds @Override public boolean condition() throws InterruptedException { return S.myPlayer().isAnimating(); } }.sleep(); } }
  11. Explv

    Explv's Walker

    Yeah I know, I have pushed a solution to the SDN, just waiting for the SDN to be updated. Problem is the bugs aren't reproducible on my local version. They only occur on the SDN :P
  12. There are plenty of Java tutorials on the internet. Once you are familiar with Java read the scripting tutorials in the Scripting help section, and check out the API which can be found in the navigation bar above.
  13. Explv

    Explv's Walker

    The SDN hasn't been updated yet....
  14. It will most likely be based on the widgets in the spell tab. The spells will have different widget values when they are highlighted (can cast) and when they are not. Therefore using this method you need to change to the spell tab to check it. The only other alternative is to check your supplies in the inventory & equipment.
  15. Check if your inventory contains the runes... private boolean canTeleportToVarrock(){ return getInventory().contains("Fire rune") && getInventory().contains("Law rune") && getInventory().getAmount("Air rune") >= 3; }
  16. Explv

    Explv's Walker

    I have been busy at work... I will take a look at it this weekend. Please be patient Edit: Issue should be resolved. The script should work once the SDN is updated.
  17. You missed out your username from the config path. You put @c:\Users\Desktop\... rather than @C:\Users\Cody\Desktop\... Also in the .pro file where you have put package.Core that should be replaced with your package name. If your main script file Core is not in a package, just put -keep public class Core
  18. Explv

    Explv's Walker

    Issue should be fixed shortly
  19. There is a new walking method too you know: walking.walk(position); And its probably an issue with your Script, not the OSBot API
  20. Nope, studied CS, currently working as a Software Engineer.
×
×
  • Create New...