Jump to content

elbojoloco

Members
  • Posts

    8
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

619 profile views

elbojoloco's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. Hello i would like a trail for rooftop course agility
  2. Hi, In my code I use this simple piece to check if an entity is visible, if not, rotate the screen so it becomes visible: if (!vein.isVisible()) { log ("Vein is not in screen, rotating camera..."); if (getCamera().toEntity(vein)) { log("Turned into view"); } } However even when the vein is not visible, it is still returning true and doesn't rotate the camera, is there any other way to check reliably?
  3. Hey, how do I get the closest to me from the getObjects().getAll() part?
  4. Thanks for your answer! Will this get all objects that are currently in my client/window?
  5. Hi, my getObjects().closest("Ore vein") seems to only look for Ore vein within a 3-4 tile radius, is there any way I can increase that to the whole screen or any bigger amount?
  6. I fixed it by checking wether the object located at the clicked vein's coordinates name equals "Depleted vein". Another issue i am walking into: the getObjects().closest() is not looking further than 3-4 tiles it seems, I want it to look on the whole screen, how can i do that?
  7. Nope, it just instantly quits the conditionalsleep and starts new loop.... I've discovered on the forums that apperantly an Ore vein has multiple states but I dont know how to take that vein and listen to any state changes for example, if there was a callback for a state change thatd be amazing.. or something along those lines..
  8. Hi, I started learning bot scripting yesterday, I have a programming background but no experience in Java. So I've been working on a simple Motherlode script and I'm getting stuck at the very start already, it is clicking the same Ore vein multiple times. I can figure out part of the reason, is because I do a myPlayer().isAnimating() check and when the mining animation is done, the bot thinks that it needs to check for the closest vein again, so I've added a contidionalsleep to my script to help wait until the vein.exists() is false, but that does not work for me as the condition (vein.exists()) is returning false even when I can see that the last clicked vein is still there and my char is mining it. so heres my code: package core; import java.awt.Graphics2D; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest ( author = "elbojoloco", info = "Mines in motherlode.", name = "Modderload Ultra", version = 1, logo = "" ) public class Main extends Script { private RS2Object lastClickedVein; @Override public void onStart() { log("Let's get started!"); } @Override public int onLoop() throws InterruptedException { log("Getting closest vein..."); RS2Object vein = getObjects().closest("Ore vein"); if (vein != null && !getInventory().isFull() && !myPlayer().isAnimating() && !myPlayer().isMoving() && getMap().canReach(vein) && !vein.equals(this.lastClickedVein)) { log("Checks passed, intracting with vein.."); if (vein.interact("Mine")) { log("Interacted with vein, going to sleep until vein no longer exists.."); this.lastClickedVein = vein; new ConditionalSleep(random(50000, 60000), random(500, 1500)) { @Override public boolean condition() throws InterruptedException { log("Checking vein existence: " + vein.exists()); return !vein.exists(); // I've tried with and without exclamation, no results. } }.sleep(); log("Vein no longer exists, looping"); } } else { log("Vein checks not passed"); } return random(500, 1000); } @Override public void onExit() { log("Thanks for running my Modderload Ultra!"); } @Override public void onPaint(Graphics2D g) { g.drawString("Hello World", 50, 50); } } EDIT: So my question being, why is vein.exists() returning false when the Ore vein is still there, why is my additional security of checking !vein.equals(this.lastClickedVein) also not working? I am getting suspisions that after gathering pay-dirt from the Ore vein, it changes the object Ore vein in some way that makes me think the old Ore vein is no longer there, or the same as it used to be? Just a shot in the dark.. Any help would be appreciated!
×
×
  • Create New...