miqibot Posted October 7, 2022 Share Posted October 7, 2022 I want to create a bot with a UI like the pro scripts. Anyone got a code format for this one? Would be appreciated Quote Link to comment Share on other sites More sharing options...
crashbashash Posted December 14, 2022 Share Posted December 14, 2022 (edited) public class PrivateWalkerGUI extends JFrame { private JPanel panel; private JLabel label; private JComboBox<String> comboBox; private JButton button; private String areaName; private Area area; private enum Areas { VARROCK ("Varrock", new Area(new Tile(3210, 3422, 0), new Tile(3218, 3433, 0))), LUMBRIDGE ("Lumbridge", new Area(new Tile(3221, 3221, 0), new Tile(3226, 3216, 0))); private final String name; private final Area area; Areas(String _name, Area _area) { this.name = _name; this.area = _area; } } public PrivateWalkerGUI(PrivateWalkerBot bot) { setTitle("Private Walker"); setSize(300, 100); setLocationRelativeTo(null); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(new BorderLayout()); panel = new JPanel(); panel.setLayout(new FlowLayout()); label = new JLabel("Select an area to walk to: "); panel.add(label); comboBox = new JComboBox<String>(); for (Areas a : Areas.values()) { comboBox.addItem(a.name); } panel.add(comboBox); button = new JButton("Walk"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { areaName = (String) comboBox.getSelectedItem(); for (Areas a : Areas.values()) { if (a.name.equals(areaName)) { area = a.area; } } bot.setArea(area); } }); panel.add(button); add(panel); setVisible(true); } } This is a very basic implementation of the GUI system in EpicBot. Epic bot automatically sets the look and feel (laf) of the Java Swing GUI. So you don't really need to worry about it too much. Edited December 14, 2022 by crashbashash Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.