February 18, 20178 yr Author 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 )':
February 19, 20178 yr 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
February 19, 20178 yr Author 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
February 19, 20178 yr Author 22 minutes ago, Stimpack said: should work I dunno what I am doing wrong then )':
February 19, 20178 yr if (item != null && getInventory().interact(27, "Use")) { log("KappaPride"); } Do this instead: if(item != null && item.interact()){ Edited February 19, 20178 yr by Molly
February 19, 20178 yr Author 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 !
February 19, 20178 yr Author 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 ):
February 19, 20178 yr Author 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...
February 20, 20178 yr 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, 20178 yr by Stimpack
February 20, 20178 yr Author 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 (:
Create an account or sign in to comment