whipz Posted February 18, 2017 Author Posted February 18, 2017 20 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"); } } Unfortunately this still doesn't work ): It says its going to use it but just spams my console saying using slot 27 but doesnt )':
Stimpack Posted February 19, 2017 Posted February 19, 2017 that's strange, the only thing that's logged to console is "KappaPride". you should probably check there's only 1 script in your script folder and it's the one you just compiled 1
whipz Posted February 19, 2017 Author Posted February 19, 2017 31 minutes ago, Stimpack said: that's strange, the only thing that's logged to console is "KappaPride". you should probably check there's only 1 script in your script folder and it's the one you just compiled Yeah i changed the log to using slot 27 it just sits the logging that constantly; was I ment to add something else to make it click the slot ? i just assumed .interact even in an if would run the interact part as well ? or am i mistaken
whipz Posted February 19, 2017 Author Posted February 19, 2017 22 minutes ago, Stimpack said: should work I dunno what I am doing wrong then )':
Molly Posted February 19, 2017 Posted February 19, 2017 (edited) if (item != null && getInventory().interact(27, "Use")) { log("KappaPride"); } Do this instead: if(item != null && item.interact()){ Edited February 19, 2017 by Molly 1
whipz Posted February 19, 2017 Author Posted February 19, 2017 2 hours ago, Molly said: if (item != null && getInventory().interact(27, "Use")) { log("KappaPride"); } Do this instead: if(item != null && item.interact()){ Thanks mate Ill try when I get home from work !
whipz Posted February 19, 2017 Author Posted February 19, 2017 18 hours ago, Molly said: if (item != null && getInventory().interact(27, "Use")) { log("KappaPride"); } Do this instead: if(item != null && item.interact()){ if (getInventory().interact("Use", "Knife") && new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getInventory().isItemSelected(); } }.sleep()) { final Item item = getInventory().getItemInSlot(27); if (item != null && item.interact()) { log("Attempting to use slot 27"); item.interact("Use"); } } This is what I have and for some reason it will log attempting to use slot 27 but it just stands there and does nothing ):
whipz Posted February 19, 2017 Author Posted February 19, 2017 7 minutes ago, Stimpack said: show pic of ur inventory you got skype ?
whipz Posted February 19, 2017 Author Posted February 19, 2017 HOLY FUCK IM STUPID...... I just did a test final String test = inventory.getIteminSlot(27).toString(); prints out slot 28.... I totally forgot that it goes 0 1 2 3 4 5 etc.... fuck sorry guys you were all right...
Stimpack Posted February 20, 2017 Posted February 20, 2017 (edited) 1 hour ago, whipz said: HOLY FUCK IM STUPID...... I just did a test final String test = inventory.getIteminSlot(27).toString(); prints out slot 28.... I totally forgot that it goes 0 1 2 3 4 5 etc.... fuck sorry guys you were all right... editerino java uses zero based indexing here's a quote Quote The index in an array is not really an index. It is simply an offset that is the distance from the start of the array. The first element is at the start of the array so there is no distance. Therefore the offset is 0. Edited February 20, 2017 by Stimpack 1
whipz Posted February 20, 2017 Author Posted February 20, 2017 38 minutes ago, Stimpack said: editerino java uses zero based indexing here's a quote Yeah man I just completely forgot haha feel like a douche haha thanks tho mate for all your help (: