Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Jake Slang

Members
  • Joined

  • Last visited

  1. Check my previous post. I've updated the syntax, it should work now. I made a mistake, I think I just woke up around that time, my bad.. Also,, that rawFoodName (between quotes) was just a parameter/placeholder, you should pass in the full name of the raw fish: Sleep.sleepUntil(() -> !getInventory().contains("Raw tuna"), 120000); Oh, and make sure the timeout is around 2 minutes, or else it'll try cooking again after 5 seconds. If you cook a variety of food you could also do: Sleep.sleepUntil(() -> !getInventory().contains("Raw tuna") && !getInventory().contains("Raw lobster"), 120000);
  2. Something like this: Sleep.sleepUntil(() -> !getInventory().contains("rawFoodName"), 120000); So now your player will sleep until your inventory doesn't contain the given raw food (first parameter), or until the timeout is hit (which is set to 2 minutes now). You have to think about the timeout. I've set it to 2 minutes, because the first parameter will most likely evaluate to false, but you don't want the second parameter to evaluate to true after like 3 seconds, which will loop your script again. This snippet is made because it is shorter and self-explanatory in the way you read it: Let your script sleep until the first given parameter is truthy (thus continue running your script), or until the timeout is hit (thus continue running your script). Timeout is in milliseconds btw.
  3. I guess this is the right section for posting pointless/unnecessary threads like these.. Are you trying to provoke/make people scared? People die every day.
  4. You got me again with that creative thinking Maybe it'd be SDN material if I iimplement your suggestion. I know there's another chocolate cutter in the SDN, but that one is not for money making purposes. Anyways, thanks for the tip!
  5. Hey, nice script release. That's some creative thinking (unique script).
  6. You need a conditional sleep. Now you're just sleeping for 4-5 seconds (which your script uses to cook 3 fishes before looping again). So what you want is: Sleep.sleepUntil(() -> condition, timeout); Now it will sleep until the condition (is true) or the timeout is met. The condition could be till there are no raw fishes left in your inventory. I would give the timeout some absurd number so you'll pretty much only stop cooking when the condition evaluates to true. In order to use this static sleepUntil() method, you should add this snippet under your main class: https://hastebin.com/azusobiyur.java Also check out:
  7. Thanks, bro. The starting cash is for buying in the choco bars. I'll edit the thread and make it more explicit.
  8. Hey, hey, welcome to OSBot!! I'm also a dev, hope we can all learn from each other.
  9. Laravel integrates everything you need as a Web dev.
  10. Jake Slang changed their profile photo
  11. [$] JakesChocolateGrinder (v1.1) [$] Features Cuts chocolate bar into chocolate dust for currently 60k/hour (WARNING: PRICES MAY FLUCTUATE) Banks Logs you out when out of bars Requirements 50k starting cash for buying in the choco bars (preferably a lot more for convenience) A knife (NO PESTLE & MORTAR) Configuring the script Download the .jar file Copy or cut it into your OSBot scripts folder (e.g. C:\users\username\OSBot\Scripts\) Log in on OSBot Refresh the Script Selector (the script should be added now) Instructions You have to start in Varrock East Bank (or it'll webwalk you to it)! Make sure you have a knife and chocolate bar(s) in your inventory/bank Run the script via the Script Selector and let it do its thing >:D Versions v1.0 - Initial release v1.1 - Added paint JakesChocolateGrinder.jar
  12. Jake Slang replied to Kira1's topic in General Help
    If you have a script running, you can't X it; you have to make sure that the script you're running is either paused or stopped.
  13. Ok, so I even found another bug in here. Once you your inventory is full, it'll execute the bank() method as expected, and when you depositAll(), it'll trigger the canFishShrimps() method, because when you deposit all, your inventory doesn't have that fishing net that it expects.. But since I didn't include an else if statement that conditionally asks if the (getBank().isOpen()) method is true, it would execute the else statement, thus logging out. So in the end refactoring did in fact help. This is my code after listening to @TheWind's advice: import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.MethodProvider; 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 = "Jake Slang", name = "JakesShrimpCatcher", info = "Catches shrimp (and anchovies) in Lumbridge swamp.", version = 0.1, logo = "") public final class JakesShrimpCatcher extends Script { private final Area lumbyFishing = new Area(3240, 3150, 3238, 3145); private final Position lumbyBank = new Position(3208, 3220, 2); Entity fishingSpot = null; @Override public final void onStart() { log("Is there anybody actually reading THIS?!"); } @Override public final int onLoop() throws InterruptedException { if (canFishShrimps()) { fish(); } else { bank(); } return random(200, 300); } @Override public final void onExit() { log("I guess YOU did!"); } private void fish() { if (!lumbyFishing.contains(myPosition())) { getWalking().webWalk(lumbyFishing); } fishingSpot = getNpcs().closest("Fishing spot"); if (fishingSpot != null && fishingSpot.interact("Net")) { sleepConditional(); } } private void sleepConditional() { Sleep.sleepUntil(() -> myPlayer().isAnimating() || !fishingSpot.exists(), 5000); } private void bank() throws InterruptedException { if (getInventory().isFull()) { if (!Banks.LUMBRIDGE_UPPER.contains(myPosition())) { getWalking().webWalk(lumbyBank); } if (!getBank().isOpen()) { getBank().open(); getBank().depositAll(); } else if (getBank().isOpen()) { getBank().depositAll(); } else { stop(true); } } } private boolean canFishShrimps() throws InterruptedException { if (!getInventory().contains("Small fishing net")) { if (!Banks.LUMBRIDGE_UPPER.contains(myPosition())) { getWalking().webWalk(lumbyBank); } if (!getBank().isOpen()) { getBank().open(); getBank().withdraw("Small fishing net", 1); } else if (getBank().isOpen()) { getBank().withdraw("Small fishing net", 1); } else { stop(true); } } return !myPlayer().isAnimating() && !getInventory().isFull(); } } class Sleep extends ConditionalSleep { private final BooleanSupplier condition; public Sleep(final BooleanSupplier condition, final int timeout) { super(timeout); this.condition = condition; } @Override public final boolean condition() throws InterruptedException { return condition.getAsBoolean(); } public static boolean sleepUntil(final BooleanSupplier condition, final int timeout) { return new Sleep(condition, timeout).sleep(); } }
  14. Thanks @TheWind for your comprehensive feedback. I'll read it through tomorrow. Have to get some rest now

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.