mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-07 16:49:11 +00:00
Merge pull request #10 from Parabot/development
[MERGE] Development into master
This commit is contained in:
@@ -69,3 +69,4 @@ fabric.properties
|
|||||||
hs_err_pid*
|
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 {
|
public class BobsIsland implements Random {
|
||||||
|
|
||||||
private static final Tile CENTER = new Tile(2525,4777);
|
private static final Tile center = new Tile(2525,4777);
|
||||||
private static final int PORTAL_ID = 8987;
|
private static final int portalId = 8987;
|
||||||
|
|
||||||
public BobsIsland() {
|
public BobsIsland() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
return CENTER.distanceTo() < 25;
|
return center.distanceTo() < 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
SceneObject[] portals = SceneObjects.getNearest(PORTAL_ID);
|
SceneObject[] portals = SceneObjects.getNearest(portalId);
|
||||||
|
|
||||||
for(final SceneObject portal : portals){
|
for(final SceneObject portal : portals){
|
||||||
if(portal != null){
|
if(portal != null){
|
||||||
@@ -45,7 +45,7 @@ public class BobsIsland implements Random {
|
|||||||
}, 10000);
|
}, 10000);
|
||||||
Time.sleep(1000);
|
Time.sleep(1000);
|
||||||
|
|
||||||
if(CENTER.distanceTo() > 24){
|
if(center.distanceTo() > 24){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ import org.rev317.min.api.wrappers.SceneObject;
|
|||||||
|
|
||||||
public class Jail implements Random {
|
public class Jail implements Random {
|
||||||
private Npc jailer;
|
private Npc jailer;
|
||||||
private final int[] ROCKS = {2093, 2092};
|
private final int[] rocks = {2093, 2092};
|
||||||
private final int[] PICK_AXES = {1266, 1268, 1270, 1272, 1274, 1276, 14605, 14608};
|
private final int[] pickAxes = {1266, 1268, 1270, 1272, 1274, 1276, 14605, 14608};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
try {
|
try {
|
||||||
if (jailer() != null) {
|
if (getJailer() != null) {
|
||||||
this.jailer = jailer();
|
this.jailer = getJailer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -36,10 +36,10 @@ public class Jail implements Random {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
SceneObject rock = rock();
|
SceneObject rock = getRock();
|
||||||
|
|
||||||
//Check if we got an Pickaxe
|
//Check if we got an Pickaxe
|
||||||
if (Inventory.getCount(PICK_AXES) > 0) {
|
if (Inventory.getCount(pickAxes) > 0) {
|
||||||
|
|
||||||
//Check if we can min the ores
|
//Check if we can min the ores
|
||||||
if (!Inventory.isFull()) {
|
if (!Inventory.isFull()) {
|
||||||
@@ -84,17 +84,17 @@ public class Jail implements Random {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Npc jailer(){
|
private Npc getJailer(){
|
||||||
for(Npc jailer : Npcs.getNearest(201)){
|
for(Npc jailer : Npcs.getNearest(201)){
|
||||||
if(jailer != null){
|
if(jailer != null && jailer.getDef() != null){
|
||||||
return jailer;
|
return jailer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SceneObject rock(){
|
private SceneObject getRock(){
|
||||||
for(SceneObject rock : SceneObjects.getNearest(ROCKS)){
|
for(SceneObject rock : SceneObjects.getNearest(rocks)){
|
||||||
if(rock != null){
|
if(rock != null){
|
||||||
return rock;
|
return rock;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = getMan();
|
||||||
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.distanceTo() > 0 || !man.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 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
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Mysterious Old Man Solver";
|
return "Mysterious Old Man Solver";
|
||||||
|
|||||||
@@ -12,32 +12,37 @@ import org.rev317.min.api.wrappers.Npc;
|
|||||||
*/
|
*/
|
||||||
public class SandwichLady implements Random {
|
public class SandwichLady implements Random {
|
||||||
|
|
||||||
Npc lady;
|
private Npc lady;
|
||||||
|
private final int id = 3117;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
for (Npc npc : Npcs.getNearest(3117)) {
|
this.lady = getLady();
|
||||||
if (npc != null && npc.getDef() != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
return this.lady != null;
|
||||||
lady = npc;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (lady != null && lady.getDef() != null && lady.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
if (this.lady != null) {
|
||||||
lady.interact(0);
|
lady.interact(Npcs.Option.TALK_TO);
|
||||||
Time.sleep(new SleepCondition() {
|
Time.sleep(new SleepCondition() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return !lady.getInteractingCharacter().equals(Players.getMyPlayer());
|
return lady.distanceTo() > 0 || !lady.getInteractingCharacter().equals(Players.getMyPlayer());
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 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
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Sandwich Lady Solver";
|
return "Sandwich Lady Solver";
|
||||||
|
|||||||
Reference in New Issue
Block a user