boosterboy 7 Share Posted August 4, 2022 I made this and was using it in my code that I was writing, decided to take another path, and vs it going to waste figured it might be useful for someone it works... but not efficiently really you might need to modify the code for your own purpose, also like I said its not efficient really and I know this there are better ways to handle the !avoidHandler if statement than checking if the string is not empty xD, but ill leave that up to you. import org.dreambot.api.Client; import org.dreambot.api.methods.interactive.NPCs; import org.dreambot.api.wrappers.interactive.NPC; public class RandomEventHandler { public static void npcHandler(){ String[] avoidHandler = {"Genie", "Bee keeper" , "Capt' Arnav", "Niles", "Miles", "Giles", "Sergeant Damien", "Drunken dwarf", "Evil Bob", "Servant", "Postie Pete", "Molly", "Freaky Forester", "Leo", "Jekyll and Hyde", "Frog prince", "Frog princess", "Frog", "Mysterious Old Man", "Pillory Guard", "Flippa", "Tilt", "Prison Pete", "Quiz Master", "Rick Turpentine", "Sandwich lady", "Strange plant", "Dunce", "Mr. Mordaut"}; int arrayLength = avoidHandler.length; for (int i = 0; i < arrayLength; i++){ if (!avoidHandler[i].isEmpty()){ NPC eventTrigger = NPCs.closest(avoidHandler[i]); eventTrigger.interact("Dismiss"); } } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.