Jump to content

Shift Clicking (Is it possible with current API)


lolhelllol

Recommended Posts

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
Link to comment
Share on other sites

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 ;( 

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...