mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-10-01 02:17:30 +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
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
|
|
||||||
*.iml
|
*.iml
|
||||||
|
.i€dea
|
||||||
@@ -12,32 +12,37 @@ import org.rev317.min.api.wrappers.Npc;
|
|||||||
*/
|
*/
|
||||||
public class MysteriousOldMan implements Random {
|
public class MysteriousOldMan implements Random {
|
||||||
|
|
||||||
Npc man;
|
private Npc man;
|
||||||
|
private final int ID = 410;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
for (Npc npc : Npcs.getNearest(410)) {
|
this.man = man();
|
||||||
if (npc != null && npc.getDef() != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
return man != null;
|
||||||
man = npc;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (man != null && man.getDef() != null && man.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
if (this.man != null) {
|
||||||
man.interact(0);
|
man.interact(Npcs.Option.TALK_TO);
|
||||||
Time.sleep(new SleepCondition() {
|
Time.sleep(new SleepCondition() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return !man.getInteractingCharacter().equals(Players.getMyPlayer());
|
return man == null || !man.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 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
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Mysterious Old Man Solver";
|
return "Mysterious Old Man Solver";
|
||||||
|
|||||||
Reference in New Issue
Block a user