can you make it so it picks up the charms effiges ores runes shit like that . . .
Manifest(authors = { "JustRS" }, name = "JustRoaches", description = "Kills Cockroach Soldiers, Loots Items, Banks for Food.", version = 2.1, website = "http://www.powerbot.org/community/topic/686539-justroaches-30k-40k-xphr-charms-cash/")
public class JustRoaches extends ActiveScript implements PaintListener, MouseListener {
public int PICKUP_ITEMS[] = {
10266, //Clue Scroll
7282, //Clue Scroll (medium)
5316, //Magic Seed
5304, //Torstol Seed
5300, //Snapdragon Seed
5321, //Watermelon Seed
563, //Law Rune
560, //Death Rune
565, //Blood Rune
554, //Fire Rune
1333, //Rune Scimitar
1185, //Rune Sq Shield
450, //Adamantite Ore
448, //Mithril Ore
1631, //Uncut Dragonstone
12163, //Blue Charm
12160, //Crimson Charm
12159, //Green Charm
12158, //Gold Charm
24154, //Spin Ticket
// 995, //Coins
985 //Tooth Half of Key
};
// Do not edit past this point
int EAT_PERCENT;
int FOOD_ID;
int WITHDRAW_AMT;
String ATTACK_STYLE = "Attack";
public long StartTime;
public int StartXPAttack;
public int StartXPStrength;
public int StartXPDefense;
public int StartXPRange;
public int StartXPConstitution;
public int FoodEaten = 0;
public int BankWithdraws = 0;
public int BlueCharms = 0;
public int CrimsonCharms = 0;
public int GreenCharms = 0;
public int GoldCharms = 0;
public int MithOre = 0;
public int AdamOre = 0;
public int LawRunes = 0;
public int DeathRunes = 0;
public int BloodRunes = 0;
public int FireRunes = 0;
public int RuneScimitar = 0;
public int RuneShield = 0;
public int WatermelonSeed = 0;
public int TorstolSeed = 0;
public int SnapdragonSeed = 0;
public int MagicSeed = 0;
public int UncutDragonstone = 0;
public int SpinTickets = 0;
public int Coins = 0;
public int PrBlueCharms;
public int PrCrimsonCharms;
public int PrGreenCharms;
public int PrGoldCharms;
public int PrMithOre;
public int PrAdamOre;
public int PrLawRunes;
public int PrDeathRunes;
public int PrBloodRunes;
public int PrFireRunes;
public int PrRuneScimitar;
public int PrRuneShield;
public int PrWatermelonSeed;
public int PrTorstolSeed;
public int PrSnapdragonSeed;
public int PrMagicSeed;
public int PrUncutDragonstone;
public int PrSpinTickets;
public int PrCoins;
public int TotalPriceLooted;
public int TotalPriceLootedInK;
public boolean TabLoot = false;
public boolean TabCombat = true;
Rectangle RecTabCombat = new Rectangle(8, 346, 110, 28);
Rectangle RecTabLoot = new Rectangle(119, 346, 100, 28);
Point p;
boolean guiRunning = true;
public int ROACHES = 7160;
public int ROPE_ID = 29729;
public int CREVICE_ID = 29728;
public int BANK_ID = 42217;
private final Tile[] ToBank = { new Tile(3080, 3463, 0),
new Tile(3080, 3470, 0), new Tile(3080, 3477, 0),
new Tile(3083, 3486, 0), new Tile(3093, 3491, 0) };
private final Tile[] ToCrevice = { new Tile(3093, 3491, 0),
new Tile(3083, 3486, 0), new Tile(3080, 3477, 0),
new Tile(3080, 3470, 0), new Tile(3080, 3463, 0) };
public String Status = "Script Started";
private final Color color3 = new Color(255, 255, 255);
private final Font body = new Font("Verdana", 0, 10);
private final Font title = new Font("Verdana", 1, 10);
private final Image img = getImage("http://img829.imageshack.us/img829/8426/justroachesv21.jpg");
protected void setup() {
log.info("_____________JustRoaches V2.1_____________");
log.info("Loading GE Prices...");
try {
PrMithOre = getPrice(447);
PrAdamOre = getPrice(449);
PrLawRunes = getPrice(563);
PrBloodRunes = getPrice(565);
PrDeathRunes = getPrice(560);
PrFireRunes = getPrice(554);
PrRuneScimitar = getPrice(1333);
PrRuneShield = getPrice(1185);
PrTorstolSeed = getPrice(5304);
PrSnapdragonSeed = getPrice(5300);
PrWatermelonSeed = getPrice(5321);
PrUncutDragonstone = getPrice(1631);
} catch (IOException e) {
e.printStackTrace();
}
log.info("Launching GUI");
guiBuild();
StartXPAttack = Skills.getExperience(Skills.ATTACK);
StartXPStrength = Skills.getExperience(Skills.STRENGTH);
StartXPDefense = Skills.getExperience(Skills.DEFENSE);
StartXPRange = Skills.getExperience(Skills.RANGE);
StartXPConstitution = Skills.getExperience(Skills.CONSTITUTION);
if (Tabs.getCurrent() != Tabs.INVENTORY) {
Tabs.INVENTORY.open();
}
Camera.setPitch(true);
StartTime = System.currentTimeMillis();
provide(new WalkToCrevice());
provide(new Loot());
provide(new EatFood());
provide(new ClimbRope());
provide(new AttackRoaches());
provide(new WalkToBank());
provide(new BankItems());
}
public void guiBuild() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
final JustRoachesGUI GUI = new JustRoachesGUI();
GUI.setVisible(true);
final guiBuild GUIBUILD = new guiBuild();
final Strategy GUIBUILD_STRATEGY = new Strategy(GUIBUILD, GUIBUILD);
provide(GUIBUILD_STRATEGY);
guiRunning = true;
}
});
}
private class guiBuild extends Strategy implements Task, Condition {
public void run() {
while(guiRunning) Time.sleep(100);
}
public boolean validate() {
return guiRunning;
}
}
private class Loot extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && NeedToLoot()
&& Players.getLocal().getLocation().getX() >= 3100;
}
@Override
public void run() {
for(int l : PICKUP_ITEMS) {
GroundItem g = GroundItems.getNearest(l);
if (g != null) {
Status = "Looting Items";
if (!g.isOnScreen() && g.getLocation().getY() >= 4274) {
Walking.walk(g);
sleep(500,800);
} else {
g.interact("Take", g.getGroundItem().getName());
if (Calculations.distanceTo(g.getLocation()) > 2) {
sleep(1300,1500);
}
sleep(1300,1500);
if (g.getId() == 12163) { BlueCharms = BlueCharms+1; }
if (g.getId() == 12160) { CrimsonCharms = CrimsonCharms+1; }
if (g.getId() == 12159) { GreenCharms = GreenCharms+1; }
if (g.getId() == 12158) { GoldCharms = GoldCharms+1; }
if (g.getId() == 1333) { RuneScimitar = RuneScimitar+1; }
if (g.getId() == 1185) { RuneShield = RuneShield+1; }
if (g.getId() == 448) { MithOre = MithOre+(g.getGroundItem().getStackSize()); }
if (g.getId() == 450) { AdamOre = AdamOre+(g.getGroundItem().getStackSize()); }
if (g.getId() == 563) { LawRunes = LawRunes+(g.getGroundItem().getStackSize()); }
if (g.getId() == 560) { DeathRunes = DeathRunes+(g.getGroundItem().getStackSize()); }
if (g.getId() == 565) { BloodRunes = BloodRunes+(g.getGroundItem().getStackSize()); }
if (g.getId() == 554) { FireRunes = FireRunes+(g.getGroundItem().getStackSize()); }
if (g.getId() == 5304) { TorstolSeed = TorstolSeed+1; }
if (g.getId() == 5300) { SnapdragonSeed = SnapdragonSeed+1; }
if (g.getId() == 5321) { WatermelonSeed = WatermelonSeed+1; }
if (g.getId() == 5316) { MagicSeed = MagicSeed+(g.getGroundItem().getStackSize()); }
if (g.getId() == 1631) { UncutDragonstone = UncutDragonstone+1; }
if (g.getId() == 995) { Coins = Coins+(g.getGroundItem().getStackSize()); }
}
}
}
}
}
private class AttackRoaches extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && Players.getLocal().getLocation().getX() >= 3100
&& !NeedToEat()
&& !NeedToLoot()
&& !FullInventory();
}
@Override
public void run() {
if (GetRoaches()==null && !NeedToLoot()) {
AntiBan();
}
if (GetRoaches().getLocation().getY() >= 4274 && !NeedToLoot()) {
if(GetRoaches().isOnScreen()) {
if(!Players.getLocal().isInCombat() && Players.getLocal().getInteracting()==null) {
GetRoaches().click(true);
Status = "Fighting Cockroach";
sleep(500,700);
} else {
AntiBan();
}
} else {
while (!GetRoaches().isOnScreen()) {
Walking.walk(GetRoaches().getLocation());
sleep(300,500);
}
}
}
}
}
private class EatFood extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && HaveFood()
&& NeedToEat()
|| FullInventory();
}
@Override
public void run() {
if(!Tabs.getCurrent().equals(Tabs.INVENTORY)) {
Tabs.INVENTORY.open();
}
for(Item i : Inventory.getItems()){
if(i.getId() == FOOD_ID && validate() && Players.getLocal().getAnimation()==-1){
i.getWidgetChild().click(true);
Status = "Eating Food";
sleep(900,1000);
FoodEaten = FoodEaten+1;
}
}
}
}
private class ClimbRope extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && !HaveFood()
&& Players.getLocal().getLocation().getX() >= 3100
&& NeedToEat()
&& !NeedToLoot();
}
@Override
public void run() {
if (GetRope().isOnScreen()) {
Status = "Climbing Rope";
sleep(100,300);
GetRope().interact("Climb");
sleep(800,1000);
} else {
Walking.walk(GetRope());
sleep(300,500);
}
}
}
private class WalkToBank extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && !HaveFood()
&& !Bank.isOpen()
&& Players.getLocal().getLocation().getX() <= 3100;
}
@Override
public void run() {
Status = "Walking to Bank";
if (GetBank().isOnScreen() && Calculations.distanceTo(GetBank().getLocation()) <= 6) {
sleep(500, 700);
GetBank().interact("Bank");
sleep(800, 1000);
} else {
Walking.newTilePath(ToBank).traverse();
}
}
}
private class WalkToCrevice extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && HaveFood()
&& Players.getLocal().getLocation().getX() <= 3100;
}
@Override
public void run() {
Status = "Walking to Crevice";
if (GetCrevice().isOnScreen() && Calculations.distanceTo(GetCrevice()) <= 5) {
Status = "Entering Crevice";
sleep(500, 700);
GetCrevice().interact("Enter");
} else {
Walking.newTilePath(ToCrevice).traverse();
}
}
}
private class BankItems extends Strategy implements Task {
@Override
public boolean validate() {
return !guiRunning && Bank.isOpen()
&& !HaveFood()
&& Players.getLocal().getLocation().getX() <= 3100;
}
@Override
public void run() {
Status = "Banking";
sleep(500, 700);
for(Item t:Inventory.getItems()){
if(t.getId() != FOOD_ID && Inventory.getCount() != 0){
Bank.depositInventory();
sleep(500,700);
}
}
if (WITHDRAW_AMT==5) {
sleep(500, 750);
Bank.withdraw(FOOD_ID, 5);
sleep(500, 750);
}
if (WITHDRAW_AMT==10) {
sleep(500, 750);
Bank.withdraw(FOOD_ID, 10);
sleep(500, 750);
}
if (WITHDRAW_AMT==15) {
sleep(500, 750);;
Bank.withdraw(FOOD_ID, 15);
sleep(500, 750);
}
if (WITHDRAW_AMT==20) {
sleep(500, 750);
Bank.withdraw(FOOD_ID, 20);
sleep(500, 750);;
}
sleep(500, 750);
Bank.close();
BankWithdraws++;
}
}
public static void sleep(int min, int max){
Time.sleep(Random.nextInt(min, max));
}
public boolean FullInventory(){
if (Inventory.getCount() == 28) {
return true;
}
return false;
}
public NPC GetRoaches() {
return NPCs.getNearest(ROACHES);
}
private SceneObject GetRope() {
return SceneEntities.getNearest(ROPE_ID);
}
private SceneObject GetBank() {
return SceneEntities.getNearest(BANK_ID);
}
private SceneObject GetCrevice() {
return SceneEntities.getNearest(CREVICE_ID);
}
public boolean HaveFood() {
if (Inventory.getCount(FOOD_ID) >= 1) {
return true;
}
return false;
}
public boolean NeedToEat(){
if (Integer.parseInt(Widgets.get(748, 8).getText()) <= (Skills.getLevel(Skills.CONSTITUTION))*EAT_PERCENT) {
return true;
}
return false;
}
public boolean NeedToLoot() {
for(int l : PICKUP_ITEMS) {
GroundItem g = GroundItems.getNearest(l);
if (g != null) {
return true;
}
}
return false;
}
public int getPrice(int id) throws IOException {
String price;
URL url = new URL("http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=" + id);
URLConnection con = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
if (line.contains("<td>")) {
price = line.substring(line.indexOf(">") + 1, line.indexOf("/") - 1);
try {
return Integer.parseInt(price);
} catch (NumberFormatException e) {
return 0;
}
}
}
return 0;
}
private void AntiBan() {
if (Players.getLocal().getInteracting()!=null) {
switch (Random.nextInt(0, 50)) {
case 10:
Status = "Moving the Mouse";
Mouse.move(Random.nextInt(0, 700), Random.nextInt(0, 500));
break;
case 20:
Status = "Moving the Camera Angle";
Camera.setAngle(Random.nextInt(320, 20));
break;
case 30:
Status = "Moving the Camera Angle";
Camera.setAngle(Random.nextInt(20, 320));
break;
case 40:
Status = "Moving the Mouse";
Mouse.move(Random.nextInt(0, 700), Random.nextInt(0, 500));
break;
}
}
}
private Image getImage(String url) {
try {
return ImageIO.read(new URL(url));
} catch (IOException e) {
return null;
}
}
public void onRepaint(Graphics g1) {
TotalPriceLooted =
(PrMithOre*MithOre) +
(PrAdamOre*AdamOre) +
(PrLawRunes*LawRunes) +
(PrBloodRunes*BloodRunes) +
(PrDeathRunes*DeathRunes) +
(PrFireRunes*FireRunes) +
(PrRuneScimitar*RuneScimitar) +
(PrRuneShield*RuneShield) +
(PrTorstolSeed*TorstolSeed) +
(PrSnapdragonSeed*SnapdragonSeed) +
(PrWatermelonSeed*WatermelonSeed) +
(PrUncutDragonstone*UncutDragonstone) +
(Coins);
TotalPriceLootedInK = (TotalPriceLooted/1000);
int CashPrHr = (int) (Math.floor((TotalPriceLooted * 3000000D) / (System.currentTimeMillis() - StartTime))/1000);
long RunTime = System.currentTimeMillis() - StartTime;
int GainedXPConstitution = (Skills.getExperience(Skills.CONSTITUTION) - StartXPConstitution);
int GainedXPAttack = (Skills.getExperience(Skills.ATTACK) - StartXPAttack);
int GainedXPStrength = (Skills.getExperience(Skills.STRENGTH) - StartXPStrength);
int GainedXPDefense = (Skills.getExperience(Skills.DEFENSE) - StartXPDefense);
int GainedXPRange = (Skills.getExperience(Skills.RANGE) - StartXPRange);
int XPUntilConstitution = (Skills.getExperienceRequired(Skills.getLevel(Skills.CONSTITUTION)+1) - Skills.getExperience(Skills.CONSTITUTION));
int XPUntilAttack = (Skills.getExperienceRequired(Skills.getLevel(Skills.ATTACK)+1) - Skills.getExperience(Skills.ATTACK));
int XPUntilStrength = (Skills.getExperienceRequired(Skills.getLevel(Skills.STRENGTH)+1) - Skills.getExperience(Skills.STRENGTH));
int XPUntilDefense = (Skills.getExperienceRequired(Skills.getLevel(Skills.DEFENSE)+1) - Skills.getExperience(Skills.DEFENSE));
int XPUntilRange = (Skills.getExperienceRequired(Skills.getLevel(Skills.RANGE)+1) - Skills.getExperience(Skills.RANGE));
int CurLvlConstitution = Skills.getLevel(Skills.CONSTITUTION);
int CurLvlAttack = Skills.getLevel(Skills.ATTACK);
int CurLvlStrength = Skills.getLevel(Skills.STRENGTH);
int CurLvlDefense = Skills.getLevel(Skills.DEFENSE);
int CurLvlRange = Skills.getLevel(Skills.RANGE);
int PerHrConstitution = (int) Math.floor((GainedXPConstitution * 3600000D) / (System.currentTimeMillis() - StartTime));
int PerHrAttack = (int) Math.floor((GainedXPAttack * 3600000D) / (System.currentTimeMillis() - StartTime));
int PerHrStrength = (int) Math.floor((GainedXPStrength * 3000000D) / (System.currentTimeMillis() - StartTime));
int PerHrDefense = (int) Math.floor((GainedXPDefense * 3600000D) / (System.currentTimeMillis() - StartTime));
int PerHrRange = (int) Math.floor((GainedXPRange * 3000000D) / (System.currentTimeMillis() - StartTime));
int PercentToConstitution = Skills.getExperienceRequired(CurLvlConstitution+1) / XPUntilConstitution;
int PercentToAttack = Skills.getExperienceRequired(CurLvlAttack+1) / XPUntilAttack;
int PercentToStrength = Skills.getExperienceRequired(CurLvlStrength+1) / XPUntilStrength;
int PercentToDefense = Skills.getExperienceRequired(CurLvlDefense+1) / XPUntilDefense;
int PercentToRange = Skills.getExperienceRequired(CurLvlRange+1) / XPUntilRange;
Graphics2D g = (Graphics2D)g1;
// Draw Paint
g.drawImage(img, 6, 344, null);
// Draw Tabs
if (TabCombat==true)
g.setColor(new Color(0,0,0));
else
g.setColor(new Color(0,0,0,150));
g.fillRect(8, 346, 110, 28);
if (TabLoot==true)
g.setColor(new Color(0,0,0));
else
g.setColor(new Color(0,0,0,150));
g.fillRect(119, 346, 100, 28);
g.setColor(new Color(255,255,255));
g.setFont(title);
g.drawString("Combat Stats", 22, 363);
g.drawString("Loot Stats", 140, 363);
// TAB Combat
if (TabCombat==true) {
g.setColor(new Color(0,0,0));
g.fillRect(18, 418, 252, 5);
g.fillRect(18, 463, 252, 5);
g.setColor(color3);
g.setFont(body);
g.drawString(PerHrConstitution + "xp/hr", 18, 402);
g.drawString("Gained: " + GainedXPConstitution + "xp | " + PercentToConstitution + "% TNL ("+ (CurLvlConstitution+1) + ") " + XPUntilConstitution + "xp", 18, 414);
g.setColor(new Color(255,255,255));
g.fillRect(19, 419, ((250*PercentToConstitution)/100), 3);
g.setColor(color3);
if (ATTACK_STYLE=="Attack") {
g.drawString(PerHrAttack + "xp/hr", 18, 447);
g.drawString("Gained: " + GainedXPAttack + "xp | " + PercentToAttack + "% TNL ("+ (CurLvlAttack+1) + ") " + XPUntilAttack + "xp", 18, 459);
g.setColor(new Color(220,220,0));
g.fillRect(19, 464, ((250*PercentToAttack)/100), 3);
g.setColor(color3);
}
if (ATTACK_STYLE=="Strength") {
g.drawString(PerHrStrength + "xp/hr", 18, 447);
g.drawString("Gained: " + GainedXPStrength + "xp | " + PercentToStrength + "% TNL ("+ (CurLvlStrength+1) + ") " + XPUntilStrength + "xp", 18, 459);
g.setColor(new Color(220,20,20));
g.fillRect(19, 464, ((250*PercentToStrength)/100), 3);
g.setColor(color3);
}
if (ATTACK_STYLE=="Defense") {
g.drawString(PerHrDefense + "xp/hr", 18, 447);
g.drawString("Gained: " + GainedXPDefense + "xp | " + PercentToDefense + "% TNL ("+ (CurLvlDefense+1) + ") " + XPUntilDefense + "xp", 18, 459);
g.setColor(new Color(0,220,220));
g.fillRect(19, 464, ((250*PercentToDefense)/100), 3);
g.setColor(color3);
}
if (ATTACK_STYLE=="Range") {
g.drawString(PerHrRange + "xp/hr", 18, 447);
g.drawString("Gained: " + GainedXPRange + "xp | " + PercentToRange + "% TNL ("+ (CurLvlRange+1) + ") " + XPUntilRange + "xp", 18, 459);
g.setColor(new Color(0,110,30));
g.fillRect(19, 464, ((250*PercentToRange)/100), 3);
g.setColor(color3);
}
g.drawString(Time.format(RunTime), 350, 390);
g.drawString(""+FoodEaten, 365, 404);
g.drawString(""+BankWithdraws, 394, 418);
g.drawString(TotalPriceLootedInK+"k ("+CashPrHr+"k/hr) "+TotalPriceLooted+"gp", 328, 432);
g.drawString(Status, 290, 460);
g.setFont(title);
g.drawString("Constitution: " + CurLvlConstitution, 14, 390);
if (ATTACK_STYLE=="Attack") {
g.drawString("Attack: " + CurLvlAttack, 14, 436);
}
if (ATTACK_STYLE=="Strength") {
g.drawString("Strength: " + CurLvlStrength, 14, 436);
}
if (ATTACK_STYLE=="Defense") {
g.drawString("Defence: " + CurLvlDefense, 14, 436);
}
if (ATTACK_STYLE=="Range") {
g.drawString("Range: " + CurLvlRange, 14, 436);
}
g.drawString("RunTime:", 290, 390);
g.drawString("Food Eaten:", 290, 404);
g.drawString("Bank Withdraws:", 290, 418);
g.drawString("Cash:", 290, 432);
g.drawString("Script Status", 290, 446);
}
// TAB Stats
if (TabLoot==true) {
g.setFont(body);
g.drawString(BlueCharms + " Blue Charms", 18, 393);
g.drawString(CrimsonCharms + " Crimson Charms", 18, 407);
g.drawString(GreenCharms + " Green Charms", 18, 421);
g.drawString(GoldCharms + " Gold Charms", 18, 435);
g.drawString(RuneShield + " Rune Shields", 18, 449);
g.drawString(RuneScimitar + " Rune Scimitars", 18, 463);
g.drawString(MithOre + " Mithril Ore", 180, 393);
g.drawString(AdamOre + " Adamanite Ore", 180, 407);
g.drawString(LawRunes + " Law Runes", 180, 421);
g.drawString(DeathRunes + " Death Runes", 180, 435);
g.drawString(BloodRunes + " Blood Runes", 180, 449);
g.drawString(FireRunes + " Fire Runes", 180, 463);
g.drawString(TorstolSeed + " Torstol Seeds", 320, 393);
g.drawString(SnapdragonSeed + " Snapdragon Seeds", 320, 407);
g.drawString(WatermelonSeed + " Watermelon Seeds", 320, 421);
g.drawString(MagicSeed + " Magic Seeds", 320, 435);
g.drawString(UncutDragonstone + " Uncut Dragonstone", 320, 449);
g.drawString(Coins + " Coins", 320, 463);
}
// Draw mouse
if (System.currentTimeMillis() - Mouse.getPressTime() < 300)
g.setColor(new Color(255,255,255));
else
g.setColor(new Color(255,255,255,80));
g.drawLine(Mouse.getLocation().x - 7, Mouse.getLocation().y + 1, Mouse.getLocation().x + 7, Mouse.getLocation().y + 1);
g.drawLine(Mouse.getLocation().x + 1, Mouse.getLocation().y - 7,Mouse.getLocation().x + 1, Mouse.getLocation().y + 7);
g.drawLine(Mouse.getLocation().x - 7, Mouse.getLocation().y - 1, Mouse.getLocation().x + 7, Mouse.getLocation().y - 1);
g.drawLine(Mouse.getLocation().x - 1, Mouse.getLocation().y - 7,Mouse.getLocation().x - 1, Mouse.getLocation().y + 7);
g.setColor(new Color(0,0,0));
g.drawLine(Mouse.getLocation().x - 7, Mouse.getLocation().y, Mouse.getLocation().x + 7, Mouse.getLocation().y);
g.drawLine(Mouse.getLocation().x, Mouse.getLocation().y - 7,Mouse.getLocation().x, Mouse.getLocation().y + 7);
g.fillOval(Mouse.getLocation().x - 2, Mouse.getLocation().y - 2, 4, 4);
}
@Override
public void mouseClicked(MouseEvent e) {
p = e.getPoint();
if (RecTabCombat.contains(p) && !TabCombat) {
TabCombat = true;
TabLoot = false;
}
if (RecTabLoot.contains(p) && !TabLoot) {
TabLoot = true;
TabCombat = false;
}
}
@Override
public void mousePressed(MouseEvent e) {}
@Override
public void mouseReleased(MouseEvent e) {}
@Override
public void mouseEntered(MouseEvent e) {}
@Override
public void mouseExited(MouseEvent e) {}
//GUI credit to SeyreZ
@SuppressWarnings("serial")
public class JustRoachesGUI extends JFrame {
public JustRoachesGUI() {
initComponents();
}
private void okButtonActionPerformed(ActionEvent e) {
String f = foodid.getSelectedItem().toString();
if (f.equals("Lobster")) {
FOOD_ID = 379;
} else if (f.equals("Monkfish")) {
FOOD_ID = 7946;
} else if (f.equals("Shark")) {
FOOD_ID = 385;
} else if (f.equals("Rocktail")) {
FOOD_ID = 15272;
} else if (f.equals("Tuna")) {
FOOD_ID = 361;
} else if (f.equals("Swordfish")) {
FOOD_ID = 373;
} else if (f.equals("Bass")) {
FOOD_ID = 365;
} else if (f.equals("Manta Ray")) {
FOOD_ID = 391;
}
String a = combatStyle.getSelectedItem().toString();
if (a.equals("Attack")) {
ATTACK_STYLE = "Attack";
} else if (a.equals("Strength")) {
ATTACK_STYLE = "Strength";
} else if (a.equals("Defense")) {
ATTACK_STYLE = "Defense";
} else if (a.equals("Range")) {
ATTACK_STYLE = "Range";
}
String w = withdraw.getSelectedItem().toString();
if (w=="5") {
WITHDRAW_AMT = 5;
} else if (w=="10") {
WITHDRAW_AMT = 10;
} else if (w=="15") {
WITHDRAW_AMT = 15;
} else if (w=="20") {
WITHDRAW_AMT = 20;
}
String h = eatpercent.getSelectedItem().toString();
if (h=="85") {
EAT_PERCENT = (int) 8.5;
} else if (h=="80") {
EAT_PERCENT = 8;
} else if (h=="75") {
EAT_PERCENT = (int) 7.5;
} else if (h=="70") {
EAT_PERCENT = 7;
} else if (h=="65") {
EAT_PERCENT = (int) 6.5;
} else if (h=="60") {
EAT_PERCENT = 6;
} else if (h=="55") {
EAT_PERCENT = (int) 5.5;
} else if (h=="50") {
EAT_PERCENT = 5;
} else if (h=="45") {
EAT_PERCENT = (int) 4.5;
} else if (h=="40") {
EAT_PERCENT = 4;
}
log.info("Starting Script");
setVisible(false);
guiRunning = false;
dispose();
}
private void initComponents() {
dialogPane = new JPanel();
contentPanel = new JPanel();
tabs = new JTabbedPane();
settingspanel = new JPanel();
combatStyle = new JComboBox();
label2 = new JLabel();
label3 = new JLabel();
foodid = new JComboBox();
label4 = new JLabel();
withdraw = new JComboBox();
label5 = new JLabel();
eatpercent = new JComboBox();
label6 = new JLabel();
lootpanel = new JPanel();
label1 = new JLabel();
buttonBar = new JPanel();
okButton = new JButton();
setResizable(false);
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
{
dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
dialogPane.setLayout(new BorderLayout());
{
contentPanel.setLayout(null);
{
tabs.setFont(tabs.getFont().deriveFont(tabs.getFont().getStyle() | Font.BOLD));
{
settingspanel.setBackground(Color.white);
settingspanel.setLayout(null);
combatStyle.setModel(new DefaultComboBoxModel(new String[] {
"Attack",
"Strength",
"Defense",
"Range"
}));
settingspanel.add(combatStyle);
combatStyle.setBounds(185, 15, 120, combatStyle.getPreferredSize().height);
label2.setText("Combat Style");
settingspanel.add(label2);
label2.setBounds(15, 15, 180, 20);
label3.setText("Food to Eat");
settingspanel.add(label3);
label3.setBounds(15, 55, 180, 20);
foodid.setModel(new DefaultComboBoxModel(new String[] {
"Lobster",
"Swordfish",
"Shark",
"Monkfish",
"Rocktail",
"Manta Ray",
"Tuna",
"Bass"
}));
settingspanel.add(foodid);
foodid.setBounds(185, 55, 120, 20);
label4.setText("Withdraw Amount");
settingspanel.add(label4);
label4.setBounds(15, 95, 180, 20);
withdraw.setModel(new DefaultComboBoxModel(new String[] {
"5",
"10",
"15",
"20"
}));
settingspanel.add(withdraw);
withdraw.setBounds(240, 95, 65, 20);
label5.setText("Eat at Health%");
settingspanel.add(label5);
label5.setBounds(15, 135, 180, 20);
eatpercent.setModel(new DefaultComboBoxModel(new String[] {
"85",
"80",
"75",
"70",
"65",
"60",
"55",
"50",
"45",
"40"
}));
settingspanel.add(eatpercent);
eatpercent.setBounds(240, 135, 65, 20);
label6.setText("60% is best");
label6.setFont(label6.getFont().deriveFont(label6.getFont().getStyle() | Font.ITALIC, label6.getFont().getSize() - 1f));
settingspanel.add(label6);
label6.setBounds(175, 135, 65, 20);
{
Dimension preferredSize = new Dimension();
for(int i = 0; i < settingspanel.getComponentCount(); i++) {
Rectangle bounds = settingspanel.getComponent(i).getBounds();
preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
}
Insets insets = settingspanel.getInsets();
preferredSize.width += insets.right;
preferredSize.height += insets.bottom;
settingspanel.setMinimumSize(preferredSize);
settingspanel.setPreferredSize(preferredSize);
}
}
tabs.addTab("Settings", settingspanel);
{
lootpanel.setBackground(Color.white);
lootpanel.setLayout(null);
{
Dimension preferredSize = new Dimension();
for(int i = 0; i < lootpanel.getComponentCount(); i++) {
Rectangle bounds = lootpanel.getComponent(i).getBounds();
preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
}
Insets insets = lootpanel.getInsets();
preferredSize.width += insets.right;
preferredSize.height += insets.bottom;
lootpanel.setMinimumSize(preferredSize);
lootpanel.setPreferredSize(preferredSize);
}
}
tabs.addTab("Loot Options", lootpanel);
}
contentPanel.add(tabs);
tabs.setBounds(0, 35, 320, 205);
label1.setText("JustRoaches GUI");
label1.setFont(new Font("Verdana", Font.BOLD, 26));
contentPanel.add(label1);
label1.setBounds(new Rectangle(new Point(40, -5), label1.getPreferredSize()));
{
Dimension preferredSize = new Dimension();
for(int i = 0; i < contentPanel.getComponentCount(); i++) {
Rectangle bounds = contentPanel.getComponent(i).getBounds();
preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
}
Insets insets = contentPanel.getInsets();
preferredSize.width += insets.right;
preferredSize.height += insets.bottom;
contentPanel.setMinimumSize(preferredSize);
contentPanel.setPreferredSize(preferredSize);
}
}
dialogPane.add(contentPanel, BorderLayout.CENTER);
{
buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
buttonBar.setLayout(new GridBagLayout());
((GridBagLayout)buttonBar.getLayout()).columnWidths = new int[] {0, 80};
((GridBagLayout)buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0};
okButton.setText("Start Script");
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
okButtonActionPerformed(e);
}
});
buttonBar.add(okButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
}
dialogPane.add(buttonBar, BorderLayout.SOUTH);
}
contentPane.add(dialogPane, BorderLayout.CENTER);
pack();
setLocationRelativeTo(getOwner());
}
private JPanel dialogPane;
private JPanel contentPanel;
private JTabbedPane tabs;
private JPanel settingspanel;
private JComboBox combatStyle;
private JLabel label2;
private JLabel label3;
private JComboBox foodid;
private JLabel label4;
private JComboBox withdraw;
private JLabel label5;
private JComboBox eatpercent;
private JLabel label6;
private JPanel lootpanel;
private JLabel label1;
private JPanel buttonBar;
private JButton okButton;
}
}
any of that help idk i found in a old script i had
sorry if it was jsut a spamm or anytthing its one of the powerbot scripts so idk if it could hlep you with the double item picking up and shit buti tried? :)