mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-03 00:38:07 +00:00
[CLASS REWRITE] Rewritten Mysterious Old Man random.
This commit is contained in:
+2
-1
@@ -68,4 +68,5 @@ fabric.properties
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*.iml
|
||||
*.iml
|
||||
.i€dea
|
||||
@@ -12,32 +12,37 @@ import org.rev317.min.api.wrappers.Npc;
|
||||
*/
|
||||
public class MysteriousOldMan implements Random {
|
||||
|
||||
Npc man;
|
||||
private Npc man;
|
||||
private final int ID = 410;
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
for (Npc npc : Npcs.getNearest(410)) {
|
||||
if (npc != null && npc.getDef() != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
man = npc;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
this.man = man();
|
||||
return man != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (man != null && man.getDef() != null && man.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
man.interact(0);
|
||||
if (this.man != null) {
|
||||
man.interact(Npcs.Option.TALK_TO);
|
||||
Time.sleep(new SleepCondition() {
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return !man.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||
return man == null || !man.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
private Npc man() {
|
||||
for (Npc man : Npcs.getNearest(ID)) {
|
||||
if (man != null && man.getDef() != null && man.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
return man;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Mysterious Old Man Solver";
|
||||
|
||||
Reference in New Issue
Block a user