Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. import java.awt.event.ActionEvent;
  2. import java.awt.event.ActionListener;
  3. import javax.swing.DefaultComboBoxModel;
  4. import javax.swing.JButton;
  5. import javax.swing.JComboBox;
  6. import javax.swing.JFrame;
  7. import javax.swing.JPanel;
  8. import org.osbot.rs07.api.map.Area;
  9. import org.osbot.rs07.api.model.RS2Object;
  10. import org.osbot.rs07.script.Script;
  11. import org.osbot.rs07.script.ScriptManifest;
  12.  
  13. @ScriptManifest(author = "Mr Pro Pop", info = "JFrame", logo = "", name = "JFrame", version = 1)
  14. public class aaaa extends Script {
  15.  
  16. private JFrame gui;
  17. private JComboBox comboBox;
  18. private JButton btnStart;
  19. public static String tree = null;
  20.  
  21. /**
  22. * @wbp.parser.entryPoint
  23. */
  24. public void JFrame() {
  25.  
  26. gui = new JFrame();
  27. comboBox = new JComboBox();
  28. btnStart = new JButton();
  29.  
  30. gui.setTitle("title");
  31. gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  32. gui.setBounds(100, 100, 406, 155);
  33. gui.getContentPane();
  34. gui.getContentPane().setLayout(null);
  35.  
  36. comboBox.setModel(new DefaultComboBoxModel(new String[] {"Select An Option", "Tree", "Oak", "Willow"}));
  37. comboBox.setBounds(30, 34, 124, 44);
  38. gui.getContentPane().add(comboBox);
  39.  
  40. btnStart.setBounds(236, 40, 89, 33);
  41. gui.getContentPane().add(btnStart);
  42. gui.getContentPane().add(btnStart);
  43. gui.setVisible(true);
  44. btnStart.addActionListener(new ActionListener() {
  45.  
  46. public void actionPerformed(ActionEvent e) {
  47. // TODO Auto-generated method stub
  48. gui.setVisible(false);
  49. gui.dispose();
  50. tree = comboBox.getSelectedItem().toString();
  51. if (tree.equals("Willow")) {
  52. Area WALK = new Area(3180, 3275, 3161, 3262);
  53.  
  54. RS2Object willow = getObjects().closest(o -> o.getName().equalsIgnoreCase("Willow") && WALK.contains(o));
  55. willow.interact("Chop down");
  56.  
  57. if(getInventory().isFull()) if(!getInventory().isFull() && !WALK.contains(myPlayer()));{
  58. inventory.dropAll();
  59. getWalking().webWalk(WALK);
  60.  
  61. }
  62.  
  63.  
  64.  
  65.  
  66. }
  67.  
  68.  
  69. }
  70.  
  71.  
  72. });
  73. }
  74.  
  75. public void onStart() {
  76.  
  77. JFrame();
  78. }
  79.  
  80. public int onLoop() throws InterruptedException {
  81. return 0;
  82. }
  83.  
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement