Chris Posted August 8, 2015 Posted August 8, 2015 (edited) s.getEquipment().equip(slot #,"Combat bracelet"); How would I interact with the bracelet (tele to monastery etc.)? EDIT: found this in api interactpublic boolean interact(int slot, java.lang.String... actions) Interacts with the slot specified. Overrides: interact in class ItemContainer Parameters: slot - The slot to interact with. actions - The action to interact with. Returns: True if the bot interacted with the specified slot successfully. how would this be used correctly? Edited August 8, 2015 by Sinatra
Chris Posted August 8, 2015 Author Posted August 8, 2015 ended up interacting with widgets lol. RS2Widget equipmentTab = s.widgets.get(548,47); RS2Widget teleRing = s.widgets.get(387,15); if (equipmentTab != null && equipmentTab.isVisible()){ equipmentTab.interact("Worn Equipment"); s.sleep(s.random(4000)); } if (teleRing != null && teleRing.isVisible()){ teleRing.interact("Castle Wars"); s.sleep(s.random(4000)); }
Precise Posted August 8, 2015 Posted August 8, 2015 (edited) ended up interacting with widgets lol. RS2Widget equipmentTab = s.widgets.get(548,47); RS2Widget teleRing = s.widgets.get(387,15); if (equipmentTab != null && equipmentTab.isVisible()){ equipmentTab.interact("Worn Equipment"); s.sleep(s.random(4000)); } if (teleRing != null && teleRing.isVisible()){ teleRing.interact("Castle Wars"); s.sleep(s.random(4000)); } which will break with an rs update equipment is just like the inventory as they are both ItemContainers. so just get the item from a slot and interact with it Edited August 8, 2015 by Precise
Chris Posted August 8, 2015 Author Posted August 8, 2015 which will break with an rs update equipment is just like the inventory as they are both ItemContainers. so just get the item from a slot and interact with it like ->: getEquipment().interact(EquipmentSlot.RING, "Castle Wars"); 1
Precise Posted August 8, 2015 Posted August 8, 2015 like ->: getEquipment().interact(EquipmentSlot.RING, "Castle Wars"); yes, or: getEquipment().interact("name of item here", "Castle Wars");
Chris Posted August 8, 2015 Author Posted August 8, 2015 yes, or: getEquipment().interact("name of item here", "Castle Wars"); Thanks ;)