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.

How to check if bot is cooking

Featured Replies

Hello I have some questions regarding the animation when cooking, so I get it when your cooking you're isAnimating() == true but when your character "gets up" to get the other fish it stops animating so my bot spams click the fish on the fire...

Any way on how I can fix this, using a conditional sleep isn't very good because I always have a random number of trouts/salmon in my inventory so this would make the bot slow.

 

 

Thanks in advance!

Hello I have some questions regarding the animation when cooking, so I get it when your cooking you're isAnimating() == true but when your character "gets up" to get the other fish it stops animating so my bot spams click the fish on the fire...

Any way on how I can fix this, using a conditional sleep isn't very good because I always have a random number of trouts/salmon in my inventory so this would make the bot slow.

 

 

Thanks in advance!

 

Put sleeps like 100,200

Timer class:

public class Timer {
   private long period;
   private long start;
   public Timer(long period) {
       this.period = period;
       this.start = System.currentTimeMillis();
   }
   public long getElapsed() {
       return System.currentTimeMillis() - this.start;
   }
   public long getRemaining() {
       return this.period - this.getElapsed();
   }
   public boolean isRunning() {
       return this.getElapsed() <= this.period;
   }
   public void setPeriod(long period) {
       this.period = period;
   }
   public void reset() {
       this.start = System.currentTimeMillis();
   }
   public static String format(long milliSeconds) {
       long secs = milliSeconds / 1000L;
       return String.format("%02d:%02d:%02d", new Object[] { Long.valueOf(secs / 3600L),
               Long.valueOf(secs % 3600L / 60L), Long.valueOf(secs % 60L) });
   }
}
Then simply implement it like this:

Timer timer = new Timer(4000);
if(myPlayer().isAnimating()){
    timer.reset();
}
if(timer.getElapsed()  > 4000){ 
   //do stuff
}
That should work, just change the 4000 into the time it takes to cook the whole inventory in miliseconds

Actually change the time it takes to cook one and the delay in between, 4000ms should work.

Edited by Vilius

You could just add timer and reset it everytime you receive new cooked food.

Timer class:

 

public class Timer {
   private long period;
   private long start;
   public Timer(long period) {
       this.period = period;
       this.start = System.currentTimeMillis();
   }
   public long getElapsed() {
       return System.currentTimeMillis() - this.start;
   }
   public long getRemaining() {
       return this.period - this.getElapsed();
   }
   public boolean isRunning() {
       return this.getElapsed() <= this.period;
   }
   public void setPeriod(long period) {
       this.period = period;
   }
   public void reset() {
       this.start = System.currentTimeMillis();
   }
   public static String format(long milliSeconds) {
       long secs = milliSeconds / 1000L;
       return String.format("%02d:%02d:%02d", new Object[] { Long.valueOf(secs / 3600L),
               Long.valueOf(secs % 3600L / 60L), Long.valueOf(secs % 60L) });
   }
}
Then simply implement it like this:

Timer timer = new Timer(4000);
if(myPlayer().isAnimating()){
    timer.reset();
}
if(timer.getElapsed()  > 4000){ 
   //do stuff
}
That should work, just change the 4000 into the time it takes to cook the whole inventory in miliseconds

Actually change the time it takes to cook one and the delay in between, 4000ms should work.

 

how do you stop it?

 

i guess

public void Stop()
{
  start = 0;
}

Edited by The Hero of Time

how do you stop it?

i guess

public void Stop(){  start = 0;}

Or just create a pause, stop, resume method. Isn't that hard.

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.