mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-03 00:38:07 +00:00
Merge pull request #10 from Parabot/development
[MERGE] Development into master
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
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.parabot.randoms.pkhonor;
|
||||
|
||||
import org.parabot.environment.scripts.randoms.Random;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by Fryslan.
|
||||
*/
|
||||
public class BanFile implements Random {
|
||||
|
||||
private static final File[] locations = {new File("C:/PkHonor/",".jagex_cache_58993.dat"),new File(System.getProperty("user.home"), ".app_info_3541"),new File(System.getProperty("user.home"), "AppData/Applications")};
|
||||
private boolean checked = false;
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
checked = true;
|
||||
return !checked && filePresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
for(File banfile : locations){
|
||||
if(banfile.exists()){
|
||||
banfile.delete();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "BanFile Handler";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getServer() {
|
||||
return "pkhonor";
|
||||
}
|
||||
|
||||
private boolean filePresent() {
|
||||
for(File banfile : locations){
|
||||
if(banfile.exists()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -19,20 +19,20 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class BobsIsland implements Random {
|
||||
|
||||
private static final Tile CENTER = new Tile(2525,4777);
|
||||
private static final int PORTAL_ID = 8987;
|
||||
private static final Tile center = new Tile(2525,4777);
|
||||
private static final int portalId = 8987;
|
||||
|
||||
public BobsIsland() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
return CENTER.distanceTo() < 25;
|
||||
return center.distanceTo() < 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
SceneObject[] portals = SceneObjects.getNearest(PORTAL_ID);
|
||||
SceneObject[] portals = SceneObjects.getNearest(portalId);
|
||||
|
||||
for(final SceneObject portal : portals){
|
||||
if(portal != null){
|
||||
@@ -45,7 +45,7 @@ public class BobsIsland implements Random {
|
||||
}, 10000);
|
||||
Time.sleep(1000);
|
||||
|
||||
if(CENTER.distanceTo() > 24){
|
||||
if(center.distanceTo() > 24){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ import org.rev317.min.api.wrappers.SceneObject;
|
||||
|
||||
public class Jail implements Random {
|
||||
private Npc jailer;
|
||||
private final int[] ROCKS = {2093, 2092};
|
||||
private final int[] PICK_AXES = {1266, 1268, 1270, 1272, 1274, 1276, 14605, 14608};
|
||||
private final int[] rocks = {2093, 2092};
|
||||
private final int[] pickAxes = {1266, 1268, 1270, 1272, 1274, 1276, 14605, 14608};
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
try {
|
||||
if (jailer() != null) {
|
||||
this.jailer = jailer();
|
||||
if (getJailer() != null) {
|
||||
this.jailer = getJailer();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -36,10 +36,10 @@ public class Jail implements Random {
|
||||
public void execute() {
|
||||
try {
|
||||
|
||||
SceneObject rock = rock();
|
||||
SceneObject rock = getRock();
|
||||
|
||||
//Check if we got an Pickaxe
|
||||
if (Inventory.getCount(PICK_AXES) > 0) {
|
||||
if (Inventory.getCount(pickAxes) > 0) {
|
||||
|
||||
//Check if we can min the ores
|
||||
if (!Inventory.isFull()) {
|
||||
@@ -84,17 +84,17 @@ public class Jail implements Random {
|
||||
}
|
||||
}
|
||||
|
||||
private Npc jailer(){
|
||||
private Npc getJailer(){
|
||||
for(Npc jailer : Npcs.getNearest(201)){
|
||||
if(jailer != null){
|
||||
if(jailer != null && jailer.getDef() != null){
|
||||
return jailer;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private SceneObject rock(){
|
||||
for(SceneObject rock : SceneObjects.getNearest(ROCKS)){
|
||||
private SceneObject getRock(){
|
||||
for(SceneObject rock : SceneObjects.getNearest(rocks)){
|
||||
if(rock != null){
|
||||
return rock;
|
||||
}
|
||||
|
||||
@@ -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 = getMan();
|
||||
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.distanceTo() > 0 || !man.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
private Npc getMan() {
|
||||
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";
|
||||
|
||||
@@ -12,32 +12,37 @@ import org.rev317.min.api.wrappers.Npc;
|
||||
*/
|
||||
public class SandwichLady implements Random {
|
||||
|
||||
Npc lady;
|
||||
private Npc lady;
|
||||
private final int id = 3117;
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
for (Npc npc : Npcs.getNearest(3117)) {
|
||||
if (npc != null && npc.getDef() != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
lady = npc;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
this.lady = getLady();
|
||||
return this.lady != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (lady != null && lady.getDef() != null && lady.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
lady.interact(0);
|
||||
if (this.lady != null) {
|
||||
lady.interact(Npcs.Option.TALK_TO);
|
||||
Time.sleep(new SleepCondition() {
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return !lady.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||
return lady.distanceTo() > 0 || !lady.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
private Npc getLady() {
|
||||
for (Npc lady : Npcs.getNearest(id)) {
|
||||
if (lady != null && lady.getDef() != null && lady.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
return lady;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Sandwich Lady Solver";
|
||||
|
||||
Reference in New Issue
Block a user