Jump to content

Help Please


Recommended Posts

Posted

Hey guys; I was just wondering how I would go around clicking the number 27 slot of inventory I have looked over the API of inventory however it doesnt really explain slots, there is a function for it but doesnt say how to define the slot like in GE and other things; 

Does anyone have a snippet or a quick throw together I could look at please

Posted (edited)
3 minutes ago, whipz said:

Hey guys; I was just wondering how I would go around clicking the number 27 slot of inventory I have looked over the API of inventory however it doesnt really explain slots, there is a function for it but doesnt say how to define the slot like in GE and other things; 

Does anyone have a snippet or a quick throw together I could look at please

Item item = getInventory().getItemInSlot(28);

If (item != null) item.interact();

 

Sorry about the formatting, on my phone

Edited by Explv
  • Like 1
Posted
1 hour ago, Explv said:

Item item = getInventory().getItemInSlot(28);

If (item != null) item.interact();

 

Sorry about the formatting, on my phone

Hey mate; Unfortunately this seems to just pick up whats in slot 27 (when i use 27) which doesn't really work the way I want as it starts at slot one again; I only it want it to use it on item slot 27, as this is faster and more realistic I can pm you what I am doing just want to keep it a little private atm

 

Posted
4 hours ago, whipz said:

Hey mate; Unfortunately this seems to just pick up whats in slot 27 (when i use 27) which doesn't really work the way I want as it starts at slot one again; I only it want it to use it on item slot 27, as this is faster and more realistic I can pm you what I am doing just want to keep it a little private atm

 

InventorySlotDestination(Bot bot, int slot)

Creates an instance of this mouse destination for an inventory slot.

 

the method explv told you only returns the item. so it will interact with the first one it finds. try the above

  • Like 1
Posted (edited)
6 hours ago, Chris said:

InventorySlotDestination(Bot bot, int slot)

Creates an instance of this mouse destination for an inventory slot.

 

the method explv told you only returns the item. so it will interact with the first one it finds. try the above

Not sure how exactly I am ment to use this; everything I have tried says I need to create a method; what is bot ? 

 

Edited by whipz
Posted (edited)
2 hours ago, Chris said:

if (shit is selected)
            getMouse().click(new InventorySlotDestination(getBot(), 27));

 

this is what I have so far but it just keeps clicking on the knife. Im so lost ):

 

if (inventory.contains(item)) {
			getInventory().getItem("Knife").interact("Use");
			new ConditionalSleep(5000) {

				@Override
				public boolean condition() throws InterruptedException {
					return getInventory().isItemSelected();

				}
			}.sleep();
			if (item != null) {
				getMouse().click(new InventorySlotDestination(getBot(), 27));
			} else {
				item.interact("Use");
			}
			sleep(random(500, 750));
		}

	}

For some reason tho it just seems to click the knife only; It never does anything else ): and I obviously have the item stated else where I can get it click on each item individually but I want to only click on 27 till all 27 items are finished

 

Edited by whipz
Posted (edited)

what's the problem

 

editerino

from what i read you want to use a knife on item slot 27? sry if i misunderstood

if (getInventory().interact("Use", "Knife") && new ConditionalSleep(5_000) {
	@Override
	public boolean condition() throws InterruptedException {
		return getInventory().isItemSelected();
	}
}.sleep()) {
	final Item item = getInventory().getItemInSlot(27);
	if (item != null && getInventory().interact(27, "Use")) {
		log("KappaPride");
	}
}

 

Edited by Stimpack
  • Like 1
Posted
3 hours ago, Stimpack said:

what's the problem

 

editerino

from what i read you want to use a knife on item slot 27? sry if i misunderstood


if (getInventory().interact("Use", "Knife") && new ConditionalSleep(5_000) {
	@Override
	public boolean condition() throws InterruptedException {
		return getInventory().isItemSelected();
	}
}.sleep()) {
	final Item item = getInventory().getItemInSlot(27);
	if (item != null && getInventory().interact(27, "Use")) {
		log("KappaPride");
	}
}

 

Thanks mate (: ill test it when I get home appreciate the help !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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