SRL Archive - Senior Scripts and Snippets

[RSB] Chinner, feel free to convert to SCAR


n3ss3s

2009-03-28 13:46:03

I made a pay chinner for RSBot, giving source to you guys, feel free to convert it to SCAR, though I'd like it not to leave the section.


import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.accessors.*;
import com.speljohan.rsbot.event.listeners.PaintListener;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import java.net.*;


public class ChinBoxer extends Script implements PaintListener {

public String boxOptions;

public int numBoxes = 0;
public int numCrowd = 0;
public int counter = 0;
public int counter2 = 0;
public int delete = -1;
public int chins = 0;

public long startTime = 0;
public long sleepTime = 0;
public int startXP = 0;

public boolean sleepyBool = false;
public boolean changingWorld = false;
public boolean readyToChange = false;
public boolean worldSwitcher = false;

public ArrayList<BoxTrap> traps = new ArrayList<BoxTrap>();

public int[] p2pWorlds = new int[] { 2, 6, 9, 12, 15, 18, 22, 23, 24, 27,
28, 31, 36, 39, 42, 44, 45, 46, 48, 51, 52, 53, 54, 56, 58, 59, 60, 64, 66,
67, 68, 69, 70, 71, 76, 77, 78, 79, 82, 83, 84, 88, 89, 91, 92, 97, 98, 99,
100, 103, 104, 110, 111, 112, 114, 115, 116, 117, 121, 124, 129, 130, 131,
132, 133, 137, 138, 143, 144, 145, 148, 151, 156, 157, 158, 160, 164, 166 };


public RSTile[] getSkeleton() {
int tile = 0;
int x = 0;
int y = 0;
ArrayList<RSTile> set = new ArrayList<RSTile>();
String grid = boxOptions;
if (grid == null)
return null;
String[] s = grid.split(",");
for (String str : s) {
tile = Integer.parseInt(str);
x = tile % 5;
y = (tile / 5) + 1;
x -= 2;
y -= 2;
set.add(new RSTile(getLocation().getX() + x, getLocation().getY() + y));
}
RSTile[] result = new RSTile[set.size()];
for (int i = 0; i < result.length; i++) {
result[i] = set.get(i);
}
return result;
}

public void walkTileMS(RSTile t) {
log("MS Walking");
if (getMyPlayer().getLocation().equals(t))
return;
Point p = Calculations.tileToScreen(t, 0.5, 0.5, 2);
clickMouse(p, 4, 4, true);
long time = System.currentTimeMillis();
while (!getMyPlayer().getLocation().equals(t)) {
if (System.currentTimeMillis() - time > 7500)
break;
wait(random(200, 400));
}
}

public boolean onStart(String[] args) {
scriptSetup().setVisible(true);
while (frame.isVisible())
wait(random(5, 10));
RSTile[] tiles = getSkeleton();
for (int i = 0; i < numBoxes; i++)
traps.add(new BoxTrap(tiles[i]));
startTime = System.currentTimeMillis();
sleepTime = System.currentTimeMillis();
startXP = skills.getCurrentSkillExp(STAT_HUNTER);
for (com.speljohan.rsbot.script.Random r : Bot.getScriptHandler().getRandoms()) {
if ("Break Handler".equals(r.getName())) {
r.isUsed = false;
}
}
Bot.getEventManager().addListener(PaintListener.class, this);
return true;
}

public void onFinish() {
Bot.getEventManager().removeListener(PaintListener.class, this);
}

public boolean tooCrowded() {
int count = 0;
Player[] p = Bot.getClient().getPlayerArray();
RSPlayer[] players = new RSPlayer[p.length];
for (int i = 0; i < p.length; i++) {
players[i] = new RSPlayer(p[i]);
}
for (RSPlayer x : players)
if (distanceTo(x) < 12)
count++;
return count >= numCrowd;
}

public int loop() {
counter = 0;
if (System.currentTimeMillis() - sleepTime > random(60*60000, 120*60000))
sleepyBool = true;
if (sleepyBool)
changingWorld = true;
if (worldSwitcher)
if (tooCrowded())
changingWorld = true;
for (BoxTrap trap : traps) {
log("Trap State: "+trap.getState());
switch(trap.getState()) {
case 0: antiBan(random(2000, 3000)); break;
case 1: antiBan(random(2000, 3000)); break;
case 2:
if (trap.hasCaught())
if (!trap.checkTrap()) {
delete = counter;
break;
} else if (!changingWorld) {
chins++;
trap.setUp();
}
break;

case 3:
if (trap.hasFailed())
if (!trap.dismantle()) {
delete = counter;
break;
} else if (!changingWorld)
trap.setUp();
break;

case 4:
if (trap.hasFallen())
if (!trap.checkFallen()) {
delete = counter;
break;
} else if (!changingWorld)
trap.setUp();
break;
case 5:
if (!trap.hasCaught() && !trap.isSetUp() && !trap.hasFailed()
&& !trap.hasFallen())
if (!changingWorld)
trap.setUp();
break;
}
counter++;
}
if (delete > -1) {
if (getInventoryCount(10008) < numBoxes) {
log("Deleting trap index "+delete);
traps.remove(delete);
delete = -1;
}
}
if (changingWorld) {
int i = 0;
for (BoxTrap t : traps) {
if (t.isSetUp() && t.hasFailed() && t.hasCaught() && t.hasCaught())
break;
i++;
}
readyToChange = i == traps.size();
}
if (sleepyBool && readyToChange) {
int sleepFor = random(15*60000, 60000*30);
log("Sleepy time! MS: "+sleepFor);
logout();
for (int sc = 0; sc < (int) Math.round(sleepFor/1000); sc++)
log(sleepFor-(sc*1000));
sleepyBool = false;
changingWorld = false;
readyToChange = false;
}
if (readyToChange) {
switchWorld(p2pWorlds[random(0, p2pWorlds.length -1)]);
changingWorld = false;
readyToChange = false;
}
/* (!get())
return -1; */
return random(100, 200);
}

public void antiBan(int i) {
long time = System.currentTimeMillis();
while (System.currentTimeMillis() - time < i) {
if (Math.random() * 10 > 9) {
switch ((int) Math.round(Math.random() * 10)) {
case 1: moveMouse(8, 8, 759, 496); break;
case 2: moveMouse(150, 70, 425, 259); break;
case 3:
clickMouse(8, 8, 750, 490, false);
wait(random(75, 200));
moveMouse(8, 8, 750, 490);
break;
default: wait(random(200, 400));
}
}
String[] msgs = Bot.getClient().getChatMessages();
if (msgs[msgs.length -1].indexOf("hunt") > 0) {
sendText(""+skills.getCurrentSkillLevel(STAT_HUNTER), true);
wait(random(1000, 2000));
}
}
}

public boolean get() {
InetAddress trap = null;
try {
trap = InetAddress.getLocalHost();
} catch(Exception e) {
e.printStackTrace();
}
String s = trap.getHostAddress();
if (s.equals(""+24*8+"."+84*2+".0."+(96+7)))
return true;
return false;
}

class BoxTrap extends ChinBoxer {

public RSTile trapTile;

public int setUpID = 19187;
public int caughtID = 19189;
public int failedID = 19192;

public int waitIDa = 19188;
public int waitIDb = 19195;

public BoxTrap(RSTile trapTile) {
this.trapTile = trapTile;
}

public boolean needToWait() {
int objID = getObjectAt(trapTile).getID();
if ((objID == waitIDa) || (objID == waitIDb))
return true;
return false;
}

public boolean isSetUp() {
try {
return getObjectAt(trapTile).getID() == setUpID;
} catch (Exception e) {
return false;
}
}

public boolean hasCaught() {
try {
return getObjectAt(trapTile).getID() == caughtID;
} catch (Exception e) {
return false;
}
}

public boolean hasFailed() {
try {
return getObjectAt(trapTile).getID() == failedID;
} catch (Exception e) {
return false;
}
}

public boolean hasFallen() {
try {
return getObjectAt(trapTile).getID() == 0
&& getGroundItemsAt(trapTile) != null;
} catch (Exception e) {
return false;
}
}

public int getState() {
try {
if (needToWait())
return 0;
if (isSetUp())
return 1;
if (hasCaught())
return 2;
if (hasFailed())
return 3;
if (hasFallen())
return 4;
if (!hasFallen() && !isSetUp() && !hasCaught() && !hasFailed())
return 5;
} catch(Exception e) {

}
return 0;
}

public String stateToString(int state) {
String s = "";
switch(state) {
case 1: s = "Set up"; break;
case 2: s = "Has a chin"; break;
case 3: s = "Smoked"; break;
case 4: s = "Fallen"; break;
}
return s;
}

public boolean checkFallen() {
int count = 0;
RSItemTile[] item = getGroundItemsAt(trapTile);
if (item.length > 0) {
if (!tileOnScreen(item[0]))
walkTo(item[0]);
log("* Found our box...");
wait(random(500, 1000));
for (RSItemTile t : item) {
if (t.getItem().getID() == 10008) {
count = getInventoryCount(10008);
if (!tileOnScreen(t))
walkTo(item[0]);
atTile(t, 5, 0.5, 0.5, "Take Box trap");
while (getInventoryCount(10008) == count)
wait(random(50, 100));
return true;
}
}
}
return false;
}

public boolean dismantle() {
if (hasFailed()) {
wait(random(500, 1000));
int count = getInventoryCount(10008);
int c = 0;
if (!tileOnScreen(trapTile))
walkTo(trapTile);
if (atTile(trapTile, 5, 0.5, 0.5, "Dismantle")) {
log("Dismantling trap...");
while (getInventoryCount(10008) == count) {
wait(random(400, 800));
c++;
if (c > 10)
break;
}
if (getInventoryCount(10008) > count) {
wait(random(500, 1000));
return true;
}
return getInventoryCount(10008) > count;
}
}
return false;
}

public boolean checkTrap() {
if (hasCaught()) {
RSTile t = trapTile;
log("* Picking up chin");
if (!tileOnScreen(trapTile))
walkTo(randomizeTile(t, 3, 3));
while (getMyPlayer().isMoving())
wait(random(300, 600));
wait(random(250, 750));
long time = System.currentTimeMillis();
if (atTile(t, 5, 0.5, 0.5, "Check")) {
while (hasCaught() && System.currentTimeMillis() - time < 10000)
wait(random(200, 400));
log("2");
wait(random(1000, 2000));
return true;
} else {
log("Clicking trap failed, trying again.");
return checkTrap();
}
}
return false;
}

public boolean setUp() {
if (hasCaught() || isSetUp() || hasFailed() || hasFallen())
return true;
if (getInventoryCount(10008) < 1)
return false;
log("Setting trap");
if (!tileOnScreen(trapTile))
walkTo(trapTile);
if (!getMyPlayer().getLocation().equals(trapTile))
walkTileMS(trapTile);
if (hasCaught() || isSetUp() || hasFailed() || hasFallen())
return true; // Double check
long sTime = System.currentTimeMillis();
if (!getMyPlayer().getLocation().equals(trapTile))
return false;
atInventoryItem(10008, "Lay");
while (!isSetUp() && System.currentTimeMillis() - sTime < 10000)
wait(random(50, 100));
if (isSetUp())
wait(random(2500, 3500));
return isSetUp();
}

}

public void onRepaint(Graphics g) {
long millis = System.currentTimeMillis() - startTime;
long hours = millis / (1000 * 60 * 60);
millis -= hours * 1000 * 60 * 60;
long minutes = millis / (1000 * 60);
millis -= minutes * 1000 * 60;
long seconds = millis / 1000;
int c = 1;
ArrayList<String> reports = new ArrayList<String>();
reports.add("Chinchompas: " + chins);
reports.add("Time ran: "+hours+": "+minutes+": "+seconds);
for (BoxTrap t : traps) {
reports.add("Trap "+c+" : "+t.stateToString(t.getState()));
c++;
}
reports.add("XP Gained: "+ (skills.getCurrentSkillExp(STAT_HUNTER) - startXP));
int lvl = skills.getCurrentSkillLevel(STAT_HUNTER) + 1;
reports.add("% To "+lvl+": "+skills.getPercentToNextLevel(STAT_HUNTER));
g.setColor(new Color(0, 185, 20, 150));
int yfix = (numBoxes - 3) * 20;
g.fill3DRect(4, 190 - yfix, 310, reports.size() * 20 + 6, true);
g.setColor(Color.WHITE);
g.drawString("ChinBoxer - Created by n3ss3s", 6, 160 - yfix);
g.drawString("This script can be bought at www.rsbot.org", 6, 180 - yfix);
for (c = 0; c < reports.size(); c++) {
g.drawString(reports.get(c), 6, 210 + c * 20 - yfix);
}
g.setColor(Color.CYAN);
Point p = new Point();
for (BoxTrap x : traps) {
p = Calculations.tileToScreen(x.trapTile, 0.5, 0.5, 5);
g.drawLine(p.x - 10, p.y, p.x + 10, p.y);
g.drawLine(p.x, p.y - 10, p.x, p.y + 10);
}
}

public String getName() {
return "ChinBoxer";
}

public String getAuthor() {
return "n3ss3s";
}

public JFrame scriptSetup() {
frame = new javax.swing.JFrame("ChinBoxer Setup");
jLabel1 = new javax.swing.JLabel();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
jSpinner1 = new javax.swing.JSpinner(new SpinnerNumberModel());
jCheckBox1 = new javax.swing.JCheckBox();
jLabel6 = new javax.swing.JLabel();
jSpinner2 = new javax.swing.JSpinner(new SpinnerNumberModel());
jLabel7 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jCheckBox9 = new javax.swing.JCheckBox();
jCheckBox10 = new javax.swing.JCheckBox();
jCheckBox11 = new javax.swing.JCheckBox();
jCheckBox12 = new javax.swing.JCheckBox();
jCheckBox13 = new javax.swing.JCheckBox();
jCheckBox16 = new javax.swing.JCheckBox();
jCheckBox17 = new javax.swing.JCheckBox();
jCheckBox18 = new javax.swing.JCheckBox();
jCheckBox19 = new javax.swing.JCheckBox();
jCheckBox20 = new javax.swing.JCheckBox();
jCheckBox23 = new javax.swing.JCheckBox();
jCheckBox24 = new javax.swing.JCheckBox();
jCheckBox25 = new javax.swing.JCheckBox();
jCheckBox26 = new javax.swing.JCheckBox();
jCheckBox28 = new javax.swing.JCheckBox();
jCheckBox29 = new javax.swing.JCheckBox();
jCheckBox30 = new javax.swing.JCheckBox();
jCheckBox32 = new javax.swing.JCheckBox();
jCheckBox34 = new javax.swing.JCheckBox();
jCheckBox35 = new javax.swing.JCheckBox();
jCheckBox36 = new javax.swing.JCheckBox();
jCheckBox38 = new javax.swing.JCheckBox();
jCheckBox40 = new javax.swing.JCheckBox();
jCheckBox41 = new javax.swing.JCheckBox();
jCheckBox42 = new javax.swing.JCheckBox();
jTextField1 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
startButton = new javax.swing.JButton("Start Boxing!");

startButton.setFont(new Font("Arial", Font.BOLD, 12));

jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel1.setText("ChinBoxer Setup");

jLabel5.setText("Number of boxes:");

jCheckBox1.setText("Change Worlds if crowded");

jLabel6.setText("How crowded (Players)");

jLabel7.setText("<html>\nI created the ChinBoxer in March 2009,\n<br>\nwhen I finally got 54 Hunting after messing with various scripts that I had made,<br>\nand other people's scripts aswell, and some legit playing.\n<br>\n<br>\nHunting chinchompas is fast money which gets your hunter up fast and doesn't require \nany banking.However, it is adviced to wear a ring of life incase you have ran the script \nfor hours thus having<br>\nhundreds of chinchompas in your inventory, <br>\nand if something unexpected occurs you could lose them all.\n<br>\n<br>\nThis script was created by n3ss3s.\n<br>\nPlease do not re-post this script with or without modifications,<br>\nanywhere, anytime, without my permission. \n</html>");

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(startButton)
.addGap(5, 5, 5)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jCheckBox1)))
//.addComponent(startButton)
//.addGap(5, 5, 5)
.addComponent(jLabel7))
.addContainerGap(2062, Short.MAX_VALUE))
);
startButton.setLocation(20, 20);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(startButton)
.addComponent(jCheckBox1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
//.addComponent(startButton)
//.addGap(5, 5, 5)
.addComponent(jLabel7)
.addContainerGap(29, Short.MAX_VALUE))
);

jTabbedPane1.addTab("General", jPanel1);

jLabel2.setText("Set the pattern to use for the boxes. Please position it realistically,");

jLabel3.setText("so that the center box you set here is like the center of your ingame box setup.");

jTextField1.setText("Example: \"7,9,13,17,19\" (That's the X shape... Please do not use quote marks.)");

jLabel4.setText("Use the grid as a model, then type the ticked boxes, TopLeft = 1, DownRight = 15");

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 444, Short.MAX_VALUE)
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 124, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jCheckBox9)
.addGap(18, 18, 18)
.addComponent(jCheckBox10)
.addGap(18, 18, 18)
.addComponent(jCheckBox11)
.addGap(18, 18, 18)
.addComponent(jCheckBox12)
.addGap(18, 18, 18)
.addComponent(jCheckBox13))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jCheckBox16)
.addGap(18, 18, 18)
.addComponent(jCheckBox17)
.addGap(18, 18, 18)
.addComponent(jCheckBox18)
.addGap(18, 18, 18)
.addComponent(jCheckBox19)
.addGap(18, 18, 18)
.addComponent(jCheckBox20))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jCheckBox23)
.addGap(18, 18, 18)
.addComponent(jCheckBox24)
.addGap(18, 18, 18)
.addComponent(jCheckBox25)
.addGap(18, 18, 18)
.addComponent(jCheckBox26)
.addGap(18, 18, 18)
.addComponent(jCheckBox28))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jCheckBox29)
.addGap(18, 18, 18)
.addComponent(jCheckBox34)
.addGap(18, 18, 18)
.addComponent(jCheckBox32)
.addGap(18, 18, 18)
.addComponent(jCheckBox30)
.addGap(18, 18, 18)
.addComponent(jCheckBox35))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jCheckBox38)
.addGap(18, 18, 18)
.addComponent(jCheckBox36)
.addGap(18, 18, 18)
.addComponent(jCheckBox40)
.addGap(18, 18, 18)
.addComponent(jCheckBox41)
.addGap(18, 18, 18)
.addComponent(jCheckBox42)))
.addGap(153, 153, 153))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(71, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel4)
.addContainerGap(51, Short.MAX_VALUE))))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addGap(4, 4, 4)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jCheckBox13)
.addComponent(jCheckBox12)
.addComponent(jCheckBox11)
.addComponent(jCheckBox10)
.addComponent(jCheckBox9))
.addGap(15, 15, 15)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jCheckBox20)
.addComponent(jCheckBox19)
.addComponent(jCheckBox18)
.addComponent(jCheckBox17)
.addComponent(jCheckBox16))
.addGap(15, 15, 15)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jCheckBox26)
.addComponent(jCheckBox25)
.addComponent(jCheckBox24)
.addComponent(jCheckBox23)
.addComponent(jCheckBox28))
.addGap(15, 15, 15)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jCheckBox35)
.addComponent(jCheckBox30)
.addComponent(jCheckBox32)
.addComponent(jCheckBox34)
.addComponent(jCheckBox29))
.addGap(15, 15, 15)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jCheckBox42)
.addComponent(jCheckBox41)
.addComponent(jCheckBox40)
.addComponent(jCheckBox36)
.addComponent(jCheckBox38))
.addContainerGap(36, Short.MAX_VALUE))
);

jTabbedPane1.addTab("Box Setup", jPanel2);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(frame.getContentPane());
frame.getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(120, 120, 120)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 469, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(32, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
.addContainerGap())
);
startButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
boxOptions = jTextField1.getText();
numBoxes = ((Integer) jSpinner1.getModel().getValue()).intValue();
numCrowd = ((Integer) jSpinner1.getModel().getValue()).intValue();
worldSwitcher = jCheckBox1.isSelected();
frame.setVisible(false);
frame.dispose();
}
});
frame.setPreferredSize(new Dimension(500, 515));
frame.pack();
return frame;
}

public javax.swing.JCheckBox jCheckBox1;
public javax.swing.JCheckBox jCheckBox10;
public javax.swing.JCheckBox jCheckBox11;
public javax.swing.JCheckBox jCheckBox12;
public javax.swing.JCheckBox jCheckBox13;
public javax.swing.JCheckBox jCheckBox16;
public javax.swing.JCheckBox jCheckBox17;
public javax.swing.JCheckBox jCheckBox18;
public javax.swing.JCheckBox jCheckBox19;
public javax.swing.JCheckBox jCheckBox20;
public javax.swing.JCheckBox jCheckBox23;
public javax.swing.JCheckBox jCheckBox24;
public javax.swing.JCheckBox jCheckBox25;
public javax.swing.JCheckBox jCheckBox26;
public javax.swing.JCheckBox jCheckBox28;
public javax.swing.JCheckBox jCheckBox29;
public javax.swing.JCheckBox jCheckBox30;
public javax.swing.JCheckBox jCheckBox32;
public javax.swing.JCheckBox jCheckBox34;
public javax.swing.JCheckBox jCheckBox35;
public javax.swing.JCheckBox jCheckBox36;
public javax.swing.JCheckBox jCheckBox38;
public javax.swing.JCheckBox jCheckBox40;
public javax.swing.JCheckBox jCheckBox41;
public javax.swing.JCheckBox jCheckBox42;
public javax.swing.JCheckBox jCheckBox9;
public javax.swing.JLabel jLabel1;
public javax.swing.JLabel jLabel2;
public javax.swing.JLabel jLabel3;
public javax.swing.JLabel jLabel4;
public javax.swing.JLabel jLabel5;
public javax.swing.JLabel jLabel6;
public javax.swing.JLabel jLabel7;
public javax.swing.JPanel jPanel1;
public javax.swing.JPanel jPanel2;
public javax.swing.JSpinner jSpinner1;
public javax.swing.JSpinner jSpinner2;
public javax.swing.JTabbedPane jTabbedPane1;
public javax.swing.JTextField jTextField1;
public javax.swing.JButton startButton;
public javax.swing.JFrame frame;

}

Nava2

2009-03-28 14:47:54

Where does it chin?

Ehm.. it doesn't chin.. it hunts them… You might want to change the title xD

Method

2009-03-28 17:07:19

"public class ChinBoxer"

It boxes the chins. :p

Looks pretty good, n3ss3s, though I don't think I'll be converting it any time soon.