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.

Override default interact timer

Featured Replies

I'm currently working on some scripts that require faster reaction times from the bot. The animation timer for thieving is ~4 ticks per action. The method f.iteract("Pickpocket") will match the default animation timer. My goal is to get it somewhere around 2-2.5 tick reaction time rather than 4. Is there anyway to modify the speed of method or will I have to write my own work around?

Edited by clanket

  • Author

Here's a quick class that you can use to override the default interaction timers. 

import org.osbot.rs07.utility.*;
import java.util.function.*;

public final class Sleep extends ConditionalSleep {
	private final BooleanSupplier condition;

	public Sleep(final BooleanSupplier condition, final int timeout) {
		super(timeout);
		this.condition = condition;
	}

	public Sleep(final BooleanSupplier condition, final int timeout, final int interval) {
		super(timeout, interval);
		this.condition = condition;
	}

	public boolean condition() throws InterruptedException {
		return this.condition.getAsBoolean();
	}

	public static boolean sleepUntil(final BooleanSupplier condition, final int timeout) {
		return new Sleep(condition, timeout).sleep();
	}

	public static boolean sleepUntil(final BooleanSupplier condition, final int timeout, final int interval) {
		return new Sleep(condition, timeout, interval).sleep();
	}

}

Now to override the interaction speed for something like pickpocketing all you have to do is.

	if(targetWithAHugeDong.interact("Pickpocket")){
					Sleep.sleepUntil(() -> myPlayer().exists(), random(950, 1500));
					break;
				};

You can now modify the speed at which you click/interact with the target. It no longer requires the animation to finish. I'll post all my 2-3 tick scripts publicly when I'm done skilling to 99. ?

27 minutes ago, clanket said:

Here's a quick class that you can use to override the default interaction timers. 

Now to override the interaction speed for something like pickpocketing all you have to do is.

You can now modify the speed at which you click/interact with the target. It no longer requires the animation to finish. I'll post all my 2-3 tick scripts publicly when I'm done skilling to 99. ?


That doesn't change the actual time .interact() takes to complete. OP wants to know if there is a way to make the interact() method faster, which there is not. OP would have to write his own interact() method.

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.