Jump to content

Help Please


whipz

Recommended Posts

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

Link to comment
Share on other sites

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

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

 

Link to comment
Share on other sites

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

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

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

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

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 !

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...