pokemonhuang 1 Share Posted October 15, 2018 I see there is a DismissSolver class, but i don't know how to use it. can someone explain this to me please. Link to comment Share on other sites More sharing options...
Bell 9 Share Posted October 15, 2018 There is a dismiss resolver for random events already in the client I believe Link to comment Share on other sites More sharing options...
pokemonhuang 1 Author Share Posted October 16, 2018 yes but, i need to set a delay for it. the dismiss solver dismiss it instantly. i don't want that. Link to comment Share on other sites More sharing options...
qwAQ 17 Share Posted October 16, 2018 35 minutes ago, Infidel said: Disable the solver, create a array of the ids of the random npcs you wish to handle, if random appears is on screen (random.isOnScreen()) - set system.currenttimemillis, after timer reached, interact with npc. Edit: if there is a better way, share it. Would be interested in seeing how others do it. Good idea, I will build further on your solution. You can extend the above and use the Timer class in dreambot. Here is an example on how to use it: Timer timer = new Timer(2000); //Set the runtime for the timer to be 2 seconds while (!timer.finished()) { System.out.println(timer.formatTime()); //Print out the current timer time MethodProvider.sleep(1000); //Sleep 1 second } //This will be printed out after 2 seconds has passed System.out.println("Timer finished"); Link to comment Share on other sites More sharing options...
Hashtag 8689 Featured Comment Share Posted October 16, 2018 Have a look at overriding the solver. Use RandomManager's registerSolver function to register your custom dismiss solver. Have your custom solver inherit from DismissSolver but override its shouldExecute function by your own which takes into account the delay. Here's a draft.. public class YourScript extends AbstractScript { ... @Override public void onStart() { getRandomManager().registerSolver(new CustomDismissSolver()); } ... } public class CustomDismissSolver extends DismissSolver { @Override public boolean shouldExecute() { return super.shouldExecute() && someKindOfADelayCheck; } } Link to comment Share on other sites More sharing options...
pokemonhuang 1 Author Share Posted October 16, 2018 thank you everyone! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.