mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-03 00:38:07 +00:00
+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
|
||||
Generated
+1
@@ -2,6 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Randoms.iml" filepath="$PROJECT_DIR$/.idea/Randoms.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/Randoms.iml" filepath="$PROJECT_DIR$/Randoms.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
||||
@@ -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,38 +19,35 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class BobsIsland implements Random {
|
||||
|
||||
private final int PORTAL = 8987;
|
||||
private ArrayList<SceneObject> portals;
|
||||
private final Area ISLAND = new Area(new Tile(2511, 4765), new Tile(2511, 4790), new Tile(2542, 4790), new Tile(2542, 4765));
|
||||
private static final Tile center = new Tile(2525,4777);
|
||||
private static final int portalId = 8987;
|
||||
|
||||
public BobsIsland() {
|
||||
portals = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
return ISLAND.contains(Players.getMyPlayer().getLocation());
|
||||
return center.distanceTo() < 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
//Fill The ArrayList
|
||||
for (SceneObject portal : SceneObjects.getNearest(PORTAL)) {
|
||||
if (portal != null) {
|
||||
portals.add(portal);
|
||||
}
|
||||
}
|
||||
SceneObject[] portals = SceneObjects.getNearest(portalId);
|
||||
|
||||
//Loop through the portals
|
||||
for (final SceneObject portal : portals) {
|
||||
if (portal != null) {
|
||||
portal.interact(0);
|
||||
for(final SceneObject portal : portals){
|
||||
if(portal != null){
|
||||
portal.interact(SceneObjects.Option.FIRST);
|
||||
Time.sleep(new SleepCondition() {
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return portal.distanceTo() < 2;
|
||||
}
|
||||
}, 7500);
|
||||
}, 10000);
|
||||
Time.sleep(1000);
|
||||
|
||||
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.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||
man = npc;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
this.man = getMan();
|
||||
return man != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (man != 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.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.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