July 20, 201510 yr 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.
July 20, 201510 yr 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, 201510 yr by bob10
July 20, 201510 yr 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.
Create an account or sign in to comment