Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question How to get items onto the Action bar?

Joined
Oct 24, 2015
Messages
82
What is the best way to get an item that is currently in your inventory onto the action bar?

This is useful for power-mining and fishing.

I cant seem to find a way to get it to do it, ether automatically or work out a way to get the client to drag the item.

Thanks.
 
Java Warlord
Joined
Nov 17, 2014
Messages
4,906
I did and there is very little information about getting an item on to the action bar. At the moment i have my bot working fine if you manually do it. But i would like it so the bot will do it.
So how do you bring things into the actionbar yourself?
 
Joined
Aug 23, 2015
Messages
1,961
no get the bot to do it not yourself... That is what im asking.
Find API calls to mimic the steps you take you put an item there.

-Move mouse to the item
-Press and hold left mouse button
-Find an open actionbar slot
-Drag the item to it
-Release the button

The Jdocs have calls to help you with each step, and if you look around a bit you may find something to make the coding easier.
 
Joined
Oct 24, 2015
Messages
82
Get the interactable bounds for the slot and the item in your inventory, then feed them into mouse.drag

Yeah thats basilica what i did!

Code:
ActionBarQueryResults a = ActionBar.newQuery().empty(true).results();
SpriteItem b = Inventory.newQuery().names("Raw catfish").results().first();
Mouse.drag(b.getInteractionPoint(), a.get(0).getInteractionPoint());
Execution.delayUntil(() -> !Mouse.isMoving(), 1000, 4000);
Execution.delay(500,3000);
That works for me i guess.

BTW i think ActionBar.newQuery().empty(true).results() is fucked as even if there are spaces that are not empty they will be in that list. Unless im miss understanding the .empty(true) thing.

Maybe a bug.
 
Last edited:
Joined
Oct 24, 2015
Messages
82
Filled is default to true, so you will need to add in a .filled(false) to your wuery

Ok this is weird, This is how my current bar is set up (http://i.imgur.com/i6HThx2.png)
i6HThx2.png

and when i do
Code:
ActionBarQueryResults a = ActionBar.newQuery().filled(true).results();
System.out.println(a);

Results:
ActionBarQueryResults[ActionBar.Slot{index=0}, ActionBar.Slot{index=1}, ActionBar.Slot{index=2}, ActionBar.Slot{index=3}, ActionBar.Slot{index=4}, ActionBar.Slot{index=5}, ActionBar.Slot{index=12}]

And if i do:
Code:
ActionBarQueryResults a = ActionBar.newQuery().filled(false).results();
System.out.println(a);

Results:

ActionBarQueryResults[]

Any ideas?
 
Top