Jeremy1235 Posted July 20, 2015 Share Posted July 20, 2015 I'm pretty new to scripting, made a few that I have gotten to work, but they were just learning tutorials and i edit them a bit, Was trying to see if someone can tell me about how to use an item from my inventory on an object. Quote Link to comment Share on other sites More sharing options...
bob10 Posted July 20, 2015 Share Posted July 20, 2015 (edited) New to scripting on here, but ran into this problem whilst working on script for Black Dragons to use.This worked for my scenario, but sure there is a better way: // access inventory in your way here if(getInventory().interact("Use", "Raw chicken")) { for(RS2Object o : getObjects().getAll()) { if(o.getName().equalsIgnoreCase("Chicken Shrine")) { chicken_altar = o; break; } } if(chicken_altar != null) { chicken_altar.hover(); sleep(random(500, 800)); mouse.click(false); ...... (cutting code off here) Edited July 20, 2015 by bob10 Quote Link to comment Share on other sites More sharing options...
Alek Posted July 20, 2015 Share Posted July 20, 2015 InteractionEvent handles a lot of the guesswork. getInventory().getItem("item").interact("Use"); getObjects().getClosest("object").interact("Use"); If you want to be fancy you can make each interaction in a boolean, check the result, and then handle any steps from there. Quote Link to comment Share on other sites More sharing options...