- Joined
- Jan 8, 2015
- Messages
- 1,427
- Thread Author
- #1
Anyone interested in adding names, giving feedback, improving the following?
Code:
package com.runemate.geashawscripts.LazyChaosDruids.Tasks;
import com.runemate.game.api.hybrid.entities.Npc;
import com.runemate.game.api.hybrid.region.Npcs;
import com.runemate.game.api.script.Execution;
import com.runemate.game.api.script.framework.task.Task;
/**
* Created by Geashaw on 18-2-2015.
*/
public class DismissTask extends Task {
@Override
public boolean validate() {
Npc random = Npcs.newQuery().names("Genie", "Flippa", "Leo").reachable().results().first();
return random != null && random.isVisible();
}
@Override
public void execute() {
Npc random = Npcs.newQuery().names("Genie", "Flippa", "Leo").reachable().results().first();
if (random != null) {
if (random.interact("Dismiss")) {
Execution.delayUntil(() - > !random.isVisible(), 1000, 1500);
}
}
}
}