SHOW:
|
|
- or go back to the newest paste.
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; |
19 | + | private static String tree = null; |
20 | private Area WALK = new Area(3180, 3275, 3161, 3262); | |
21 | ||
22 | /** | |
23 | * @wbp.parser.entryPoint | |
24 | */ | |
25 | public void JFrame() { | |
26 | ||
27 | gui = new JFrame(); | |
28 | comboBox = new JComboBox(); | |
29 | btnStart = new JButton(); | |
30 | ||
31 | gui.setTitle("title"); | |
32 | gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
33 | gui.setBounds(100, 100, 406, 155); | |
34 | gui.getContentPane(); | |
35 | gui.getContentPane().setLayout(null); | |
36 | ||
37 | comboBox.setModel(new DefaultComboBoxModel(new String[] {"Select An Option", "Tree", "Oak", "Willow"})); | |
38 | comboBox.setBounds(30, 34, 124, 44); | |
39 | gui.getContentPane().add(comboBox); | |
40 | ||
41 | btnStart.setBounds(236, 40, 89, 33); | |
42 | gui.getContentPane().add(btnStart); | |
43 | gui.getContentPane().add(btnStart); | |
44 | gui.setVisible(true); | |
45 | btnStart.addActionListener(new ActionListener() { | |
46 | ||
47 | public void actionPerformed(ActionEvent e) { | |
48 | // TODO Auto-generated method stub | |
49 | gui.setVisible(false); | |
50 | gui.dispose(); | |
51 | tree = comboBox.getSelectedItem().toString(); | |
52 | if (tree.equals("Willow")) { | |
53 | Area WALK = new Area(3180, 3275, 3161, 3262); | |
54 | - | RS2Object willow = getObjects().closest(o -> o.getName().equalsIgnoreCase("Willow") && WALK.contains(o)); |
54 | + | |
55 | } | |
56 | ||
57 | ||
58 | ||
59 | ||
60 | } | |
61 | ||
62 | ||
63 | } | |
64 | ||
65 | ||
66 | }); | |
67 | } | |
68 | ||
69 | public void onStart() { | |
70 | ||
71 | JFrame(); | |
72 | } | |
73 | ||
74 | public int onLoop() throws InterruptedException { | |
75 | RS2Object willow = getObjects().closest(o -> o.getName().equalsIgnoreCase("Willow") && WALK.contains(o)); | |
76 | willow.interact("Chop down"); | |
77 | ||
78 | if(getInventory().isFull()) if(!getInventory().isFull() && !WALK.contains(myPlayer()));{ | |
79 | inventory.dropAll(); | |
80 | getWalking().webWalk(WALK); | |
81 | - | return 0; |
81 | + | return 300; |
82 | } | |
83 | ||
84 | } |