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.

Shift Clicking (Is it possible with current API)

Featured Replies

Hey!

I am trying to implement shift-clicking on Rune Essence Pouches in order to empty them in one click.

This is similar to this shift click drop feature.

 

Is it possible to implement this with current API, as I have not found much hope around the interact function within the ItemContainer class.

 

Cheers,

D

 

UPDATE:

SOLUTION for emptying pouches:

After some discussion on trials I came up with the following:

Quote

getKeyboard().pressKey(16);
getInventory().getItem("Large pouch").interact("Empty");
getKeyboard().releaseKey(16);

 

 

Edited by lolhelllol

getInventory.drop("item");

.....

That's all you need.

Have it enabled on your acc and it will use it.....

Pls look at API before posting next time.. .. . . .... .

 

 

... ....

Edited by Juggles

35 minutes ago, Juggles said:

getInventory.drop("item");

.....

That's all you need.

Have it enabled on your acc and it will use it.....

Pls look at API before posting next time.. .. . . .... .

 

 

... ....

jojo plz u cant expect people to search things and do research for themselves on osbot ;( 

You could get the keyboard and mouse instance and send a shift and left click I guess.

 

getKeyboard().pressKey(*KEYCODE FOR SHIFT*);
getMouse().click(false);
getKeyboard().releaseKey(*SAME KEYCODE FOR SHIFT*);

 

This would presumably work.

Edited by mr magoo

14 hours ago, Juggles said:

getInventory.drop("item");

.....

That's all you need.

Have it enabled on your acc and it will use it.....

Pls look at API before posting next time.. .. . . .... .

 

13 hours ago, Muffins said:

jojo plz u cant expect people to search things and do research for themselves on osbot ;( 

Why you guys going at him like that, when he is asking for something completely different :feels:

He wants to know if you can use Shift to empty the rune pouches with the API, which there isn't :boge: (AFAIK)

You just need to make your own method, by using getKeyboard() and holding down shift key > Do action > release shift key

  • Author
On 27/09/2017 at 5:10 PM, Juggles said:

getInventory.drop("item");

.....

That's all you need.

Have it enabled on your acc and it will use it.....

Pls look at API before posting next time.. .. . . .... .

2

Thanks, I did try to look it up first.

But, I wasn't sure how to interpret the descriptions in the API for drop.

image.png.af9bf23a4d3959a6f39737f7f6b2f26d.png

drop() does not work with emptying pouches

Edited by lolhelllol

  • Author
10 hours ago, Viston said:

 

Why you guys going at him like that, when he is asking for something completely different :feels:

He wants to know if you can use Shift to empty the rune pouches with the API, which there isn't :boge: (AFAIK)

You just need to make your own method, by using getKeyboard() and holding down shift key > Do action > release shift key

Cheers for the understanding,

I just tested out what Jnuggles posted and it turns out that .drop() doesn't work on pouches with the current API.

Having to use a manual method :(

Edited by lolhelllol

So, when you shift click the rune pouch it automatically uses the empty option for the item?

 

To make matters simpler I'm just going to assume the pouch is always in the first slot. It wouldn't be a bad idea to hard code it as players generally have a preferred location of the pouch. If you want to abstract it for it being in any position in the inventory, searching for it would be a good exercise to learn from.

 

		getMouse().move(getInventory().getMouseDestination(0));
		getKeyboard().pressKey(KeyEvent.VK_SHIFT);
		getMouse().click(false);
		getKeyboard().releaseKey(KeyEvent.VK_SHIFT);

 

This will shift click the first item (index 0) in your inventory.

 

Edit: be sure to import the necessary KeyEvent package:

import java.awt.event.KeyEvent;

Edited by mr magoo

7 hours ago, mr magoo said:

So, when you shift click the rune pouch it automatically uses the empty option for the item?

 

To make matters simpler I'm just going to assume the pouch is always in the first slot. It wouldn't be a bad idea to hard code it as players generally have a preferred location of the pouch. If you want to abstract it for it being in any position in the inventory, searching for it would be a good exercise to learn from.

 


		getMouse().move(getInventory().getMouseDestination(0));
		getKeyboard().pressKey(KeyEvent.VK_SHIFT);
		getMouse().click(false);
		getKeyboard().releaseKey(KeyEvent.VK_SHIFT);

 

This will shift click the first item (index 0) in your inventory.

 

Edit: be sure to import the necessary KeyEvent package:

import java.awt.event.KeyEvent;

No need to call getMouse.move() because he can just click the item in the inventory directly.

getInventory().getItem("Essence Pouch").interact("Empty");

Since shift clicking will make the left click the option "Empty" it'll just left click it :)

Edited by Viston

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.