mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-07 16:49:11 +00:00
Merge branch 'development' of github.com:Parabot/Randoms into feature/anti-bot-detector
# Conflicts: # src/main/java/org/parabot/randoms/Core.java
This commit is contained in:
@@ -6,6 +6,7 @@ import org.parabot.randoms.dreamscape.SerialBanAvoider;
|
|||||||
import org.parabot.randoms.elkoy.AntiDetector;
|
import org.parabot.randoms.elkoy.AntiDetector;
|
||||||
import org.parabot.randoms.elkoy.LogoutDisabler;
|
import org.parabot.randoms.elkoy.LogoutDisabler;
|
||||||
import org.parabot.randoms.elkoy.QuestionSolver;
|
import org.parabot.randoms.elkoy.QuestionSolver;
|
||||||
|
import org.parabot.randoms.elkoy.MouseOnScreen;
|
||||||
import org.parabot.randoms.pkhonor.*;
|
import org.parabot.randoms.pkhonor.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -31,6 +32,7 @@ public class Core {
|
|||||||
// Elkoy
|
// Elkoy
|
||||||
//randoms.add(new QuestionSolver());
|
//randoms.add(new QuestionSolver());
|
||||||
randoms.add(new LogoutDisabler());
|
randoms.add(new LogoutDisabler());
|
||||||
|
randoms.add(new MouseOnScreen());
|
||||||
randoms.add(new AntiDetector());
|
randoms.add(new AntiDetector());
|
||||||
|
|
||||||
org.parabot.core.Core.verbose("Possible randoms:");
|
org.parabot.core.Core.verbose("Possible randoms:");
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class MouseOnScreen implements Random {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
int x = org.parabot.environment.api.utils.Random.between(100, Context.getInstance().getApplet().getWidth());
|
int x = org.parabot.environment.api.utils.Random.between(100, Context.getInstance().getApplet().getWidth());
|
||||||
int y = org.parabot.environment.api.utils.Random.between(100, Context.getInstance().getApplet().getHeight());
|
int y = org.parabot.environment.api.utils.Random.between(100, Context.getInstance().getApplet().getHeight());
|
||||||
|
|
||||||
Mouse.getInstance().moveMouse(x, y);
|
Mouse.getInstance().moveMouse(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ public class MouseOnScreen implements Random {
|
|||||||
return RandomType.SCRIPT;
|
return RandomType.SCRIPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean onScreen(){
|
private boolean onScreen() {
|
||||||
Point loc = Mouse.getInstance().getPoint();
|
Point loc = Mouse.getInstance().getPoint();
|
||||||
return Context.getInstance().getApplet().contains(loc);
|
return Context.getInstance().getApplet().contains(loc);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public class QuestionSolver implements Random {
|
|||||||
} catch (MalformedURLException | UnsupportedEncodingException | ParseException e) {
|
} catch (MalformedURLException | UnsupportedEncodingException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class BanFile implements Random {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +31,6 @@ public class BanFile implements Random {
|
|||||||
banfile.delete();
|
banfile.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,6 +55,7 @@ public class BanFile implements Random {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ 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 portalId = 8987;
|
private static final int portalId = 8987;
|
||||||
|
|
||||||
public BobsIsland() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
return center.distanceTo() < 25;
|
return center.distanceTo() < 25;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class Jail implements Random {
|
|||||||
this.jailer = getJailer();
|
this.jailer = getJailer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
@@ -91,6 +92,7 @@ public class Jail implements Random {
|
|||||||
return jailer;
|
return jailer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,6 +102,7 @@ public class Jail implements Random {
|
|||||||
return rock;
|
return rock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class MysteriousOldMan implements Random {
|
|||||||
return man;
|
return man;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
package org.parabot.randoms.pkhonor;
|
|
||||||
|
|
||||||
import org.parabot.core.reflect.RefClass;
|
|
||||||
import org.parabot.core.reflect.RefField;
|
|
||||||
import org.parabot.environment.randoms.Random;
|
|
||||||
import org.parabot.environment.randoms.RandomType;
|
|
||||||
import org.rev317.min.Loader;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author EmmaStone
|
|
||||||
*/
|
|
||||||
public class PacketBlockInterceptor implements Random {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean activate() {
|
|
||||||
return !getField();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute() {
|
|
||||||
setField();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean getField() {
|
|
||||||
return new RefClass(Loader.getClient()).getField("PG").asBoolean();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setField() {
|
|
||||||
RefField refField = new RefClass(Loader.getClient()).getField("PG");
|
|
||||||
refField.set(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "Packet Block Interceptor";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getServer() {
|
|
||||||
return "pkhonor";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RandomType getRandomType() {
|
|
||||||
return RandomType.SCRIPT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -41,6 +41,7 @@ public class SandwichLady implements Random {
|
|||||||
return lady;
|
return lady;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,23 +17,28 @@ public class TriangleSandwich implements Random {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
for (Item i : Inventory.getItems(id)) {
|
if (Inventory.getItems() != null) {
|
||||||
if (i != null) {
|
for (Item i : Inventory.getItems(id)) {
|
||||||
this.item = i;
|
if (i != null) {
|
||||||
return true;
|
this.item = i;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (this.item != null) {
|
if (this.item != null) {
|
||||||
|
final int sandwich = Inventory.getCount(id);
|
||||||
item.drop();
|
item.drop();
|
||||||
Time.sleep(new SleepCondition() {
|
Time.sleep(new SleepCondition() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return Inventory.getCount(id) == 0;
|
return Inventory.getCount(id) != sandwich;
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user