Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.awt.Color;
  2. import java.awt.Component;
  3. import java.awt.Container;
  4. import java.awt.Dimension;
  5. import java.awt.Font;
  6. import java.awt.Graphics;
  7. import java.awt.Insets;
  8. import java.awt.LayoutManager;
  9. import java.awt.Point;
  10. import java.awt.event.ActionEvent;
  11. import javax.swing.JButton;
  12. import javax.swing.JComboBox;
  13. import javax.swing.JLabel;
  14. import javax.swing.JTextField;
  15.  
  16. import org.rsbot.event.listeners.PaintListener;
  17. import org.rsbot.script.Script;
  18. import org.rsbot.script.ScriptManifest;
  19. import org.rsbot.script.methods.Game;
  20. import org.rsbot.script.methods.Skills;
  21. import org.rsbot.script.wrappers.RSGroundItem;
  22. import org.rsbot.script.wrappers.RSTile;
  23.  
  24. @ScriptManifest(authors = {"alluk"}, name = "aKilla", version = 0.26, description = "Kills Al-Kharid Warriors")
  25. public class aKilla extends Script implements PaintListener {
  26.  
  27.     RSTile[] bankToWarrior = {new RSTile(3276, 3172), new RSTile(3280, 3180), new RSTile(3286, 3181), new RSTile(3292, 3181), new RSTile(3292, 3170)};
  28.     RSTile[] warriorToBank = {new RSTile(3292, 3181), new RSTile(3286, 3181), new RSTile(3280, 3180), new RSTile(3276, 3175), new RSTile(3271, 3166)};
  29.     RSTile warriorTile = new RSTile(3292, 3170);
  30.     RSTile bankTile = new RSTile(3269, 3168);
  31.    
  32.     RSGroundItem itegr;
  33.     volatile RSGroundItem ite;
  34.     int foodb = 0;
  35.     int warrior = 18;
  36.     int food;
  37.     int[] items = { 1440, 199, 201, 203, 205, 207, 3049, 12174, 209, 14836,
  38.             211, 213, 3051, 215, 2485, 217, 219 };
  39.     boolean inFight = false;
  40.     boolean walkToBank = false;
  41.     boolean walkToWarrior = false;
  42.     public String status;
  43.     int trainStatran;
  44.     int startStatLvlran;
  45.     int startXpran;
  46.     int trainStatdef;
  47.     int startStatLvldef;
  48.     int startXpdef;
  49.     int trainStatatt;
  50.     int startStatLvlatt;
  51.     int startXpatt;
  52.     int trainStatstr;
  53.     int startStatLvlstr;
  54.     int startXpstr;
  55.     int htrainStat;
  56.     int hstartStatLvl;
  57.     int hstartXp;
  58.     long startTime = System.currentTimeMillis();
  59.     boolean pickup = true;
  60.     boolean eat = true;
  61.     private gui gui;
  62.     JLabel label_1;
  63.     JLabel label_2;
  64.     JComboBox combobox_1;
  65.     JTextField textfield_1;
  66.     JLabel label_3;
  67.     JLabel label_4;
  68.     JComboBox combobox_2;
  69.     JLabel label_5;
  70.     JComboBox combobox_3;
  71.     JLabel label_6;
  72.     JComboBox combobox_4;
  73.     JButton button_1;
  74.     public boolean start = false;
  75.     public boolean paint = true;
  76.     public String Style;
  77.    
  78.     public int loop() {
  79.         try {
  80.             if (start == true) {
  81.                 gui.setVisible(false);
  82.             }
  83.             if (gui.isVisible() == false) {
  84.                 if (textfield_1.getText().length() == 0) {
  85.                     if (eat == true) {
  86.                         log("You need to enter Food ID, if eating is true!");
  87.                         stopScript();
  88.                     }
  89.                 }
  90.                 if (textfield_1.getText().length() != 0) {
  91.                     try {
  92.                         food = Integer.parseInt(textfield_1.getText());
  93.                     }
  94.                     catch (NumberFormatException e) {
  95.                         log("Food ID = number!");
  96.                         stopScript();
  97.                     }
  98.                 }
  99.                 if (walkToWarrior == true) {
  100.                     if (!getMyPlayer().isMoving()) {
  101.                         status = "Walking to Warriors";
  102.                         walking.walkPathMM(bankToWarrior, 1, 1);
  103.                         walkToWarrior = false;
  104.                     }
  105.                 }
  106.                 if (walkToBank == true) {
  107.                     if (!getMyPlayer().isMoving()) {
  108.                         status = "Walking to bank";
  109.                         walking.walkPathMM(warriorToBank, 1, 1);
  110.                         walkToBank = false;
  111.                     }
  112.                 }
  113.                 if (getMyPlayer().isMoving()) {
  114.                     antiban();
  115.                     sleep(180, 220);
  116.                 }
  117.                 if (inFight == true){
  118.                     antiban();
  119.                     sleep(180, 220);
  120.                 }
  121.                 if (!walking.isRunEnabled() && (walking.getEnergy() > random(55, 95))) {
  122.                     walking.setRun(true);
  123.                     status = "Setting run";
  124.                     sleep(800, 1000);
  125.                 }
  126.                 else if (calc.distanceTo(warriorTile) < 15 ) {
  127.                     if (eat == true) {
  128.                         if (!inventory.contains(food)) {
  129.                             walkToBank = true;
  130.                         }
  131.                         if (combat.getLifePoints() < (skills.getRealLevel(3) * 10) / 2) {
  132.                             if (inventory.getItem(food).doAction("Eat")) {
  133.                                 status = "Eating...";
  134.                                 sleep(300, 600);
  135.                             }
  136.                         }
  137.                     }
  138.                     if (inventory.isFull() && eat == false) {
  139.                         walkToBank = true;
  140.                     }
  141.                     if (pickup == true) {
  142.                         itegr = groundItems.getNearest(items);
  143.                         if (itegr != null) {
  144.                             if (itegr != ite) {
  145.                                 if (itegr.isOnScreen()) {
  146.                                     ite = itegr;
  147.                                     if (!inventory.isFull() && (ite != null) && getMyPlayer().getInteracting() == null) {
  148.                                         if(ite.doAction("Take")){
  149.                                             status = "Picking up item..";
  150.                                             sleep(1800,2300);
  151.                                         }
  152.                                     }
  153.                                     if (inventory.isFull() && (ite != null) && getMyPlayer().getInteracting() == null) {
  154.                                         inventory.getItem(food).doAction("Eat");
  155.                                         status = "Eating for space";
  156.                                         sleep(1300, 1600);
  157.                                         if (!inventory.isFull() && (ite != null)) {
  158.                                             if(ite.doAction("Take")){
  159.                                                 status = "Picking up item..";
  160.                                                 sleep(1800,2300);
  161.                                             }
  162.                                         }
  163.                                     }
  164.                                 }
  165.                                 else {
  166.                                     ite = null;
  167.                                 }
  168.                             }
  169.                         }
  170.                         else if (ite != null) {
  171.                             ite = null;
  172.                         }
  173.                     }
  174.                     if (getMyPlayer().getAnimation() != -1 && getMyPlayer().getInteracting() != null) {
  175.                         status = "Fighting...";
  176.                         inFight = true;
  177.                     }
  178.                     if (getMyPlayer().getAnimation() == -1 && getMyPlayer().getInteracting() == null) {
  179.                         inFight = false;
  180.                     }
  181.                     if (inFight == false) {
  182.                         attack();
  183.                     }
  184.                 }
  185.                 else if (calc.distanceTo(bankTile) < 5 ) {
  186.                     if (eat == true) {
  187.                         if (!inventory.contains(food)) {
  188.                             status = "No food, taking some...";
  189.                             useBank();
  190.                         }
  191.                         if (inventory.contains(food)) {
  192.                             walkToWarrior = true;
  193.                         }
  194.                     }
  195.                     if (eat == false) {
  196.                         if (inventory.getCount() != 0) {
  197.                             useBank();
  198.                         }
  199.                         if (inventory.getCount() == 0) {
  200.                             walkToWarrior = true;
  201.                         }
  202.                     }
  203.                 }
  204.             }
  205.         }
  206.         catch (Exception e) {
  207.         }
  208.         return 0;
  209.     }
  210.    
  211.     public int useBank() {
  212.         try {
  213.             if (!bank.isOpen()) {
  214.                 bank.open();
  215.                 sleep(700, 1400);
  216.             }
  217.             if (bank.isOpen()) {
  218.                 status = "Banking";
  219.                 sleep(500, 1200);
  220.                 if (inventory.getCount() != 0) {
  221.                     bank.depositAll();
  222.                     sleep(500, 700);
  223.                 }
  224.                 if (eat == false && inventory.getCount() == 0) {
  225.                     bank.close();
  226.                 }
  227.                 if (eat == true) {
  228.                     if (bank.getCount(food) == 0) {
  229.                         sleep(3000, 4000);
  230.                         bank.close();
  231.                         sleep(2000, 3000);
  232.                         foodb++;
  233.                         log("Out of food +1 time(s)");
  234.                         if (foodb > 5) {
  235.                                 log("Out of food, more than 5 times. stopScript();");
  236.                                 stopScript();
  237.                         }
  238.                         else {
  239.                             useBank();
  240.                         }
  241.                     }
  242.                     else {
  243.                         bank.withdraw(food, 0);
  244.                         sleep(1500, 2300);
  245.                         foodb = 0;
  246.                     }
  247.                 }
  248.             }
  249.         }
  250.         catch (Exception e) {
  251.         }
  252.         return 1200;
  253.     }
  254.    
  255.     public boolean onStart() {
  256.         if(!game.isLoggedIn()) {
  257.             log("Please log in before starting the script!");
  258.             return false;
  259.         }
  260.         gui = new gui();
  261.         gui.setVisible(true);
  262.         mouse.setSpeed(random(4, 5));
  263.         log("Starting aKilla");
  264.         trainStatran = Skills.RANGE;
  265.         startStatLvlran = skills.getCurrentLevel(trainStatran);
  266.         startXpran = skills.getCurrentExp(trainStatran);
  267.         trainStatatt = Skills.ATTACK;
  268.         startStatLvlatt = skills.getCurrentLevel(trainStatatt);
  269.         startXpatt = skills.getCurrentExp(trainStatatt);
  270.         trainStatdef = Skills.DEFENSE;
  271.         startStatLvldef = skills.getCurrentLevel(trainStatdef);
  272.         startXpdef = skills.getCurrentExp(trainStatdef);
  273.         trainStatstr = Skills.STRENGTH;
  274.         startStatLvlstr = skills.getCurrentLevel(trainStatstr);
  275.         startXpstr = skills.getCurrentExp(trainStatstr);
  276.         htrainStat = Skills.CONSTITUTION;
  277.         hstartStatLvl = skills.getCurrentLevel(Skills.CONSTITUTION);
  278.         hstartXp = skills.getCurrentExp(Skills.CONSTITUTION);
  279.         return true;
  280.     }
  281.    
  282.     public void onRepaint(Graphics g) {
  283.         if (game.isLoggedIn()) {
  284.             if (start == true && paint == true) {
  285.                 Point m = mouse.getLocation();
  286.                 g.setColor(Color.green);
  287.                 g.drawRoundRect(m.x - 6, m.y, 14, 2, 5, 5);
  288.                 g.drawRoundRect(m.x, m.y - 6, 2, 14, 5, 5);
  289.                 g.setColor(Color.green);
  290.                 g.fillRoundRect(m.x - 6, m.y, 14, 2, 5, 5);
  291.                 g.fillRoundRect(m.x, m.y - 6, 2, 14, 5, 5);
  292.                 double millis = System.currentTimeMillis() - startTime;
  293.                 int hlevelChange = skills.getCurrentLevel(htrainStat) - hstartStatLvl;
  294.                 int hxpChange = skills.getCurrentExp(htrainStat) - hstartXp;
  295.                 int hclvl = skills.getCurrentLevel(htrainStat);
  296.                 int hxpPerHour = (int)((hxpChange / millis) * (1000 * 3600));
  297.                 int alevelChange = skills.getCurrentLevel(trainStatatt) - startStatLvlatt;
  298.                 int axpChange = skills.getCurrentExp(trainStatatt) - startXpatt;
  299.                 int aclvl = skills.getCurrentLevel(trainStatatt);
  300.                 int axpPerHour = (int)((axpChange / millis) * (1000 * 3600));
  301.                 int slevelChange = skills.getCurrentLevel(trainStatstr) - startStatLvlstr;
  302.                 int sxpChange = skills.getCurrentExp(trainStatstr) - startXpstr;
  303.                 int sclvl = skills.getCurrentLevel(trainStatstr);
  304.                 int sxpPerHour = (int)((sxpChange / millis) * (1000 * 3600));
  305.                 int dlevelChange = skills.getCurrentLevel(trainStatdef) - startStatLvldef;
  306.                 int dxpChange = skills.getCurrentExp(trainStatdef) - startXpdef;
  307.                 int dclvl = skills.getCurrentLevel(trainStatdef);
  308.                 int dxpPerHour = (int)((dxpChange / millis) * (1000 * 3600));
  309.                 int rlevelChange = skills.getCurrentLevel(trainStatran) - startStatLvlran;
  310.                 int rxpChange = skills.getCurrentExp(trainStatran) - startXpran;
  311.                 int rclvl = skills.getCurrentLevel(trainStatran);
  312.                 int rxpPerHour = (int)((rxpChange / millis) * (1000 * 3600));
  313.                 String time = formatTime((int)(millis/1000));
  314.                 g.setColor(new Color(0, 0, 0, 100));
  315.                 g.draw3DRect(5, 15, 210, 130, true);
  316.                 g.fill3DRect(5, 15, 210, 130, true);
  317.                 g.setColor(Color.red);
  318.                 g.setFont(new Font("zurich ex bt", Font.BOLD, 11));
  319.                 g.drawString("aKilla, by alluk", 8, 30);
  320.                 g.setFont(new Font("zurich ex bt", Font.PLAIN, 11));
  321.                 g.setColor(Color.LIGHT_GRAY);
  322.                 g.drawString("Version 0.26", 8, 40);
  323.                 g.setColor(Color.white);
  324.                 g.setFont(new Font("zurich ex bt", Font.BOLD, 11));
  325.                 g.drawString("Status: " + status, 8, 55);
  326.                 g.setColor(Color.orange);
  327.                 if(combobox_4.getSelectedItem().toString().contains("Attack")) {
  328.                     g.drawString("Attack lvl: " + aclvl + " (" + alevelChange + ")", 8, 70);
  329.                     g.drawString("Attack XP Gained: " + axpChange, 8, 80);
  330.                     g.drawString("Attack XP/H: " + axpPerHour, 8, 90);
  331.                 }
  332.                 if(combobox_4.getSelectedItem().toString().contains("Strength")) {
  333.                     g.drawString("Strength lvl: " + sclvl + " (" + slevelChange + ")", 8, 70);
  334.                     g.drawString("Strength XP Gained: " + sxpChange, 8, 80);
  335.                     g.drawString("Strength XP/H: " + sxpPerHour, 8, 90);
  336.                 }
  337.                 if(combobox_4.getSelectedItem().toString().contains("Defense")) {
  338.                     g.drawString("Defense lvl: " + dclvl + " (" + dlevelChange + ")", 8, 70);
  339.                     g.drawString("Defense XP Gained: " + dxpChange, 8, 80);
  340.                     g.drawString("Defense XP/H: " + dxpPerHour, 8, 90);
  341.                 }
  342.                 if(combobox_4.getSelectedItem().toString().contains("Ranged")) {
  343.                     g.drawString("Ranged lvl: " + rclvl + " (" + rlevelChange + ")", 8, 70);
  344.                     g.drawString("Ranged XP Gained: " + rxpChange, 8, 80);
  345.                     g.drawString("Ranged XP/H: " + rxpPerHour, 8, 90);
  346.                 }
  347.                 g.setColor(Color.pink);
  348.                 g.drawString("Hitpoints lvl: " + hclvl + " (" + hlevelChange + ")", 8, 105);
  349.                 g.drawString("Hitpoints XP Gained: " + hxpChange, 8, 115);
  350.                 g.drawString("Hitpoints XP/H: " + hxpPerHour, 8, 125);
  351.                 g.setColor(Color.white);
  352.                 g.drawString("Runtime: " + time, 8, 140);
  353.             }
  354.         }
  355.     }
  356.    
  357.     String formatTime (int seconds) {
  358.         return (((int)seconds / 3600 < 10 ? "0" : "") + (int)seconds / 3600 + ":" + ((int)seconds / 60 % 60 < 10 ? "0" : "") + (int)seconds / 60 % 60 + ":" + ((int)seconds % 60 < 10 ? "0" : "") + (int)seconds % 60);
  359.     }
  360.  
  361.     public void antiban() {
  362.         try {
  363.             if (getMyPlayer().getInteracting() != null) {
  364.                     int rndm;
  365.                     rndm = random(1, 10000);
  366.                     if (rndm <= 10) {
  367.                         if (!(game.getCurrentTab() == Game.TAB_STATS)) {
  368.                             game.openTab(Game.TAB_STATS);
  369.                             sleep(300, 500);
  370.                         }
  371.                         mouse.move(642, 222, 28, 9);
  372.                         sleep(500, 700);
  373.                     }
  374.                     else if (rndm <= 40) {
  375.                         if (!(game.getCurrentTab() == Game.TAB_STATS)) {
  376.                             sleep(200, 300);
  377.                             game.openTab(Game.TAB_STATS);
  378.                             sleep(200, 300);
  379.                         }
  380.                         if (Style == "Attack") {
  381.                             mouse.move(580, 222, 28, 9);
  382.                             sleep(500, 700);
  383.                         }
  384.                         else if (Style == "Strength") {
  385.                             mouse.move(580, 248, 28, 9);
  386.                             sleep(500, 700);
  387.                         }
  388.                         else if (Style == "Defence") {
  389.                             mouse.move(580, 280, 28, 9);
  390.                             sleep(500, 700);
  391.                         }
  392.                         else if (Style == "Range") {
  393.                             mouse.move(580, 306, 28, 9);
  394.                             sleep(500, 700);
  395.                         }
  396.                     }
  397.                     else if (rndm <= 425) {
  398.                         mouse.moveRandomly(500);
  399.                     }
  400.                     else if (rndm <= 650) {
  401.                         camera.setAngle(random(1, 360));
  402.                     }
  403.                     else if (rndm <= 850) {
  404.                         mouse.setSpeed(random(4, 5));
  405.                     }
  406.                     else if (rndm <= 860) {
  407.                         if (!(game.getCurrentTab() == Game.TAB_STATS)) {
  408.                             sleep(200, 300);
  409.                             game.openTab(Game.TAB_STATS);
  410.                             sleep(200, 300);
  411.                         }
  412.                         mouse.move(580, 336, 27, 9);
  413.                         sleep(500, 700);
  414.                     }
  415.                     else if (rndm <= 880){
  416.                         mouse.moveOffScreen();
  417.                     }
  418.                     sleep(100, 200);
  419.             }
  420.             else {
  421.                 int rndm;
  422.                 rndm = random(1, 10000);
  423.                 if (rndm == 10) {
  424.                     if (!(game.getCurrentTab() == Game.TAB_STATS)) {
  425.                         game.openTab(Game.TAB_STATS);
  426.                         sleep(300, 500);
  427.                     }
  428.                     mouse.move(642, 222, 28, 9);
  429.                     sleep(500, 700);
  430.                 }
  431.                 else if (rndm <= 40) {
  432.                     if (!(game.getCurrentTab() == Game.TAB_STATS)) {
  433.                         sleep(200, 300);
  434.                         game.openTab(Game.TAB_STATS);
  435.                         sleep(200, 300);
  436.                     }
  437.                     if (Style == "Attack") {
  438.                         mouse.move(580, 222, 28, 9);
  439.                         sleep(500, 700);
  440.                     }
  441.                     else if (Style == "Strength") {
  442.                         mouse.move(580, 248, 28, 9);
  443.                         sleep(500, 700);
  444.                     }
  445.                     else if (Style == "Defence") {
  446.                         mouse.move(580, 280, 28, 9);
  447.                         sleep(500, 700);
  448.                     }
  449.                     else if (Style == "Range") {
  450.                         mouse.move(580, 306, 28, 9);
  451.                         sleep(500, 700);
  452.                     }
  453.                 }
  454.                 else if (rndm <= 425) {
  455.                     mouse.moveRandomly(500);
  456.                 }
  457.                 else if (rndm <= 650) {
  458.                     camera.setAngle(random(1, 360));
  459.                 }
  460.                 else if (rndm <= 850) {
  461.                     mouse.setSpeed(random(4, 5));
  462.                 }
  463.                 else if (rndm <= 950) {
  464.                     if (!(game.getCurrentTab() == Game.TAB_STATS)) {
  465.                         sleep(200, 300);
  466.                         game.openTab(Game.TAB_STATS);
  467.                         sleep(200, 300);
  468.                     }
  469.                     mouse.move(580, 336, 27, 9);
  470.                     sleep(500, 700);
  471.                 }
  472.                 else if (rndm <= 980){
  473.                     mouse.moveOffScreen();
  474.                 }
  475.                 sleep(100, 200);
  476.             }
  477.         }
  478.         catch(Exception e) {
  479.         }
  480.     }
  481.  
  482.  
  483.     public int attack() {
  484.         try {
  485.             if (!npcs.getNearest(warrior).isOnScreen()) {
  486.                 if(npcs.getNearest(warrior).getHPPercent() != 0) {
  487.                     if (!getMyPlayer().isMoving()) {
  488.                         if (walkToBank == false) {
  489.                             if (walkToWarrior == false){
  490.                                 if(walking.walkTileMM(npcs.getNearest(warrior, 1, 1).getLocation())){
  491.                                     status = ("Walking to nearest warrior");
  492.                                     attack();
  493.                                 }
  494.                             }
  495.                         }
  496.                     }
  497.                 }
  498.             }
  499.             else {
  500.                 if (npcs.getNearest(warrior).isOnScreen()) {
  501.                     if (npcs.getNearest(warrior).getHPPercent() != 0) {
  502.                         if (getMyPlayer().getInteracting() == null) {
  503.                             if (walkToBank == false) {
  504.                                 if (walkToWarrior == false) {
  505.                                     if (npcs.getNearest(warrior).doAction("Attack")) {
  506.                                         status = "Attacking Warriors";
  507.                                         sleep(1500, 2000);
  508.                                     }
  509.                                 }
  510.                             }
  511.                         }
  512.                     }
  513.                 }
  514.             }
  515.         }
  516.         catch (Exception e) {
  517.         }
  518.         return 0;
  519.     }
  520.    
  521.     public class gui extends javax.swing.JFrame {
  522.        
  523.         private static final long serialVersionUID = 1L;
  524.        
  525.         public gui() {
  526.             initComponents();
  527.         }
  528.        
  529.         private void initComponents() {
  530.             aLayout customLayout = new aLayout();
  531.             getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
  532.             getContentPane().setLayout(customLayout);
  533.             label_1 = new JLabel("aKilla - alluk");
  534.             getContentPane().add(label_1);
  535.             label_2 = new JLabel("Food ID:");
  536.             getContentPane().add(label_2);
  537.             textfield_1 = new JTextField("");
  538.             getContentPane().add(textfield_1);
  539.             label_3 = new JLabel("Pickup:");
  540.             getContentPane().add(label_3);
  541.             combobox_1 = new JComboBox();
  542.             combobox_1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));
  543.             getContentPane().add(combobox_1);
  544.             label_4 = new JLabel("Eat food:");
  545.             getContentPane().add(label_4);
  546.             combobox_2 = new JComboBox();
  547.             combobox_2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));
  548.             getContentPane().add(combobox_2);
  549.             label_5 = new JLabel("Paint:");
  550.             getContentPane().add(label_5);
  551.             combobox_3 = new JComboBox();
  552.             combobox_3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));
  553.             getContentPane().add(combobox_3);
  554.             label_6 = new JLabel("Paint skill:");
  555.             getContentPane().add(label_6);
  556.             combobox_4 = new JComboBox();
  557.             combobox_4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Attack", "Strength", "Defense", "Ranged" }));
  558.             getContentPane().add(combobox_4);
  559.             button_1 = new JButton("Start!");
  560.             getContentPane().add(button_1);
  561.             button_1.addActionListener(new java.awt.event.ActionListener() {
  562.                
  563.                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  564.                     button_1actionPerformed(evt);
  565.                 }
  566.             });
  567.             setSize(getPreferredSize());
  568.         }
  569.        
  570.         public void button_1actionPerformed(ActionEvent evt) {
  571.             if(combobox_1.getSelectedItem().toString().contains("Yes")) {
  572.                 pickup = true;
  573.             }
  574.             if(combobox_1.getSelectedItem().toString().contains("No")) {
  575.                 pickup = false;
  576.             }
  577.             if(combobox_2.getSelectedItem().toString().contains("Yes")) {
  578.                 eat = true;
  579.             }
  580.             if(combobox_2.getSelectedItem().toString().contains("No")) {
  581.                 eat = false;
  582.             }
  583.             if(combobox_3.getSelectedItem().toString().contains("No")) {
  584.                 paint = false;
  585.             }
  586.             if(combobox_3.getSelectedItem().toString().contains("Yes")) {
  587.                 paint = true;
  588.             }
  589.             if(combobox_4.getSelectedItem().toString().contains("Attack")) {
  590.                 Style = "Attack";
  591.             }
  592.             if(combobox_4.getSelectedItem().toString().contains("Strength")) {
  593.                 Style = "Strength";
  594.             }
  595.             if(combobox_4.getSelectedItem().toString().contains("Defense")) {
  596.                 Style = "Defense";
  597.             }
  598.             if(combobox_4.getSelectedItem().toString().contains("Ranged")) {
  599.                 Style = "Range";
  600.             }
  601.             start = true;
  602.         }
  603.        
  604.         @SuppressWarnings("deprecation")
  605.         public void main(String args[]) {
  606.             gui window = new gui();
  607.             window.setTitle("aKilla");
  608.             window.pack();
  609.             window.show();
  610.         }
  611.        
  612.         class aLayout implements LayoutManager {
  613.  
  614.             public aLayout() {
  615.             }
  616.  
  617.             public void addLayoutComponent(String name, Component comp) {
  618.             }
  619.  
  620.             public void removeLayoutComponent(Component comp) {
  621.             }
  622.  
  623.             public Dimension preferredLayoutSize(Container parent) {
  624.                 Dimension dim = new Dimension(0, 0);
  625.                 Insets insets = parent.getInsets();
  626.                 dim.width = 110 + insets.left + insets.right;
  627.                 dim.height = 365 + insets.top + insets.bottom;
  628.                 return dim;
  629.             }
  630.  
  631.             public Dimension minimumLayoutSize(Container parent) {
  632.                 Dimension dim = new Dimension(0, 0);
  633.                 return dim;
  634.             }
  635.  
  636.             public void layoutContainer(Container parent) {
  637.                 Insets insets = parent.getInsets();
  638.                 Component c;
  639.                 c = parent.getComponent(0);
  640.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+8,88,24);}
  641.                 c = parent.getComponent(1);
  642.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+40,88,24);}
  643.                 c = parent.getComponent(2);
  644.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+64,88,24);}
  645.                 c = parent.getComponent(3);
  646.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+88,88,24);}
  647.                 c = parent.getComponent(4);
  648.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+112,88,24);}
  649.                 c = parent.getComponent(5);
  650.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+136,88,24);}
  651.                 c = parent.getComponent(6);
  652.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+160,88,24);}
  653.                 c = parent.getComponent(7);
  654.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+184,88,24);}
  655.                 c = parent.getComponent(8);
  656.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+208,88,24);}
  657.                 c = parent.getComponent(9);
  658.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+232,88,24);}
  659.                 c = parent.getComponent(10);
  660.                 if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+256,88,24);}
  661.                 c = parent.getComponent(11);
  662.                 if (c.isVisible()) {c.setBounds(insets.left+16,insets.top+288,72,24);}
  663.             }
  664.         }
  665.  
  666.     }
  667. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement