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.

Item Hovering?

Featured Replies

As part of the Osbot Item API:

public boolean hover()

Description copied from interface: Interactable

Attempts to hover the mouse over the next click needed to interact with this Interactable.
This method will never click the mouse, so it can be used to speed up scripts while they are idling.

Could somebody give me an example of how you would implement this? I am trying to make the script hover the user's mouse over the next log to increase the script's burn speed.

 

This is my current item interaction method.

private boolean interactItems(String itemOne, String itemTwo) throws InterruptedException
{
     if (inventory.getItem(itemOne).interact("use"))
     {
	sleep(random(600,700));
	return inventory.getItem(itemTwo).interact();
     }
     return false;
}

Thanks.

 

Edit: I'm assuming I'll be needing the mouse method so I will change my interact method accordingly.

Edited by steve498

Item item = getInventory().getItem("blah");

 

item.hover();

 

 

You could do some checks to see if the mouse is within the item's bounding box; if not do hover else already hovering item.

 

  • Author

Item item = getInventory().getItem("blah");

 

item.hover();

 

 

You could do some checks to see if the mouse is within the item's bounding box; if not do hover else already hovering item.

 

Thanks exactly what I was looking for. 

  • Author

Sorry for double post, so just an update, I currently have this:

if(getInventory().contains(itemOne) && getInventory().contains(itemTwo))
    	{
    		// Inventory locations of both items
    		Item firstItem  = getInventory().getItem(itemOne);
    		Item secondItem = getInventory().getItem(itemTwo);
    		
    		// Use items on eachother
    		firstItem.interact("use");
    		sleep(random(300, 430));
    		secondItem.interact();
    		
    		// If a fire is below us then we need drop control of the mouse. Otherwise, a mouse conflict will occur. However, if a fire is not below us then we can pre-hover over the next item.
    		if (IsFireBelowUs() == false) {
    			sleep(random(550, 600));		
	    		firstItem.interact("use");
    		}
    	}

Although this it works fine, half way through an inventory of interacting it will stop pre-hovering on the next item. Any ideas? Thanks

Edited by steve498

  • Author

The logic is wrong

 

I was thinking this too. I will plan it out later and revise it.

Yea, your logic is wrong. Try to learn what boolean really is and you should do some null checks (check if item != null etc.).

 

You should also learn how to use dynamic sleep instead of static sleep. How do you know that the script should sleep between 300 and 430 ms. Why 130 ms in difference?

 

For dynamic sleep use api's ConditionalSleep.

Edited by Woody

  • Author

Yea, your logic is wrong. Try to learn what boolean really is and you should do some null checks (check if item != null etc.).

 

You should also learn how to use dynamic sleep instead of static sleep. How do you know that the script should sleep between 300 and 430 ms. Why 130 ms in difference?

 

For dynamic sleep use api's ConditionalSleep.

 

Thanks I appreciate the help :)

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.