Jump to content

Jebemvammater

Members
  • Posts

    12
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Jebemvammater's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. Thanks a lot for taking the time, my dude. I think I'm slowly getting there - but shouldn't it be myPlayer().isAnimating() && myPlayer().isMoving() && tree != null && tree.interact("Chop down")) so without the !negation - i.e. if my player is animating (chopping) and if he is moving (walking to the tree after clicking) and if tree exists and if tree chopping returns true character is going to sleep? I don't really understand now why I had the !myPlayer().isAnimating and !myPlayer().isMoving() to start with (because I want to start checking the sleep if I am walking/interacting, not if I'm not?) But now I don't understand the sequence anymore - why do it in this sequence and not other way around? Anyways - employing the line above signifiantly reduced the clicking - but at times, it clicks on the tree again just after having finished to walk to it but prior to starting the chopping animination. Is there any way to limit the tree.interact to just once before checking sleep conditions? Or can I increase the "return" value at the end of my entire onLoop function, so it runs "slower" i.e. less clicking? Sry I have two science degrees but never had any programming apart from 1 course for C++ that I forgot entirely. Thanks a lot for your help
  2. Thanks a lot, Nbacon - I inserted that condition in my code above, but the thing was still spamclicking. I looked at the thread you referenced, and the video in there. Tried the Lambda thing from Explv's thread below - bot is still clicking on trees more than once ... I really don't seem to understand it. Entity tree = getObjects().closest("Tree"); if (tree != null && tree.interact("Chop down") && !myPlayer().isMoving()) { Sleep.sleepUntil(() -> !myPlayer().isAnimating(), 5000); } Could you tell me what's wrong in my understanding of the code: 1) Defines the object tree as closest tree to the player 2) The if statement works both to initiate the chopping, but also starts the sleep if the tree exists, if the interaction returned a true (so this means my player started chopping already or is this from the point that it clicked once?) and if my player is not moving 3) The sleep runs for either 5s or until my played has stopped chopping Really would appreciate any help on this - I've actually read through all threads on sleep on here and have a science degree but seems I'm a brainlet for scripting
  3. This thread is perfect for me - a complete noob who doesn't even get conditional sleep. Can someone tell me why the script below leads to my account spam-clicking trees while running towards them, and only starts sleeping only I'm chopping? How should conditional sleeps be initiated and stopped? package core; import java.awt.Graphics2D; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.util.function.BooleanSupplier; @ScriptManifest(author = "You", info = "My first script", name = "Tree chopper", version = 0, logo = "") public class Console extends Script { @Override public void onStart() { log("Let's get started!"); } @Override public int onLoop() throws InterruptedException { Entity tree = getObjects().closest("Tree"); if (tree != null && tree.interact("Chop down")) { new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); } return 500; } @Override public void onExit() { log("This is a wood chopper!"); } @Override public void onPaint(Graphics2D g) { } } How would a method for this look like (in code)? What are the arguments to start/stop the sleeps? Thanks a lot mates
  4. Yikes missed the trial - it's just 24h after you granting it, correct? Could I get another one?
  5. Could I get a trial please? Thanks!
  6. Normal setup, takes vials of water out of bank while ignoring Ranarr weed and logs out.
  7. Just logs out when trying to make unfinished potions (set to until running out of supplies, even though supplies are in the bank)
×
×
  • Create New...