whipz Posted February 16, 2017 Posted February 16, 2017 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
Explv Posted February 16, 2017 Posted February 16, 2017 (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 February 16, 2017 by Explv 1
whipz Posted February 16, 2017 Author Posted February 16, 2017 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
whipz Posted February 16, 2017 Author Posted February 16, 2017 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
Chris Posted February 16, 2017 Posted February 16, 2017 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 1
M1tch Posted February 16, 2017 Posted February 16, 2017 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
whipz Posted February 16, 2017 Author Posted February 16, 2017 (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 February 16, 2017 by whipz
Chris Posted February 17, 2017 Posted February 17, 2017 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
Chris Posted February 17, 2017 Posted February 17, 2017 if (shit is selected) getMouse().click(new InventorySlotDestination(getBot(), 27)); 1
Magarac Posted February 17, 2017 Posted February 17, 2017 you don't code in the shower like the rest of us? pshhh 1
whipz Posted February 17, 2017 Author Posted February 17, 2017 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 ! 1
whipz Posted February 17, 2017 Author Posted February 17, 2017 (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 February 17, 2017 by whipz
Stimpack Posted February 18, 2017 Posted February 18, 2017 (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 February 18, 2017 by Stimpack 1
whipz Posted February 18, 2017 Author Posted February 18, 2017 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 !