PwneRL33T Posted August 24, 2014 Share Posted August 24, 2014 title says it all really, ive been searching the API for about an hour now but cant figure out how to put the code together... can anyone tell me what the code is for interacting with an inventory item? i was hoping it would be as simple as this... but its not if (inventory.contains("Bird's Nest")){ item.interact("Search"); } Link to comment Share on other sites More sharing options...
Isolate Posted August 24, 2014 Share Posted August 24, 2014 (edited) title says it all really, ive been searching the API for about an hour now but cant figure out how to put the code together... can anyone tell me what the code is for interacting with an inventory item? i was hoping it would be as simple as this... but its not if (inventory.contains("Bird's Nest")){ item.interact("Search"); } if(inventory.contains("Bird's Nest")){ inventory.getItem("Bird's Nest").interact("Search"); //sleep } Edited August 24, 2014 by Isolate Link to comment Share on other sites More sharing options...
PwneRL33T Posted August 24, 2014 Author Share Posted August 24, 2014 if(inventory.contains("Bird's Nest")){ inventory.getItem("Bird's Nest").interact("Search"); //sleep } ah thanks so much, you dont know how long i was searching the api for just that little bit of code XD Link to comment Share on other sites More sharing options...
PwneRL33T Posted August 24, 2014 Author Share Posted August 24, 2014 if(inventory.contains("Bird's Nest")){ inventory.getItem("Bird's Nest").interact("Search"); //sleep } this actually doesnt work... just figured out the nest after its been searched is still called Bird nest... how can i go about using IDs? private int[] NEST_ID = {5070,5071,5072,5073,5074,5075}; i have the in but just dont know how to implement it Link to comment Share on other sites More sharing options...
Isolate Posted August 24, 2014 Share Posted August 24, 2014 (edited) this actually doesnt work... just figured out the nest after its been searched is still called Bird nest... how can i go about using IDs? private int[] NEST_ID = {5070,5071,5072,5073,5074,5075}; i have the in but just dont know how to implement it same private int[] NEST_ID = {5070,5071,5072,5073,5074,5075}; if(inventory.contains(NEST_ID)){ inventory.getItem(NEST_ID).interact("Search"); //sleep } or Item nest = script.inventory.getItem(new Filter<Item>() { @Override public boolean match(Item item) { return item.getName().equalsIgnoreCase("Bird's Nest")&& item.getActions()[0].equalsIgnoreCase("Search"); } }); if(nest != null){ nest.interact("Search"); //sleep } there's lots of ways of doing this, but ID's should work well for what you want Edited August 24, 2014 by Isolate Link to comment Share on other sites More sharing options...
PwneRL33T Posted August 24, 2014 Author Share Posted August 24, 2014 same private int[] NEST_ID = {5070,5071,5072,5073,5074,5075};if(inventory.contains(NEST_ID)){ inventory.getItem(NEST_ID).interact("Search"); //sleep}orItem nest = script.inventory.getItem(new Filter<Item>() { @Override public boolean match(Item item) { return item.getName().equalsIgnoreCase("Bird's Nest")&& item.getActions()[0].equalsIgnoreCase("Search"); } }); if(nest != null){ nest.interact("Search"); //sleep }there's lots of ways of doing this, but ID's should work well for what you want Ah thanks a lot Link to comment Share on other sites More sharing options...