Jump to content

jca

Members
  • Posts

    391
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Everything posted by jca

  1. 99 fishing / cooking / woodcutting. Received a 2 day for Karambwans.
  2. I would spend less time worrying about what other people target for their GP/hr and more time working out what works for you.
  3. jca

    Buying accounts

    Checkout my site, link in bio.
  4. Looks good bro! Excited to see progress. What are your short term goals?
  5. I'm checking for greater than. Greater than: > checks if the reference on the left is greater than the reference on the right. Less than: < check if the reference on the left is less than the reference on the right. 5 > 2 // true 2 < 5 // true 5 < 2 // false So if the shop has greater than 0 buy the soda ash. To check if it's false add an exclamation mark before the boolean function. if ( !sodaAshToBuy() ){ //hop }
  6. It’s throwing a NullPointerException because you’re calling getItemAmount() on a widget that doesn’t exist somewhere in the loop. private boolean sodaToBuy(){ RS2Widget sodaAsh = getWidgets().get(300, 16, 23); return sodaAsh != null && sodaAsh.getItemAmount() > 0; } Also you don't need to use the equal to operator when checking booleans, instead if ( sodaToBuy() ){ buySoda(); }
  7. For each boolean return widget != null && widget.getItemAmount() > 0;
  8. getWalking().walk(Position p); Has a minimum distance threshold greater than zero, so if you’re within the threshold (I’m not 100% what it is) the event is considered successful. You need a custom walk event. WalkingEvent myWalk = new WalkingEvent(Position p); myWalk.setMinDistanceThreshold(0); execute(myWalk); Also you should restructure to avoid while() loops.
  9. I see. private long strengthXp; public int onLoop(){ if ( myPlayer().isAnimating() && hasGainedStrengthXp() ){ strengthXp = getExperienceTracker().getGainedXp(Skill.STRENGH); return 3000; } else { // do loop } return 200; } private boolean hasGainedStrenghtXp(){ return getExperienceTracker().getGainedXp(Skill.STRENGTH) > strengthXp; } This will check whether your player is animating and current strength experience is greater than previous strength experience, if it is then set new strength xp gauge and pause for 3 secs until the next check. You can improve this with a conditional sleep and interval to check.
  10. What you're doing seems a little strange... public int onLoop(){ if ( ! myPlayer().isAnimating() ){ if ( needsToRefuelStove() ){ refuelStove(); } else if ( needsToShovelCoke() ){ shovelCoke(); } else { operatePump(); } } return 200; } private void refuelStove(){} private void shovelCoke(){} private void operatePump(){ RS2Object pump = getObjects().closest("Pump"); if ( pump != null && pump.interact("Operate") ){ new ConditionalSleep(3000){ @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep() } } /* Booleans for you to fill */ private boolean needsToRefuelStove(){ return false; } private boolean needsToShovelCoke(){ return false; } By splitting your code out like this it's a lot easier to see what's going on. As far as checking strength XP, a better way would be to check if your player is animating, if so you don't need to do anything, if not then see which action is next.
  11. jca

    Hello!

    Welcome to the community! Just be genuine and helpful, you'll soon build up a rep.
  12. 125k ea. Can supply immediately
  13. getObjects().closest("Ore vein") That will return the closest object with that name from all the objects in getObjects().getAll(), which returns all the objects in the loaded region. If you want to use getAll() use Java's stream API. getObjects().getAll().stream().filter(obj -> obj.getName().equalsIgnoreCase("Ore vein")).findFirst().orElse(null); That will return the first object in the collection with the name "Ore vein". If you want to compare distance that you have to use .min()
  14. Show us all of your code so we can help If the widget exists just call getWidgets().get(465, 24, 53).interact()
  15. It will get all objects in the loaded region
  16. Coordinates are not the best way to do it. Look at the debug. getObjects().getAll() returns all objects in the loaded region, if closest() is within 3-4 tiles it’ll return that.
  17. Use the entity hover debug to look at what you need to listen for
  18. Actually my original answer was incorrect on reading the code. Try new ConditionalSleep(random(50_000, 60_000), random(500, 1500)) { @Override public boolean condition() throws InterruptedException { log("Can mine? " + vein.hasAction("Mine")); return !vein.hasAction("Mine"); // I've tried with and without exclamation, no results. } }.sleep();
  19. Well done on the project... if you need any help go ahead and ask! All the best with future releases.
  20. A win is what we need for sure
  21. Bring it on for Saturday's game then!
×
×
  • Create New...