Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import impsoft.bots.ColorBot;
- import impsoft.bots.input.MouseCommand;
- import impsoft.bots.reflection.GroundItem;
- import impsoft.bots.reflection.NPC;
- import impsoft.bots.reflection.NPCIterator;
- import impsoft.bots.reflection.PhysicalObject;
- import impsoft.bots.reflection.Player;
- import impsoft.bots.reflection.WorldObject;
- import impsoft.painting.PaintJob;
- import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
- import impsoft.scripting.ibot.enums.BotStates;
- import impsoft.scripting.ibot.enums.Skill;
- import impsoft.scripting.ibot.interfaces.AutoPaint;
- import impsoft.scripting.ibot.interfaces.ChatListener;
- import impsoft.scripting.ibot.itemrec.ItemIdExact;
- import impsoft.scripting.ibot.itemrec.ItemNameExact;
- import impsoft.scripting.ibot.structs.AryanTile;
- import impsoft.scripting.ibot.structs.AryanTileZone;
- import impsoft.scripting.ibot.structs.RGB;
- import impsoft.scripting.ibot.structs.XY;
- import impsoft.scripting.types.ColorScript;
- import impsoft.scripting.types.ColorSkeltonScriptable;
- import impsoft.scripting.types.parallel.scriptjobs.WorldObjectClickingScriptJob;
- import impsoft.utils.general.Timer;
- import impsoft.utils.ibot.Pixel;
- import impsoft.utils.ruler.RulerClickOptions;
- import impsoft.utils.ruler.RulerScriptUtils;
- import impsoft.utils.uber.UberScriptUtils;
- import impsoft.values.constant.Areas;
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.GradientPaint;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Point;
- import java.awt.Polygon;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.geom.Ellipse2D;
- import java.awt.geom.RoundRectangle2D;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.EnumSet;
- import java.util.Iterator;
- import java.util.regex.Pattern;
- import javax.imageio.ImageIO;
- import javax.swing.BorderFactory;
- import javax.swing.DefaultListModel;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JComponent;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JList;
- import javax.swing.JPanel;
- import javax.swing.JScrollPane;
- import javax.swing.JSlider;
- import javax.swing.JSpinner;
- import javax.swing.JTabbedPane;
- import javax.swing.JTextField;
- import javax.swing.ListSelectionModel;
- import javax.swing.SpinnerModel;
- import javax.swing.SpinnerNumberModel;
- import javax.swing.UIManager;
- import javax.swing.UnsupportedLookAndFeelException;
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
- import bergCoder.BergUtils;
- public class ZFungi extends ColorScript implements AutoPaint, ChatListener {
- public ZFungi(ColorBot c) {
- super(c);
- }
- BergUtils util = new BergUtils(this);
- Timer Time = new Timer(0);
- Timer t = new Timer((random(15, 32)) * (1000 * 60));
- Timer Tabs = new Timer((random(4, 25)) * (1000 * 60));
- Timer HourPic = new Timer(60 * (1000 * 60));
- Timer f = new Timer((random(15, 54)) * (1000 * 60));
- long scriptStartTIME = System.currentTimeMillis();
- public static String author = "ZBUBBLEZ";
- public static String description = "Picks Fungi 500k/h";
- public static String Version = "1.60";
- public static String Credits = "ZBUBBLEZ";
- int currentXp = 0;
- int startXp = 0;
- int moneyMade = 0;
- int logid = 3508;
- int fungusid = 3509;
- int picked = 0;
- int pouchId = 0;
- String Status = "Starting";
- String nameOfBob = "";
- String food = "";
- AryanTile home;
- boolean full = false;
- boolean summoning = false;
- boolean sumUp = false;
- boolean sumFull = false;
- boolean StartScript = false;
- AryanTileZone fence = new AryanTileZone(new AryanTile(3443, 3458),
- new AryanTile(3446, 3464));
- AryanTileZone obZone = new AryanTileZone(new AryanTile(3451, 3490),
- new AryanTile(3454, 3489));
- AryanTileZone insideFence = new AryanTileZone(new AryanTile(3442, 3457),
- new AryanTile(3444, 3455));
- AryanTileZone bankZone = new AryanTileZone(new AryanTile(3509, 3480),
- new AryanTile(3511, 3479));
- public int[] exptolevel = { 0, 83, 174, 276, 388, 512, 650, 801, 969, 1154,
- 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523, 3973, 4470, 5018,
- 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031, 13363, 14833,
- 16456, 18247, 20224, 22406, 24815, 27473, 30408, 33648, 37224,
- 41171, 45529, 50339, 55649, 61512, 67983, 75127, 83014, 91721,
- 101333, 111945, 123660, 136594, 150872, 166636, 184040, 203254,
- 224466, 247886, 273742, 302288, 333804, 368599, 407015, 449428,
- 496254, 547953, 605032, 668051, 737627, 814445, 899257, 992895,
- 1096278, 1210421, 1336443, 1475581, 1629200, 1798808, 1986068,
- 2192818, 2421087, 2673114, 2951373, 3258594, 3597792, 3972294,
- 4385776, 4842295, 5346332, 5902831, 6517253, 7195629, 7944614,
- 8771558, 9684577, 10692629, 11805606, 13034431, 200000001 };
- public void script() throws InterruptedException, Exception {
- while (!isLoggedIn()) {
- sleep(1000);
- log("Not Logged In");
- }
- log("WELCOME!");
- log("Welcome to ZFungi!");
- log("Version Number: " + Version);
- log("Laste Update: 6/25/11");
- sleep(1000);
- log("Home Tile: " + getLocation());
- home = getLocation();
- JFrame Settings = new ZFungiGUI();
- Settings.setVisible(true);
- while (StartScript != true)
- sleep(100, 200);
- StartScript = false;
- Settings.setVisible(false);
- while (true) {
- switch (random(1, 55)) {
- case 1:
- AntiBan();
- }
- if (theMiniMapIndicators.getEnergy() > (random(35, 55))) {
- util.setFastRun(true);
- }
- Check();
- }
- }
- public void Check() throws InterruptedException, Exception {
- if (summoning == true && sumUp == false) {
- if (theTabs.Inventory.count(new ItemIdExact(pouchId)) != 0) {
- log("Clicking Summoning Pouch (" + pouchId + ")");
- theTabs.Inventory.doAction(new ItemIdExact(pouchId), "Summon",
- 1, false);
- sleep(2000, 3000);
- } else {
- log("Summoning Pouch not found");
- theWorldMap.walkTo(bankZone.random());
- this.SleepTillStill();
- theBank.open();
- theBank.doDepositAll();
- theBank.doWithDraw1(new ItemIdExact(pouchId), false);
- theBank.exit();
- theWorldMap.walkTo(home);
- this.SleepTillStill();
- }
- }
- if (theMiniMapIndicators.getPrayerPoints() != 0
- && !theTabs.Inventory.isFull() && full == false) {
- PhysicalObject fungi = this.getPhysicalObjectByInt(fungusid);
- if (fungi == null
- || getLocation().distanceTo(fungi.getLocation()) > 5) {
- Status = "Click Home Tile";
- if (getLocation().distanceTo(home) > 0) {
- util.clickTile(home, null, "Walk here");
- sleep(200, 1000);
- } else if (getLocation().distanceTo(home) > 15) {
- theWorldMap.walkTo(fence.random());
- this.SleepTillStill();
- while (fence.isInZone(getLocation())) {
- RulerScriptUtils.clickWorldObject(this, null, this
- .getPhysicalObjectByInt(3507), null, Pattern
- .compile(".*Gate.*"), Pattern.compile(".*Open.*"), EnumSet
- .of(RulerClickOptions.GOAL_NORMAL_CLICK,
- RulerClickOptions.WALK_USING_ANY,
- RulerClickOptions.PAINT_GAMESCREEN_WALKING,
- RulerClickOptions.PAINT_PREDICTION_POLYGON));
- sleep(4000, 6000);
- }
- theWorldMap.walkTo(home);
- this.SleepTillStill();
- }
- Status = "Blessing";
- if (!theTabs.Equipment.isSelected()) {
- theTabs.Equipment.click();
- }
- theTabs.Equipment.doActionOnAll("sickle", "Bloom");
- sleep(1000, 2000);
- while (getAnimation() != -1) {
- sleep(25);
- log("Blessing");
- }
- } else {
- if (fungi != null
- && getLocation().distanceTo(fungi.getLocation()) < 5) {
- Status = "Picking Fungi";
- //util.doInteractiveObject(fungi, "Fungi", "Pick", null);
- RulerScriptUtils.clickWorldObject(this, null, fungi, null, Pattern
- .compile(".*Fungi.*"), Pattern.compile(".*Pick.*"), EnumSet
- .of(RulerClickOptions.GOAL_NORMAL_CLICK,
- RulerClickOptions.WALK_USING_ANY,
- RulerClickOptions.PAINT_GAMESCREEN_WALKING,
- RulerClickOptions.PAINT_PREDICTION_POLYGON));
- moneyMade = moneyMade + 1185;
- sleep(500, 1000);
- fungi = this.getPhysicalObjectByInt(fungusid);
- }
- }
- } else {
- if (theTabs.Inventory.isFull() || full == true) {
- if (sumFull == false && sumUp == true && summoning == true) {
- depositSum();
- } else {
- Bank();
- }
- } else {
- if (theTabs.Inventory.count("Prayer potion") == 0) {
- Bank();
- } else {
- theTabs.Inventory.doAction("Prayer potion", null, 1, false);
- sleep(300, 600);
- }
- }
- }
- TabSelector();
- sleep(400, 800);
- }
- public void depositSum() throws InterruptedException, Exception {
- while (!theTopText.getTopText().contains("Continue")) {
- mouseClickRight(new Rectangle(713, 150, -14, -14));
- theMenuFinder.doMenu("Interact");
- mouseMove(new Rectangle(230, 438, 57, -10));
- }
- if (theTopText.getTopText().contains("Continue")) {
- mouseClickLeft(getCurrentMouseXY());
- }
- theTabs.Inventory.doAction("fungus", "All", 1, false);
- sleep(1000, 2000);
- mouseClickLeft(new Rectangle(417, 42, 10, -6));
- sumFull = true;
- }
- public void Bank() throws InterruptedException, Exception {
- Status = "Banking";
- Status = "Banking";
- theWorldMap.walkTo(bankZone.random());
- this.SleepTillStill();
- theBank.open();
- while (theTabs.Inventory.countEmptySlots() != 28) {
- theBank.doDepositAll();
- sleep(500, 1200);
- }
- if (summoning == true) {
- mouseClickLeft(new Rectangle(458, 313, 27, -12));
- mouseClickLeft(new Rectangle(458, 313, 27, -12));
- switch (random(0, 20)) {
- case 6:
- mouseClickLeft(new Rectangle(458, 313, 27, -12));
- break;
- case 18:
- mouseClickLeft(new Rectangle(458, 313, 27, -12));
- break;
- }
- }
- while (theTabs.Inventory.count("Prayer pot") == 0) {
- theBank.doWithDrawX(new ItemNameExact("Prayer potion (3)"), 2, true);
- sleep(2000, 3000);
- }
- theBank.exit();
- if (theTabs.Inventory.count("Prayer pot") != 0) {
- ItemSlot it = theTabs.Inventory.getSlot(new ItemNameExact(
- "Prayer potion (3)"));
- while (it.getItem().getItemName().contains("Prayer")) {
- theTabs.Inventory.doAction(it, null, false);
- sleep(200, 1200);
- }
- }
- if (theTabs.Inventory.count("Vial") != 0) {
- theTabs.Inventory.doAction("Vial", "Drop", 1, false);
- }
- theBank.exit();
- full = false;
- sumFull = false;
- Status = "Checking Summoning Time";
- if (summoning == true) {
- if (getFamiliarTime() <= 2.5) {
- theBank.open();
- theBank.doWithDraw1(new ItemIdExact(pouchId), true);
- theBank.exit();
- while (theTabs.Inventory.count(new ItemIdExact(pouchId)) != 0
- && sumUp == true) {
- mouseClickRight(new Rectangle(713, 150, -14, -14));
- theMenuFinder.doMenu("Renew");
- sleep(1000, 2000);
- }
- }
- }
- if (theMiniMapIndicators.getHealthPoints() < random(20, 35)) {
- theBank.open();
- theBank.doWithDraw10(food, true);
- theBank.exit();
- while (theTabs.Inventory.count(food) != 0) {
- theTabs.Inventory.doAction(food, null, 1, false);
- sleep(0, 900);
- }
- }
- Status = "Walking to Home";
- if (summoning == true) {
- if (theMiniMapIndicators.getSummoningPoints() < random(17, 25)) {
- theWorldMap.walkTo(obZone.random());
- this.SleepTillStill();
- PhysicalObject oby = this.getPhysicalObjectByInt(29992);
- while (theMiniMapIndicators.getSummoningPoints() < 16
- && oby != null) {
- util.doInteractiveObject(oby, "Small obelisk",
- "Renew-points", null);
- sleep(2000, 3000);
- oby = this.getPhysicalObjectByInt(29992);
- }
- }
- }
- theWorldMap.walkTo(home);
- this.SleepTillStill();
- }
- public void AntiBan() throws InterruptedException, Exception {
- Status = "Antiban";
- switch (random(0, 250)) {
- case 12:
- theCamera.setYawRandom();
- break;
- case 18:
- mouseMove(Areas.GAME);
- break;
- case 24:
- theCamera.setYawRandom();
- break;
- case 35:
- mouseMove(Areas.GAME);
- mouseMove(Areas.INVENTORY);
- break;
- case 67:
- theCamera.setYawRandom();
- break;
- case 77:
- mouseMove(Areas.GAME);
- break;
- case 86:
- theCamera.setYawRandom();
- break;
- case 96:
- mouseMove(Areas.ENTIRE);
- break;
- case 103:
- theCamera.setYawRandom();
- break;
- case 134:
- theCamera.setYawRandom();
- break;
- case 155:
- theCamera.setYawRandom();
- break;
- case 173:
- mouseMove(Areas.GAME);
- break;
- case 200:
- theCamera.setYawRandom();
- break;
- }
- }
- public void TabSelector() throws InterruptedException, Exception {
- if (Tabs.isUp()) {
- switch (random(0, 5)) {
- case 0:
- mouseClickLeft(new Rectangle(525, 171, 233, 30));
- break;
- case 1:
- mouseClickLeft(new Rectangle(526, 469, 234, 29));
- break;
- case 2:
- mouseClickLeft(new Rectangle(525, 171, 233, 30));
- break;
- case 3:
- mouseClickLeft(new Rectangle(526, 469, 234, 29));
- break;
- case 4:
- mouseClickLeft(new Rectangle(525, 171, 233, 30));
- break;
- case 5:
- mouseClickLeft(new Rectangle(526, 469, 234, 29));
- break;
- }
- Tabs.reset();
- log("RandomTabSelector = Action Complete");
- } else {
- }
- }
- public void mMove() throws InterruptedException, Exception {
- switch (random(1, 20)) {
- case 2:
- mouseMove(Areas.ENTIRE);
- log("MouseMovement = true");
- break;
- case 3:
- mouseMove(Areas.INVENTORY);
- log("MouseMovement = true");
- break;
- case 8:
- mouseMove(Areas.GAME);
- log("MouseMovement = true");
- break;
- case 13:
- mouseMove(Areas.GAME);
- log("MouseMovement = true");
- break;
- case 17:
- mouseMove(getMyPlayer().getRecommendPointToClick());
- log("MouseMovement = true");
- break;
- case 20:
- mouseMove(Areas.ENTIRE);
- log("MouseMovement = true");
- break;
- }
- }
- /** RANDOM METHODS **/
- public void SleepTillStill() throws InterruptedException, Exception {
- boolean Done = false;
- int Count = 0;
- while (Done == false) {
- sleep(700);
- if (!getMyPlayer().isMoving()) {
- Count++;
- }
- if (Count > 2) {
- Done = true;
- }
- }
- }
- public NPC getNearestNpcByName(String npcname) {
- NPC closest = null;
- double closeDistance = 800;
- AryanTile here = getLocation();
- for (NPCIterator po = getNPCIterator(); po.hasNext();) {
- NPC npc = po.next();
- String name = npc.getName();
- if (name.contains(npcname)) {
- double distance = npc.getLocation().distanceToPrecise(here);
- if (npc.inCombat() && npc.isInteractingWithMyPlayer())
- distance = -1;
- if (npc.inCombat() && npc.isInteractingWithOtherPlayer())
- distance = 1000000000;
- if (distance < closeDistance) {
- closest = npc;
- closeDistance = distance;
- }
- }
- }
- return closest;
- }
- public PhysicalObject getPhysicalObjectByInt(int poid) {
- PhysicalObject closest = null;
- double closeDistance = 800;
- AryanTile here = getLocation();
- for (PhysicalObject po : getAllPhysicalObjects()) {
- int ID = po.getID();
- if (ID == poid) {
- double distance = po.getLocation().distanceToPrecise(here);
- if (distance < closeDistance) {
- closest = po;
- closeDistance = distance;
- }
- }
- }
- return closest;
- }
- @Override
- public void paint(Graphics g) {
- final StringBuilder ggg = new StringBuilder();
- final long runtime = Time.timePassed();
- final long TotalSec = runtime / 1000;
- final long TotalMin = TotalSec / 60;
- final long TotalHour = TotalMin / 60;
- final int second = (int) TotalSec % 60;
- final int minute = (int) TotalMin % 60;
- final int hour = (int) TotalHour % 60;
- long runTime = 0;
- runTime = System.currentTimeMillis() - scriptStartTIME;
- int PerHour = 0;
- if ((runTime / 1000) > 0) {
- PerHour = (int) ((3600000.0 / (double) runTime) * ((currentXp - startXp)));
- }
- int mPerHour = 0;
- if ((runTime / 1000) > 0) {
- mPerHour = (int) ((3600000.0 / (double) runTime) * ((moneyMade)));
- }
- if (hour < 10)
- ggg.append("0");
- ggg.append(hour);
- ggg.append(" : ");
- if (minute < 10)
- ggg.append("0");
- ggg.append(minute);
- ggg.append(" : ");
- if (second < 10)
- ggg.append("0");
- ggg.append(second);
- g.setColor(new Color(0, 255, 0, 125));
- for (PhysicalObject po : getAllPhysicalObjects()) {
- int ID = po.getID();
- if (ID == fungusid) {
- if (po != null
- && getLocation().distanceTo(po.getLocation()) < 5
- && po.getGameScreenLocation() != null) {
- g.drawPolygon(po.getGameScreenLocation());
- }
- }
- }
- // START: Code generated using Enfilade's Easel
- final Color color1 = new Color(0, 102, 0);
- final Color color2 = new Color(0, 0, 0);
- final BasicStroke stroke1 = new BasicStroke(1);
- final Font font1 = new Font("MV Boli", 1, 20);
- final Font font2 = new Font("MV Boli", 0, 10);
- final Font font3 = new Font("MV Boli", 0, 12);
- g.setColor(color1);
- g.fillRect(2, 342, 512, 135);
- g.setColor(color2);
- g.drawRect(2, 342, 512, 135);
- g.setColor(Color.WHITE);
- g.setFont(font1);
- g.drawString("ZFungi V"+Version, 335, 362);
- g.setFont(font2);
- g.drawString("zbubblez", 472, 473);
- g.setFont(font3);
- int X = 5;
- int Y = 355;
- g.drawString("Time Running: " + String.valueOf(ggg.toString()), X, Y);
- g.drawString("Money Made: " + moneyMade + " (" + mPerHour + "/H)", X,
- Y + 15);
- g.drawString("Home Tile: " + home, X, Y + 30);
- g.drawString("Inventory Full: " + full, X, Y + 45);
- g.drawString("Status: " + Status, X, Y + 60);
- g.drawString("Summoning Monster Up: " + sumUp, X, Y + 75);
- g.drawString("Summoning Time: " + getFamiliarTime(), X, Y + 90);
- g.drawString("Food Name: " + food, X, Y + 105);
- if (summoning == true) {
- NPC bob = this.getNearestNpcByName(nameOfBob);
- if (bob != null && bob.isInteractingWithMyPlayer()) {
- if (bob != null && bob.isInteractingWithMyPlayer()
- && bob.getGameScreenLocation() != null
- && bob.getGameScreenLocationSmaller() != null) {
- g.setColor(Color.CYAN);
- g.drawPolygon(bob.getGameScreenLocationSmaller());
- }
- } else {
- }
- try {
- if (theClientScreen.getPixelColor(new XY(706, 155)) == 5343598) {
- sumUp = true;
- } else {
- sumUp = false;
- }
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- @Override
- public void chat(String s) throws InterruptedException {
- if (s.contains("You have no more space in your inventory")) {
- full = true;
- }
- }
- /*
- * To change this template, choose Tools | Templates and open the template
- * in the editor.
- */
- /*
- * ZFungiGUI.java
- *
- * Created on Jun 10, 2011, 2:12:47 PM
- */
- /**
- *
- * @author Dan
- */
- public class ZFungiGUI extends javax.swing.JFrame {
- /** Creates new form ZFungiGUI */
- public ZFungiGUI() {
- initComponents();
- }
- /**
- * This method is called from within the constructor to initialize the
- * form. WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
- jLabel1 = new javax.swing.JLabel();
- foodName = new javax.swing.JTextField();
- useSum = new javax.swing.JRadioButton();
- bobName = new javax.swing.JComboBox();
- usePpot = new javax.swing.JRadioButton();
- usePOH = new javax.swing.JRadioButton();
- StartButton = new javax.swing.JButton();
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- jLabel1.setFont(new java.awt.Font("MV Boli", 3, 36)); // NOI18N
- jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- jLabel1.setText("ZFungi");
- foodName.setHorizontalAlignment(javax.swing.JTextField.CENTER);
- foodName.setText("Food Name");
- useSum.setText("Use BOB");
- bobName.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
- "Spirit terrorbird", "War tortoise" }));
- usePpot.setText("Use PPots");
- usePOH.setText("Use POH");
- StartButton.setText("Start");
- StartButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- StartButtonActionPerformed(evt);
- }
- });
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
- getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- jLabel1,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 380,
- Short.MAX_VALUE)
- .addGroup(
- layout.createSequentialGroup()
- .addGap(10,
- 10,
- 10)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- layout.createSequentialGroup()
- .addComponent(
- useSum)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(
- bobName,
- 0,
- 297,
- Short.MAX_VALUE))
- .addComponent(
- foodName,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 370,
- Short.MAX_VALUE)
- .addGroup(
- layout.createSequentialGroup()
- .addComponent(
- usePpot)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(
- usePOH))
- .addComponent(
- StartButton,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 370,
- Short.MAX_VALUE))))
- .addContainerGap()));
- layout.setVerticalGroup(layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(
- jLabel1,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 55,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(
- foodName,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(useSum)
- .addComponent(
- bobName,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(usePpot)
- .addComponent(usePOH))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(
- StartButton,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 50, Short.MAX_VALUE)
- .addContainerGap()));
- pack();
- }// </editor-fold>
- private void StartButtonActionPerformed(java.awt.event.ActionEvent evt) {
- if (foodName.getText() != null) {
- food = foodName.getText();
- } else {
- food = "Lobster";
- }
- if (useSum.isSelected()) {
- summoning = true;
- if (bobName.getSelectedItem().toString().toLowerCase()
- .contains("terror")) {
- nameOfBob = "Spirit terrorbird";
- pouchId = 12007;
- } else if (bobName.getSelectedItem().toString().toLowerCase()
- .contains("tortoise")) {
- nameOfBob = "War tortoise";
- pouchId = 12031;
- } else {
- log("Invalid Beast of Burden!");
- nameOfBob = null;
- pouchId = 0;
- }
- } else {
- summoning = false;
- }
- StartScript = true;
- }
- /**
- * @param args
- * the command line arguments
- */
- public void main(String args[]) {
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new ZFungiGUI().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JButton StartButton;
- private javax.swing.JComboBox bobName;
- private javax.swing.JTextField foodName;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JRadioButton usePOH;
- private javax.swing.JRadioButton usePpot;
- private javax.swing.JRadioButton useSum;
- // End of variables declaration
- }
- public double getFamiliarTime() {
- return ((this.getSettingArray()[1176] >> 6) / 2.0D);
- }
- }// END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement