February 16, 20178 yr 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
February 16, 20178 yr 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 February 16, 20178 yr by Explv
February 16, 20178 yr Author 5 minutes ago, Explv said: Item item = getInventory().getItemInSlot(28); If (item != null) item.interact(); Sorry about the formatting, on my phone You sir are a life saver ! Ill try this when i get out of shower; Dont worry about format its easy to read thank you
February 16, 20178 yr Author 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
February 16, 20178 yr 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
February 16, 20178 yr 9 minutes 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 this
February 16, 20178 yr Author 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 February 16, 20178 yr by whipz
February 17, 20178 yr 3 hours ago, whipz said: Not sure how exactly I am ment to use this; everything I have tried says I need to create a method; what is bot ? use Mouse api use bot api
February 17, 20178 yr if (shit is selected) getMouse().click(new InventorySlotDestination(getBot(), 27));
February 17, 20178 yr Author 1 hour ago, Magarac said: you don't code in the shower like the rest of us? pshhh God that made me laugh so much for some reason hahaha 2 hours ago, Chris said: if (shit is selected) getMouse().click(new InventorySlotDestination(getBot(), 27)); Thanks mate gonna test that now !
February 17, 20178 yr Author 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 February 17, 20178 yr by whipz
February 18, 20178 yr 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 February 18, 20178 yr by Stimpack
February 18, 20178 yr Author 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