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.

Cooking bot, double click

Featured Replies

try sleep untill my player is animating. (for the fire interact part)

 

What you have, sleep untill inv does not contain raw,// always returns true

edit: the way you have it set up, it returns true always, that's why its spamming

 

I think that'll work, if not, rip

Edited by dreameo

16 minutes ago, kingbutton said:

Okay so I got it to chill after it does "Cook all", and technically my code is working smoothly, but there's one thing that is unhuman like and needs to be address.

 When it tries to interact with the fire, it tries to click several times, kind of like the thing issue I had before. It doesn't bug out or anything, but it bothers me that does it, any solutions?

I tried working with the sleep, but it's not working.


public class Main extends Script {

	long lastAnimation = 0;

	@Override
	public int onLoop() throws InterruptedException {

		if (invCheck()) {
			if (fireCheck()) {

				log("Go cook");

				if (myPlayer().isAnimating()) {
					lastAnimation = System.currentTimeMillis();
				} else if (System.currentTimeMillis() > (lastAnimation + 12000)) {
					goCook();
				}
			} else {
				log("Make fire");
				makeFire();
			}
		} else {

		}

		return 50;
	}

public void goCook() {

		RS2Object fire = objects.closest("Fire");
		RS2Widget optionMenu = getWidgets().get(307, 2);

		if (inventory.interactWithNameThatContains("Use", "Raw")) {
			

			if (optionMenu != null) {
				if (optionMenu.interact("Cook All")) {
					new ConditionalSleep(random(3000, 4500)) {

						@Override
						public boolean condition() throws InterruptedException {
							return myPlayer().isAnimating();
						}
					}.sleep();

				}
			} else {

				if (!myPlayer().isAnimating() && !myPlayer().isMoving()) {

					if (fire.interact("Use")) {
						//Sleep.sleepUntil(() -> !getInventory().contains("raw"), 12000);
                        			new ConditionalSleep(random(3000, 4500)) {
						@Override
							public boolean condition() throws InterruptedException {
								return myPlayer().isAnimating();
							}
						}.sleep();
					}
				}

			}
		}

	}

 

The sleep you were using after interacting with the fire (the one I commented out in the quote) was returning true right away since your inventory will never contain anything with the exact name "raw". The conditional sleep I replaced it with should work.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

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.