Fran 99 Share Posted February 25, 2015 Hey guys, hope you're doing good, Can someone please provide me an example of using an inventory item on another inventory item? Thanks in advance! Link to comment Share on other sites More sharing options...
SpareGold 4 Share Posted February 26, 2015 log("Burning"); Item logs = getInventory().getItem("Logs"); Item tinderbox = getInventory().getItem("Tinderbox"); if(//Stuff isnt null) { tinderbox.useOn(2); logs.useOn(2); } This is what I did to light a fire. i couldn't find any other working solutions, this basically just selects the first item and then selects the second, thus lighting the fire. Link to comment Share on other sites More sharing options...
Pandemic 2714 Share Posted February 26, 2015 Does this not work? getInventory().getItem("Logs").useOn("Tinderbox"); Link to comment Share on other sites More sharing options...
Vlad 216 Share Posted February 26, 2015 Does this not work? getInventory().getItem("Logs").useOn("Tinderbox"); Nope. It seems like getSelectedItem() is broken. It seems to always be an empty String, "". Link to comment Share on other sites More sharing options...
Pandemic 2714 Share Posted February 26, 2015 Nope. It seems like getSelectedItem() is broken. It seems to always be an empty String, "". Sounds like a hook issue, I'll fix right now Link to comment Share on other sites More sharing options...
Fran 99 Author Share Posted February 26, 2015 Does this not work? getInventory().getItem("Logs").useOn("Tinderbox"); Hi Pandemic! That doesn't work :S Edit resolved: Item tinderbox = getInventory().getItem("Tinderbox"); Item logs = getInventory().getItem("Logs"); getDialogues().clickContinue(); if(tinderbox != null && logs != null){ getInventory().interactWithItem("Tinderbox", "Use"); getInventory().interactWithItem("Logs", "Use"); log("Burning logs"); MethodProvider.sleepUntil(new Condition() { @Override public boolean verify() { return getInventory().getItem("Tinderbox").useOn("Logs"); } }, 10000); } Link to comment Share on other sites More sharing options...
Vlad 216 Share Posted February 26, 2015 Sounds like a hook issue, I'll fix right now Seems like it wasn't. My bad. Not sure why it didn't work that time. getInventory().getItem("Logs").useOn("Tinderbox"); still doesn't work though. I made some work around code for that though for anyone needing it: if (getItemContainer().getInventory().contains("Feather", "Newcomer map")) { String select = getItemContainer().getInventory() .getSelectedItemName(); if (select != null && select.contains("Feather")) { getInventory().interactWithItem("Newcomer map", "Use"); } else { getInventory().interactWithItem("Feather", "Use"); } } Link to comment Share on other sites More sharing options...
Pandemic 2714 Share Posted February 26, 2015 Seems like it wasn't. My bad. Not sure why it didn't work that time. getInventory().getItem("Logs").useOn("Tinderbox"); still doesn't work though. I made some work around code for that though for anyone needing it: if (getItemContainer().getInventory().contains("Feather", "Newcomer map")) { String select = getItemContainer().getInventory() .getSelectedItemName(); if (select != null && select.contains("Feather")) { getInventory().interactWithItem("Newcomer map", "Use"); } else { getInventory().interactWithItem("Feather", "Use"); } } Wasn't a hook issue, was a noto issue It'll be fixed in the next version (tonight possibly). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.