Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.SystemColor;
- import java.awt.event.MouseAdapter;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.beans.PropertyChangeEvent;
- import java.beans.PropertyChangeListener;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.URL;
- import java.net.URLConnection;
- import java.util.ArrayList;
- import java.util.Arrays;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JEditorPane;
- import javax.swing.JFileChooser;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JMenu;
- import javax.swing.JMenuBar;
- import javax.swing.JMenuItem;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JSlider;
- import javax.swing.JTabbedPane;
- import javax.swing.WindowConstants;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.util.Timer;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.GEItemInfo;
- @ScriptManifest(authors = "Rapid", name = "AutoPapayaSpawn2", keywords = "Summoning", version = 1.30, description = "Spawns Fruits.")
- public class AutoPapayaSpawn2 extends Script implements PaintListener, ServerMessageListener{
- private int totalProfit, totalExpenses, profitPerHour, papayaPrice, potionPrice, orangePrice, scrollPrice, dosesDrank, totalOrange, totalPapaya, potTotal, scrollTotal;
- private int PapayaID = 5972;
- private int OrangeID = 2108;
- private int WatermelonID = 5982;
- private int WatermelonseedID = 5321;
- private int CoconutID = 5974;
- private int ScrollID = 12423;
- private int PouchID = 12033;
- private int SumPot4 = 12140;
- private int SumPot3 = 12142;
- private int SumPot2 = 12144;
- private int SumPot1 = 12146;
- private ArrayList<RSGroundItem> PapayaList = new ArrayList<RSGroundItem>();
- private int[] objBankID = {11758, 11402, 34752, 35647, 2213, 25808, 2213, 26972, 27663, 4483, 14367, 19230, 29085, 12759, 6084, 24914, 52589};//done
- private int ChestID = 4483;
- private int[] ObeliskID = {29954, 29959};
- private RSTile EdgeEastSpawn = new RSTile(3102, 3498);
- private RSTile EdgeEastBank = new RSTile(3097, 3498);
- private RSArea EdgevilleBankArea = new RSArea(new RSTile(3091, 3488), new RSTile(3098, 3499));
- private RSArea EdgevilleFurnace = new RSArea(new RSTile(3106, 3498), new RSTile(3109, 3502));
- private RSTile EdgeWestSpawn = new RSTile(3087, 3491);
- private RSTile EdgeWestBank = new RSTile(3093, 3491);
- private RSTile EdgeObelisk = new RSTile(3128, 3517);
- private RSTile CastleWarsSpawn = new RSTile(2461, 3090);
- private RSTile CastleWarsBank = new RSTile(2442, 3084);
- private RSArea CastleWarsBankArea = new RSArea(new RSTile(2440, 3082), new RSTile(2445, 3087));
- private RSTile CastleWarsObelisk = new RSTile(2462, 3088);
- private RSTile ZanarisSpawn = new RSTile(2390, 4450);//done
- private RSTile ZanarisBank = new RSTile(2383, 4458);//done
- private RSArea ZanarisBankArea = new RSArea(new RSTile(2384, 4455), new RSTile(2378, 4462));//done
- private RSTile ZanarisObelisk = new RSTile(2405, 4444);//done
- private RSArea BankArea;
- private RSTile SpawnTile;
- private RSTile BankTile;
- private RSTile ObeliskTile;
- private boolean getPouch = false;
- private boolean getDrink = false;
- private boolean outOfPoints = false;
- private boolean doCall;
- private boolean usePotion;
- private int StartScrollCount;
- private int CurrentScrollCount;
- private int StartExp;
- private long StartTime;
- private int PapayasCollected;
- private int OrangesCollected;
- private String Status;
- private int toCast = 1;
- private int casted;
- private int errorCount = 0;
- //AntiBan variables
- private AntiBan antiban;
- private int sleepTimer;
- private int minChange;
- private int maxChange;
- private int minHeight;
- private int maxHeight;
- //GUI Variables
- public boolean waitGUI = true;
- public boolean stopScript = false;
- public String location;
- private enum State{
- SUMMON, SPAWN, BANK, WALK_TO_OBELISK, USE_OBELISK, DRINK, SLEEP, PICK_UP, WALK_TO_SPAWN;
- }
- private enum Location{
- EDGE_NORTH, EDGE_SOUTH
- }
- public AutoPapayaSpawn2(){
- this.antiban = new AntiBan(this);
- }
- class AntiBan extends Thread {
- private AutoPapayaSpawn2 parent;
- AntiBan(AutoPapayaSpawn2 parent){
- this.parent = parent;
- }
- @Override
- public void run(){
- try{
- while(parent.isActive()){
- if (!parent.isPaused()){
- int CameraHeight = camera.getPitch(), CameraAngle = camera.getAngle();
- int rnd = random(0, 10);
- switch (rnd){
- case 1:
- if (CameraHeight >= 50){
- camera.setPitch(CameraHeight - random(minChange, maxChange));
- }else{
- camera.setPitch(CameraHeight + random(minHeight, maxHeight));
- }
- camera.setAngle(CameraAngle + random(minHeight, maxHeight));
- sleep(random(1000, 1500));
- break;
- case 2:
- if (CameraHeight >= 50){
- camera.setPitch(CameraHeight - random(minHeight, maxHeight));
- }else{
- camera.setPitch(CameraHeight + random(minHeight, maxHeight));
- }
- camera.setAngle(CameraAngle - random(minChange, maxChange));
- sleep(random(1000, 1500));
- break;
- }
- sleep(random(sleepTimer - 1000, sleepTimer + 1000));
- }
- }
- }catch(Exception e){
- log("Exception");
- }
- }
- }
- public double getVersion(){
- return 1.275;
- }
- public boolean onStart(){
- final GEItemInfo PapayaGE = grandExchange.loadItemInfo(PapayaID);
- papayaPrice = PapayaGE.getMarketPrice();
- log("Price of Papypa: " + papayaPrice);
- final GEItemInfo OrangeGE = grandExchange.loadItemInfo(OrangeID);
- orangePrice = OrangeGE.getMarketPrice();
- log("Price of Orange: " + orangePrice);
- final GEItemInfo ScrollGE = grandExchange.loadItemInfo(ScrollID);
- scrollPrice = ScrollGE.getMarketPrice();
- log("Price of Scroll: " + scrollPrice);
- final GEItemInfo PotGE = grandExchange.loadItemInfo(SumPot4);
- potionPrice = PotGE.getMarketPrice();
- log("Price of Summoning Potion (4): " + potionPrice);
- mouse.setSpeed (4);
- TestGUI1 gui = new TestGUI1();
- gui.setVisible(true);
- while (waitGUI){
- sleep(random(100, 200));
- minChange = gui.angleChange.getValue() - 20;
- maxChange = gui.angleChange.getValue() + 20;
- minHeight = gui.maxHeight.getValue() - 20;
- maxHeight = gui.maxHeight.getValue() + 20;
- sleepTimer = gui.sleepTimer.getValue();
- gui.lblSleep.setText("Sleep timer (Current max: " + (sleepTimer + 1000) + " Current min: " + (sleepTimer - 1000) + ")");
- gui.lblAngle.setText("Average angle change (Current max: " + maxChange + " Current min: " + minChange + ")");
- gui.lblHeight.setText("Average height change (Current max: " + maxHeight + " Current min: " + minHeight + ")");
- usePotion = gui.checkSummoning.isSelected();
- }
- if (stopScript == true){
- return false;
- }else{
- log(location);
- if (location == "Edgeville East"){
- BankTile = EdgeEastBank;
- SpawnTile = EdgeEastSpawn;
- BankArea = EdgevilleBankArea;
- ObeliskTile = EdgeObelisk;
- }else if (location == "Edgeville West"){
- BankTile = EdgeWestBank;
- SpawnTile = EdgeWestSpawn;
- BankArea = EdgevilleBankArea;
- ObeliskTile = EdgeObelisk;
- }else if (location == "Zanaris"){//done
- BankTile = ZanarisBank;//done
- SpawnTile = ZanarisSpawn;//done
- BankArea = ZanarisBankArea;//done
- ObeliskTile = ZanarisObelisk;//done
- }else if (location == "Castle Wars"){
- BankTile = CastleWarsBank;
- SpawnTile = CastleWarsSpawn;
- BankArea = CastleWarsBankArea;
- ObeliskTile = CastleWarsObelisk;
- }else{
- return false;
- }
- }
- antiban.start();
- StartTime = System.currentTimeMillis();
- return true;
- }
- void depositAllExcept(int[] notBank){
- for (RSItem temp : inventory.getItems()){
- boolean bank = true;
- for (int i=0;i<=notBank.length-1;i++){
- if (temp.getID() == notBank[i]){
- bank = false;
- break;
- }
- }
- if (bank == true){
- if (inventory.getCount(temp.getID()) == 1){
- temp.doAction("Deposit");
- sleep(random(500, 800));
- }else if (inventory.getCount(temp.getID()) > 1){
- temp.doAction("Deposit-All");
- sleep(random(500, 800));
- }
- }
- }
- }
- @Override
- public int loop() {
- if (game.isLoggedIn()){
- try{ if (StartScrollCount == 0){ StartScrollCount = inventory.getItem(ScrollID).getStackSize();} }catch(Exception e){}
- if (interfaces.get(671) != null){
- interfaces.get(671).getComponent(13).doClick();
- }
- if (interfaces.get(11) != null){
- interfaces.get(11).getComponent(15).doClick();
- log ("Closed deposit box.");
- }
- switch(getState()){
- case USE_OBELISK:
- RSObject obelisk = objects.getNearest(ObeliskID);
- if (obelisk != null){
- if (obelisk.doClick()){
- break;
- }else{
- return random(100, 300);
- }
- }
- break;
- case DRINK:
- int[] allPots = {SumPot1, SumPot2, SumPot3, SumPot4};
- for (int i=0;i<=allPots.length-1;i++){
- if (inventory.getCount(allPots[i]) > 0){
- if (inventory.getItem(allPots[i]).doAction("Drink")) {
- dosesDrank++;
- return random(500, 800);
- }
- }
- }
- getDrink = true;
- break;
- case SUMMON:
- inventory.getItem(PouchID).doAction("Summon");
- return random(1250, 1500);
- case BANK:
- if (bank.isOpen()){
- int[] dontBankwPots = {ScrollID, PouchID, SumPot1, SumPot2, SumPot3, SumPot4};
- int[] dontBankwoPots = {ScrollID, PouchID};
- int[] dontBank;
- if (usePotion){
- dontBank = dontBankwPots;
- }else{
- dontBank = dontBankwoPots;
- }
- if (inventory.contains(PapayaID)){
- PapayasCollected = PapayasCollected + inventory.getCount(PapayaID);
- }
- if (inventory.contains(OrangeID)){
- OrangesCollected = OrangesCollected + inventory.getCount(OrangeID);
- }
- while (!bankAllExcept2(dontBank)){
- errorCount++;
- if(errorCount == 8) {
- PapayasCollected = PapayasCollected - inventory.getCount(PapayaID); //To reset correct amounts if bank accidentally closes
- OrangesCollected = OrangesCollected - inventory.getCount(OrangeID);
- //log ("Yikes, banking error.");
- break;
- }
- }
- errorCount = 0;
- mouse.setSpeed(4);
- bank.depositAllFamiliar();//Thank you for this line, Rapid :)
- sleep(random(850, 1250));
- if (bank.getCount(PouchID) != 0 && getPouch == true){
- bank.withdraw(PouchID, 1);
- sleep(random(800, 1250));
- getPouch = false;
- }else if(getPouch == true){
- log("Ran out of pouches...");
- stopScript();
- }
- if (getDrink == true || (usePotion && getDoses() < 8)){
- int[] sumPots = {SumPot1, SumPot2, SumPot3, SumPot4};
- if (bank.getCount(sumPots) > 2){
- for (int i=0;i<=sumPots.length-1;i++){
- if (bank.getCount(sumPots[i]) > 1){
- bank.withdraw(sumPots[i], 2);
- getDrink = false;
- break;
- }
- }
- }else{
- log("Out of potions. Switching to other method.");
- getDrink = false;
- usePotion = false;
- //stopScript();
- }
- }
- if (containsOnly(dontBank))
- bank.close();
- }else{
- RSObject bank1 = objects.getNearest(objBankID);
- RSObject bank2 = objects.getNearest(ChestID);
- if (bank2 != null){
- if (bank2.isOnScreen() && BankArea.contains(getMyPlayer().getLocation())){
- if (bank2.doAction("Use")){
- sleep(random(1500, 2000));
- }else{
- return random(100, 300);
- }
- }else{
- walking.walkTileMM(walking.getClosestTileOnMap(bank2.getLocation()), random(0,3), random(0,3));
- }
- }else if (bank1 != null){
- if (bank1.isOnScreen() && BankArea.contains(getMyPlayer().getLocation())){
- if (bank1.doAction("Use-quickly")){
- sleep(random(1500, 2000));
- }else{
- return random(100, 300);
- }
- }else{
- walking.walkTileMM(walking.getClosestTileOnMap(bank1.getLocation()), random(0,3), random(0,3));
- }
- }else{
- walking.walkTileMM(walking.getClosestTileOnMap(BankTile), random(0,3), random(0,3));
- }
- }
- break;
- case WALK_TO_OBELISK:
- if (!walking.walkTileMM(walking.getClosestTileOnMap(ObeliskTile), random(0,3), random(0,3))){
- walking.walkTo(ObeliskTile);
- }
- break;
- case WALK_TO_SPAWN:
- if (!walking.walkTileMM(walking.getClosestTileOnMap(SpawnTile), random(0,3), random(0,3))){
- walking.walkTo(SpawnTile);
- }
- break;
- case SPAWN:
- CurrentScrollCount = inventory.getItem(ScrollID).getStackSize();
- if (doCall == true){
- if (summoning.doCallFollower()){
- doCall = false;
- return random(1500, 2000);
- }else{
- return random(100, 300);
- }
- }else{
- if (interfaces.getComponent(747, 2).containsText("Cast")){
- if (interfaces.getComponent(747, 2).doClick()){
- casted++;
- return random(2250, 2500);
- }else{
- return random(300, 500);
- }
- }else{
- if (interfaces.getComponent(747, 2).doAction("Cast")){
- casted++;
- return random(2250, 2500);
- }else{
- return random(300, 500);
- }
- }
- }
- case SLEEP:
- return random(500, 750);
- case PICK_UP:
- try{
- int rnd1 = random(0, PapayaList.size());
- int distance = 99999;
- for (int i = 0; i < PapayaList.size(); i++) {
- if(calc.distanceTo(PapayaList.get(i).getLocation()) < distance){
- rnd1 = i;
- distance = calc.distanceTo(PapayaList.get(i).getLocation());
- }else if (calc.distanceTo(PapayaList.get(i).getLocation()) == distance) {
- if (random (1,3) < 2) {
- rnd1 = i;
- distance = calc.distanceTo(PapayaList.get(i).getLocation());
- }
- }
- }
- if (!getMyPlayer().isMoving()){
- if (PapayaList.get(rnd1).isOnScreen()){
- //int rnd = random(0, PapayaList.size());
- if (PapayaList.get(rnd1).getItem().getID() == OrangeID){
- if (tiles.doAction(PapayaList.get(rnd1).getLocation(),random(0.48, 0.52),random(0.48, 0.52),0,"Take Orange")){
- return random(1250, 1500);
- }else{
- return random(100, 300);
- }
- }else
- if (PapayaList.get(rnd1).getItem().getID() == WatermelonID){
- if (tiles.doAction(PapayaList.get(rnd1).getLocation(),random(0.48, 0.52),random(0.48, 0.52),0,"Take Watermelon")){
- return random(1250, 1500);
- }else{
- return random(100, 300);
- }
- }else
- if (PapayaList.get(rnd1).getItem().getID() == PapayaID){
- if (tiles.doAction(PapayaList.get(rnd1).getLocation(),random(0.48, 0.52),random(0.48, 0.52),0,"Take Papaya")){
- return random(1250, 1500);
- }else{
- return random(100, 300);
- }
- }else
- if (PapayaList.get(rnd1).getItem().getID() == WatermelonseedID){
- if (tiles.doAction(PapayaList.get(rnd1).getLocation(),random(0.48, 0.52),random(0.48, 0.52),0,"Take Watermelon seed")){
- return random(1250, 1500);
- }else{
- return random(100, 300);
- }
- }else
- if (PapayaList.get(rnd1).getItem().getID() == CoconutID){
- if (tiles.doAction(PapayaList.get(rnd1).getLocation(),random(0.48, 0.52),random(0.48, 0.52),0,"Take Coconut")){
- return random(1250, 1500);
- }else{
- return random(100, 300);
- }
- }
- }else{
- walking.walkTileMM(walking.getClosestTileOnMap(PapayaList.get(rnd1).getLocation()), random(0,2), random(0,2));
- }
- }
- }catch(Exception e){
- casted = 0;
- toCast = random(2, 5);
- }
- break;
- }
- }else{
- return random(100, 300);
- }
- return random(250, 500);
- }
- private State getState(){
- PapayaList.clear();
- for (RSGroundItem items : groundItems.getAll()){
- if(calc.distanceTo(items.getLocation()) < 8){
- if (items.getItem().getID() == PapayaID){
- PapayaList.add(items);
- }
- if (items.getItem().getID() == OrangeID){
- PapayaList.add(items);
- }
- if (items.getItem().getID() == WatermelonID){
- PapayaList.add(items);
- }
- if (items.getItem().getID() == WatermelonseedID){
- PapayaList.add(items);
- }
- if (items.getItem().getID() == CoconutID){
- PapayaList.add(items);
- }
- }
- }
- if (PapayaList.size() == 0){
- toCast = random(3, 6);
- casted = 0;
- }
- if (getMyPlayer().isMoving() && calc.distanceTo(walking.getDestination()) >= 3 || getMyPlayer().getAnimation() == 7660 || getMyPlayer().isMoving() &&
- BankArea.contains(getMyPlayer().getLocation())){
- Status = "SLEEP";
- return State.SLEEP;
- }else if (bank.isOpen() || inventory.isFull() || getPouch == true || getDrink == true){
- Status = "BANK";
- return State.BANK;
- }else if (!inventory.isFull() && casted >= toCast || (inventory.getCount() + PapayaList.size()) >= 28 && !inventory.isFull()){
- Status = "PICK_UP";
- return State.PICK_UP;
- }else if (summoning.isFamiliarSummoned()){
- if (outOfPoints != true){
- if (calc.distanceTo(SpawnTile) <= 2 && !BankArea.contains(getMyPlayer().getLocation()) && !EdgevilleFurnace.contains(getMyPlayer().getLocation())){
- Status = "SPAWN";
- return State.SPAWN;
- }else{
- Status = "WALK_TO_SPAWN";
- return State.WALK_TO_SPAWN;
- }
- }else{
- if (usePotion == true){
- outOfPoints = false;
- Status = "DRINK";
- return State.DRINK;
- }else{
- outOfPoints = false;
- sleep(random(10000, 15000));
- Status = "SLEEP_LOW_POINTS";
- return State.SLEEP;
- }
- }
- }else if (inventory.contains(PouchID)){
- if (summoning.getSummoningPoints() <= 2){
- if (usePotion == true){
- Status = "DRINK";
- return State.DRINK;
- }else{
- RSObject Obelisk = objects.getNearest(ObeliskID);
- if (Obelisk != null){
- if (Obelisk.isOnScreen()){
- Status = "USE_OBELISK";
- return State.USE_OBELISK;
- }else{
- Status = "WALK_TO_OBELISK";
- return State.WALK_TO_OBELISK;
- }
- }else{
- Status = "WALK_TO_OBELISK";
- return State.WALK_TO_OBELISK;
- }
- }
- }else{
- Status = "SUMMON";
- return State.SUMMON;
- }
- }else{
- Status = "BANK";
- getPouch = true;
- return State.BANK;
- }
- }
- public int getDoses () {
- return (inventory.getCount(SumPot1) + inventory.getCount(SumPot2)*2 + inventory.getCount(SumPot3)*3 + inventory.getCount(SumPot4)*4);
- }
- public boolean bankAllExcept2 (int... items) {
- mouse.setSpeed(6);
- RSItem [] invItems = inventory.getItems();
- int[] sumPots = {SumPot1, SumPot2, SumPot3, SumPot4};
- RSItem toBank;
- String bankAction;
- RSComponent nextBank = null;
- ArrayList<Integer> bankList = new ArrayList<Integer>();
- for (RSItem item : invItems) { //Go through all items in inventory
- for (int id : items) { //Go through all items not to bank
- if (!bankList.contains(item.getID())){
- bankList.add(item.getID());
- }
- if(item.getID() == id) { //If the ID of the inventory item is not on the list
- bankList.remove(bankList.size()-1);
- break;
- }
- }
- }
- if (bankList.size() > 0) {
- for (int i=0; i< bankList.size(); i++) {
- toBank = inventory.getItem(bankList.get(i));
- try {
- nextBank = inventory.getItem(bankList.get(i+1)).getComponent();
- }catch (Exception e) {
- nextBank = interfaces.getComponent(bank.INTERFACE_BANK,
- bank.INTERFACE_BANK_BUTTON_DEPOSIT_BEAST_INVENTORY);
- }
- if (toBank != null) {
- if (inventory.getCount(bankList.get(i)) > 1) {
- bankAction = "Deposit-All";
- }else{bankAction = "Deposit";}
- if (toBank.doAction(bankAction)){
- sleep (200,350);
- if (nextBank != null)
- nextBank.doHover();
- for (int w = 0; w < 11; w++) {
- if (inventory.contains(bankList.get(i))){
- sleep (100,150);
- }else{
- sleep (500,700);
- break;
- }
- }
- }
- }
- }
- }
- return containsOnly(items);
- }
- public boolean containsOnly (int[] items) {
- RSItem [] invItems = inventory.getItems(); //getItems seems to return all blank item spaces with an item with no name. Sadface.
- boolean haveOnly = true;
- for (RSItem item : invItems)
- for (int i=0; i< items.length; i++){
- if (item.getID() == items [i]){
- break;
- }
- if (i == items.length-1){
- try {
- item.getName().charAt(0);
- }catch (Exception e){break;}
- haveOnly = false;
- }
- }
- return haveOnly;
- }
- @Override
- public void onRepaint(Graphics g1) {
- totalPapaya = PapayasCollected * papayaPrice;
- totalOrange = OrangesCollected * orangePrice;
- scrollTotal = (StartScrollCount - CurrentScrollCount)*scrollPrice;
- potTotal = dosesDrank*(potionPrice/4);
- totalExpenses = potTotal + scrollTotal;
- totalProfit = totalOrange + totalPapaya - totalExpenses;
- profitPerHour = (int) ((totalProfit) * 3600000D / (System.currentTimeMillis() - StartTime));
- final Color color1 = new Color(0, 0, 0);
- final Font font1 = new Font("Arial", 1, 22);
- final Font font2 = new Font("Arial", 0, 16);
- if (game.isLoggedIn()){
- if (StartExp == 0){
- StartExp = skills.getCurrentExp(23);
- }
- g1.setColor(new Color(0,0,0));
- //Box paint
- g1.setColor(new Color(255, 0, 0, 160));//transparent red
- g1.fillRect(300, 4, 216, 158);
- g1.setColor(new Color(212, 193, 156));//base color
- g1.setColor(new Color(255, 0, 0, 160));//transparent red
- //String paints
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("AutoPapayaSpawn", 315, 338);
- g.setFont(font2);
- if (totalProfit > 99999) {
- g.drawString("Total Money Gain: " + totalProfit / 1000 + "k",
- 315, 55);
- } else {
- g.drawString("Total Money Gain: " + totalProfit, 315, 55);
- }
- if (totalExpenses > 99999) {
- g.drawString("Total Expenses: " + totalExpenses / 1000 + "k",
- 315, 70);
- } else {
- g.drawString("Total Expenses: " + totalExpenses, 315, 70);
- }
- if (profitPerHour > 99999) {
- g.drawString("Profit Per Hour: " + profitPerHour / 1000 + "k",
- 315, 85);
- } else {
- g.drawString("Profit Per Hour: " + profitPerHour, 315, 85);
- }
- g.drawString("Runtime: " + Timer.format(System.currentTimeMillis() - StartTime), 315, 25);
- g.drawString("Scrolls used: " + (StartScrollCount - CurrentScrollCount), 315, 40);
- g.drawString("Experience gained: " + (skills.getCurrentExp(23) - StartExp), 315, 100);
- g.drawString("Papayas banked: " + PapayasCollected, 315, 115);
- g.drawString("Oranges banked: " + OrangesCollected, 315, 130);
- g.drawString("Status: " + Status, 315, 145);
- //Mouse paint
- int x = mouse.getLocation().x;
- int y = mouse.getLocation().y;
- g1.drawLine(x, y, x + 1000, y);
- g1.drawLine(x, y, x - 1000, y);
- g1.drawLine(x, y, x, y + 500);
- g1.drawLine(x, y, x, y - 500);
- }
- }
- @Override
- public void serverMessageRecieved(ServerMessageEvent e) {
- if (e.getMessage().toLowerCase().contains("special move bar is too low")){
- outOfPoints = true;
- }
- if (e.getMessage().toLowerCase().contains("too far away")){
- doCall = true;
- }
- if (e.getMessage().toLowerCase().contains("have been updated")){
- log ("Yay, GE items are in!");
- }
- }
- public class TestGUI1 extends JFrame {
- public TestGUI1() {
- initComponents();
- lblHeight.setToolTipText("This sets the average height change for the anti-ban. The min and max change are either this value +20, or -20");
- lblAngle.setToolTipText("This sets the average angle change for the anti-ban. The min and max change are either this value +20 or -20");
- lblSleep.setToolTipText("This is the average sleep for the anti-ban. The higher the value, the more it waits before reactivating");
- }
- private void startScriptMouseClicked(MouseEvent e) {
- waitGUI = false;
- location = comboBox1.getModel().getSelectedItem().toString();
- dispose();
- }
- private void cancelScriptMouseClicked(MouseEvent e) {
- waitGUI = false;
- stopScript = true;
- dispose();
- }
- private void slider1PropertyChange(PropertyChangeEvent e) {
- lblSleep.setText("Sleep timer (Currently " + sleepTimer.getValue() + ")");
- }
- private void sleepTimerPropertyChange(PropertyChangeEvent e) {
- lblSleep.setText("Sleep timer (Currently " + sleepTimer.getValue() + ")");
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - alex maley
- menuBar1 = new JMenuBar();
- startScript = new JMenu();
- cancelScript = new JMenu();
- label1 = new JLabel();
- tabbedPane1 = new JTabbedPane();
- panel1 = new JPanel();
- comboBox1 = new JComboBox();
- label2 = new JLabel();
- label8 = new JLabel();
- label9 = new JLabel();
- label10 = new JLabel();
- editorPane2 = new JEditorPane();
- editorPane3 = new JEditorPane();
- checkSummoning = new JCheckBox();
- panel2 = new JPanel();
- editorPane1 = new JEditorPane();
- lblSleep = new JLabel();
- sleepTimer = new JSlider();
- label5 = new JLabel();
- angleChange = new JSlider();
- lblAngle = new JLabel();
- lblHeight = new JLabel();
- maxHeight = new JSlider();
- //======== this ========
- setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
- setResizable(false);
- setTitle("AutoPapayaSpawn");
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- //======== menuBar1 ========
- {
- //======== startScript ========
- {
- startScript.setText("Start Script");
- startScript.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- startScriptMouseClicked(e);
- }
- });
- }
- menuBar1.add(startScript);
- //======== cancelScript ========
- {
- cancelScript.setText("Cancel");
- cancelScript.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- cancelScriptMouseClicked(e);
- }
- });
- }
- menuBar1.add(cancelScript);
- }
- setJMenuBar(menuBar1);
- //---- label1 ----
- label1.setText("AutoPapayaSpawn");
- label1.setFont(new Font("Times New Roman", Font.BOLD, 36));
- contentPane.add(label1);
- label1.setBounds(new Rectangle(new Point(1, 5), label1.getPreferredSize()));
- //======== tabbedPane1 ========
- {
- //======== panel1 ========
- {
- // JFormDesigner evaluation mark
- panel1.setBorder(new javax.swing.border.CompoundBorder(
- new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
- "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
- javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
- java.awt.Color.red), panel1.getBorder())); panel1.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void
- propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});
- panel1.setLayout(null);
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Edgeville East",
- "Edgeville West",
- "Castle Wars",
- "Zanaris"
- }));
- panel1.add(comboBox1);
- comboBox1.setBounds(30, 155, comboBox1.getPreferredSize().width, 20);
- //---- label2 ----
- label2.setText("Location:");
- label2.setFont(new Font("Tahoma", Font.BOLD, 11));
- panel1.add(label2);
- label2.setBounds(20, 135, label2.getPreferredSize().width, 15);
- //---- label8 ----
- label8.setText("Created by rapid.");
- panel1.add(label8);
- label8.setBounds(new Rectangle(new Point(240, 10), label8.getPreferredSize()));
- //---- label9 ----
- label9.setText("How to use:");
- label9.setFont(new Font("Tahoma", Font.BOLD, 11));
- panel1.add(label9);
- label9.setBounds(new Rectangle(new Point(15, 30), label9.getPreferredSize()));
- //---- label10 ----
- label10.setText("Welcome to AutoPapayaSpawn GUI!");
- panel1.add(label10);
- label10.setBounds(new Rectangle(new Point(15, 10), label10.getPreferredSize()));
- //---- editorPane2 ----
- editorPane2.setText("Make sure your by the location you select on the GUI, otherwise the script may run into troubles. Make sure you have a decent supply of scrolls. I
- suggest 1,000+ since it will use around 400 or so per hour.");
- editorPane2.setEditable(false);
- editorPane2.setBackground(SystemColor.menu);
- panel1.add(editorPane2);
- editorPane2.setBounds(20, 50, 320, 70);
- //---- editorPane3 ----
- editorPane3.setBackground(SystemColor.menu);
- editorPane3.setText("Have fun using the bot!");
- panel1.add(editorPane3);
- editorPane3.setBounds(20, 190, 310, 35);
- //---- checkSummoning ----
- checkSummoning.setText("Use summoning potions?");
- panel1.add(checkSummoning);
- checkSummoning.setBounds(new Rectangle(new Point(195, 155), checkSummoning.getPreferredSize()));
- }
- tabbedPane1.addTab("Main", panel1);
- //======== panel2 ========
- {
- panel2.setLayout(null);
- //---- editorPane1 ----
- editorPane1.setText("Welcome to the fully customise-able Antiban section! Here you can change your antiban to suit you! And you only.");
- editorPane1.setEditable(false);
- editorPane1.setBackground(SystemColor.menu);
- panel2.add(editorPane1);
- editorPane1.setBounds(10, 5, 325, 35);
- //---- lblSleep ----
- lblSleep.setText("Sleep timer (Currently 0)");
- panel2.add(lblSleep);
- lblSleep.setBounds(15, 45, 320, lblSleep.getPreferredSize().height);
- //---- sleepTimer ----
- sleepTimer.setMaximum(10000);
- sleepTimer.setMinimum(1000);
- sleepTimer.setValue(5000);
- sleepTimer.addPropertyChangeListener("value", new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent e) {
- slider1PropertyChange(e);
- sleepTimerPropertyChange(e);
- }
- });
- panel2.add(sleepTimer);
- sleepTimer.setBounds(new Rectangle(new Point(10, 65), sleepTimer.getPreferredSize()));
- //---- label5 ----
- label5.setText("Camera Settings:");
- label5.setFont(new Font("Tahoma", Font.BOLD, 11));
- panel2.add(label5);
- label5.setBounds(new Rectangle(new Point(15, 95), label5.getPreferredSize()));
- //---- angleChange ----
- angleChange.setMaximum(160);
- angleChange.setMinimum(20);
- angleChange.setValue(90);
- panel2.add(angleChange);
- angleChange.setBounds(new Rectangle(new Point(15, 135), angleChange.getPreferredSize()));
- //---- lblAngle ----
- lblAngle.setText("Max Angle Change (Currently 0)");
- panel2.add(lblAngle);
- lblAngle.setBounds(15, 115, 320, lblAngle.getPreferredSize().height);
- //---- lblHeight ----
- lblHeight.setText("Max Height Change (Currently 0)");
- panel2.add(lblHeight);
- lblHeight.setBounds(15, 165, 315, lblHeight.getPreferredSize().height);
- //---- maxHeight ----
- maxHeight.setMaximum(50);
- maxHeight.setMinimum(20);
- maxHeight.setValue(35);
- panel2.add(maxHeight);
- maxHeight.setBounds(new Rectangle(new Point(15, 185), maxHeight.getPreferredSize()));
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < panel2.getComponentCount(); i++) {
- Rectangle bounds = panel2.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 = panel2.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel2.setMinimumSize(preferredSize);
- panel2.setPreferredSize(preferredSize);
- }
- }
- tabbedPane1.addTab("Antiban", panel2);
- }
- contentPane.add(tabbedPane1);
- tabbedPane1.setBounds(15, 50, 355, 250);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.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 = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- setSize(395, 370);
- setLocationRelativeTo(null);
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - alex maley
- private JMenuBar menuBar1;
- private JMenu startScript;
- private JMenu cancelScript;
- private JLabel label1;
- private JTabbedPane tabbedPane1;
- private JPanel panel1;
- private JComboBox comboBox1;
- private JLabel label2;
- private JLabel label8;
- private JLabel label9;
- private JLabel label10;
- private JEditorPane editorPane2;
- private JEditorPane editorPane3;
- private JCheckBox checkSummoning;
- private JPanel panel2;
- private JEditorPane editorPane1;
- private JLabel lblSleep;
- private JSlider sleepTimer;
- private JLabel label5;
- private JSlider angleChange;
- private JLabel lblAngle;
- private JLabel lblHeight;
- private JSlider maxHeight;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement