import bergCoder.BergUtils;
import impsoft.bots.ColorBot;
import impsoft.bots.reflection.NPC;
//import impsoft.bots.reflection.WorldObject;
import impsoft.scripting.ibot.enums.Skill;
import impsoft.scripting.ibot.interfaces.AutoPaint;
import impsoft.scripting.ibot.interfaces.ChatListener;
import impsoft.scripting.ibot.structs.AryanTile;
import impsoft.scripting.ibot.structs.AryanTileZone;
import impsoft.scripting.ibot.structs.XY;
import impsoft.scripting.types.ColorScript;
import impsoft.utils.general.Timer;
//import impsoft.utils.uber.UberClickOptions;
//import impsoft.utils.uber.UberNPCOptions;
//import impsoft.utils.uber.UberScriptUtils;
import java.awt.Graphics;
//import java.awt.Polygon;
//import java.util.EnumSet;
//import java.util.regex.Pattern;
public class CatherbyLobs extends ColorScript implements AutoPaint, ChatListener {
public CatherbyLobs(ColorBot c){
super(c);
}
BergUtils util = new BergUtils(this);
public static String name = "CatherbyLobs";
public static String author = "Monopoly";
public static String description = "catches lobsters in catherby";
public static double version = 0.1;
private Timer timeran = new Timer(0);
public String status="";
int startExp;
int startLvl;
int currentExp;
int currentLvl;
int expGain = 0;
int fishCaught = 0;
int lvlGain = 0;
int lobCage = 301;
int bankTrips = 0;
public int botState = 1;
public static final int Banking = 1;
public static final int Fish = 2;
public static final int logOut = 3;
public static final int goToStore = 4;//this is right?
String Status;
//catherby
AryanTileZone catherbyBank = new AryanTileZone (new AryanTile(2811, 3439), (new AryanTile(2807, 3441)));
AryanTileZone fishSpot = new AryanTileZone (new AryanTile(1111, 2222), (new AryanTile(1111, 2223)));//will get actual tiles later when ibot works again
AryanTileZone harryFishStore = new AryanTileZone (new AryanTile(1234, 1234), new AryanTile(1235, 1234));//will get actual tiles later
AryanTile lobster1 = new AryanTile(2836, 3432);
AryanTile lobster2 = new AryanTile(2837, 3432);
AryanTile lobster3 = new AryanTile(2855, 3424);
AryanTile lobster4 = new AryanTile(2859, 3427);
public int [] fishIds = {312,321,324,333,405,1332,1399,3804}; //suckmyscim
public String [] fishNames = {"lobster"};
/*
* AryanTiles// 1 min continue on wait :o
*/
public void script() throws InterruptedException, Exception {
log("script initialization");
randomEventsLobster();
checkBotState();
antiBan.start();
while (true){
switch(botState){
case 1:
banking1();
break;
case 2:
fishing();
break;
case 3:
}
}
}
{
}
public void checkBotState() throws InterruptedException {
if(theTabs.Inventory.isFull()) {
botState = Banking;
}
if (theTabs.Inventory.count("Lobster pot") != 1 ) {
log("need lobster pot/you have too many, you can only have one lobster pot");
botState = Banking;//o yea i
}
if (theTabs.Inventory.count("Lobster pot") == 1 ) {
log("starting script brah :)");
theCamera.setPitchUp();
theParallelCompass.setYawRandom();
util.setFastRun(true);
botState = Fish;
}
if (theTabs.Inventory.isFull()) {
botState = Banking;
}
if (!theTabs.Inventory.isFull()) fishSpot.isInZone(getLocation()); {
botState = Fish;
}
}
public void randomEventsLobster() throws InterruptedException {
startAllRandoms(); {
stopRandom("PublicChatOff");
stopRandom("NotMoving");
stopRandom("NPCChatClickHere");
}
while(!isLoggedIn()) sleep(random(2500, 5000));
timeran = new Timer(0);
this.currentExp = this.theTabs.Statistics.getStatExperience(Skill.FISHING);
this.currentLvl = this.theTabs.Statistics.getStatBottom(Skill.FISHING);
this.startExp = this.currentExp;
this.startLvl = this.currentLvl;
sleep(random(20, 100));
}
public void fishing() throws InterruptedException, Exception {//credits to suckmyscim and CarbonFire
log("catchem fishes");
/*
/*NPC[] fishspot = UberScriptUtils.findNPC(this, fishIds, fishNames,null, null, null, null, null, getLocation(), EnumSet.of(UberNPCOptions.CAN_REACH_FROM_MYPLAYER, UberNPCOptions.RETURN_ONE_MATCH));
/*for (WorldObject wo: fishspot ) {
/*UberScriptUtils.clickWorldObject(this, wo, Pattern.compile("Cage fishing spot"), Pattern.compile("Cage"),EnumSet.of(UberClickOptions.USE_MENU, UberClickOptions.CHECK_TOP_TEXT));
/* //suckmyscim
/* }
*/
//
NPC fishspot = util.getNPCByName(new String [] {"Harpoon", "Cage"}, getLocation());
AryanTile fishtile = fishspot.getBestAccessibleTile(null);
theWorldMap.walkTo(fishtile);
XY fish = fishspot.getRecommendPointToClick();
mouseMove(fish);
if (random(1,5)==2){
mouseClickRight(fish);
}
else {
mouseClickLeft(fish);
theMenuFinder.doMenu("Cage");
}
while (!theTabs.Inventory.isFull()) {
if (getAnimation() != -1) {
log("Fishing");
sleep(random(50, 275));
}
if (getAnimation() == -1 && fishspot == null){
botState = Fish;
} else {
botState = Fish;
}
}
if (theTabs.Inventory.isFull()){
botState = Banking;
log("banking");
}
botState = Banking;
}
public void banking1() throws InterruptedException {
log("finished up a trip");
theWorldMap.walkToBank();
bankTrips++;
log("deposisting items");
if(!theBank.isInterfaceIsUp())
{
theBank.open();
theBank.waitTillInterfaceIsUp();
theBank.doDepositAllBut(new String[] { "Lobster pot" });};
theBank.exit();
if (theTabs.Inventory.count("Lobster pot") == 1 ) {
theBank.open();
theBank.doDepositAll();
theBank.doWithDraw1("Lobster pot", false);
}else{
if(theBank.countStackOf("Lobster pot") <1 ) {
theBank.doWithDrawX("Coins", 20);
}
}
}
public void chat(String chat){
if (chat.startsWith("You catch a")) {
fishCaught++;
}
}
public void paint(Graphics g){
}
Thread antiBan = new Thread() {//not started yet, planning on having the mouse speed antiban here instead of on the top k
public void run() {
log("Activating antiban");
Timer antibanT = new Timer(random(20000, 150000));
setName("MonopolyAntiBan");
setPriority(MAX_PRIORITY);
while(true) {
try {
sleep(random(200, 1050));
if(antibanT.isUp()) {
int randominteger = random(1, 4);
switch(randominteger) {
case 1:
tabSwitch();
break;
case 2:
mouseSpeedAdjustment();
break;
case 3:
cameraAngleSwitch();
break;
case 4:
idleAntiBan();
break;
}
antibanT.reset();
}
sleep(random(300, 1000));
} catch (InterruptedException e) {
info("Thread Stopped");
break;
}
}
}
};
public void tabSwitch() throws InterruptedException {
int randominteger = random(1, 6);
switch(randominteger) {
case 1:
log("Switching to Friends tab.");
util.setTab("Friends");
break;
case 2:
log("Switching to Statistics tab.");
util.setTab("Statistics");
break;
case 3:
log("Switching to Inventory tab.");
util.setTab("Inventory");
break;
case 4:
log("Switching to Emotes tab");
util.setTab("Emotes");
case 5:
log("Switching to Clan Chat tab");
util.setTab("Clan Chat");
case 6:
idleAntiBan();
}
}
public void mouseSpeedAdjustment() throws InterruptedException {
util.mouseSpeedSwitcherAntiban();
}
public void cameraAngleSwitch() throws InterruptedException {
int randominteger = random(1, 2);
switch(randominteger) {
case 1:
log("Rotating compass randomly");
theCamera.setYawRandom();
case 2:
idleAntiBan();
}
}
public void idleAntiBan() throws InterruptedException {
log("Idle");
sleep(random(200,800));
}
}