Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • I can't see my script


    Recommended Posts

    I was doing this tutorial (it's very old), I made my own script similar to Computor's basic woodcutter.



    Now I'm not getting any errors but my script doesn't appear at the script panel of DreamBot. What could be the reason?


    My code is here:

    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.NPC;
    import javax.imageio.ImageIO;
    import java.awt.*;
    import java.io.IOException;
    import java.net.URL;
     * Created by burak on 26-05-17.
    @ScriptManifest(name = "ProKiller", author = "Laylaylom", description = "Kills anything you want", version = 2.0, category = Category.COMBAT)
    public class ProKiller extends AbstractScript {
        private boolean startScript;
        private ProKillerGui gui;
        private Image mainPaint = getImage("http://imgur.com/xHeQyjX");
        public void onStart() {
            gui = new ProKillerGui(this);
        public int onLoop() {
            if (startScript) {
    //          eatSomeFood(gui.getFoodType());
            return 400;
        public void killIt(String nameOfMob){
            NPC mob = getNpcs().closest(nameOfMob);
            if (mob != null && !mob.isInCombat() && mob.canAttack()){
                if (mob.interact("Attack")){
                    sleepUntil(() -> mob.getHealthPercent() <= 0, Calculations.random(5500,8500));
                sleepUntil(() -> mob.exists() && mob.canAttack(), Calculations.random(1500,3500));
    //    public void eatSomeFood(String foodName){
    //         here comes food code
    //    }
        public void setStartScript(boolean startScript) {
            this.startScript = startScript;
        public void onPaint(Graphics2D g) {
            g.drawImage(mainPaint, 0, 340, null);
        private Image getImage(String url){
            try {
                return ImageIO.read(new URL(url));
            }catch (IOException e){
                return null;

    GUI code:

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
     * Created by JFormDesigner on Fri May 26 00:19:36 CEST 2017
     * @[member='Authorities'] unknown
    public class ProKillerGui extends JFrame {
        private ProKiller ctx;
        public ProKillerGui(ProKiller main){
            this.ctx = main;
        private void button1ActionPerformed(ActionEvent e) {
        private void initComponents() {
            // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
            // Generated using JFormDesigner Evaluation license - Burak kemal
            button1 = new JButton();
            comboBox1 = new JComboBox<>();
            label1 = new JLabel();
            label2 = new JLabel();
            label3 = new JLabel();
            textField1 = new JTextField();
            //======== this ========
            setTitle("ProKiller GUI");
            Container contentPane = getContentPane();
            //---- button1 ----
            button1.addActionListener(e -> button1ActionPerformed(e));
            button1.setBounds(55, 120, 165, button1.getPreferredSize().height);
            //---- comboBox1 ----
            comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
                "Cooked chicken",
                "Cooked meat",
            comboBox1.setBackground(new Color(69, 73, 74));
            comboBox1.setBounds(new Rectangle(new Point(140, 15), comboBox1.getPreferredSize()));
            //---- label1 ----
            label1.setText("Choose your food");
            label1.setBackground(new Color(51, 255, 0));
            label1.setForeground(new Color(51, 204, 0));
            label1.setBounds(new Rectangle(new Point(10, 20), label1.getPreferredSize()));
            //---- label2 ----
            label2.setText("Which mob do");
            label2.setForeground(new Color(51, 204, 0));
            label2.setBounds(new Rectangle(new Point(10, 60), label2.getPreferredSize()));
            //---- label3 ----
            label3.setText("you want to kill?");
            label3.setForeground(new Color(51, 204, 0));
            label3.setBounds(new Rectangle(new Point(10, 75), label3.getPreferredSize()));
            //---- textField1 ----
            textField1.setBackground(new Color(69, 73, 74));
            textField1.setBounds(140, 70, 130, textField1.getPreferredSize().height);
            contentPane.setPreferredSize(new Dimension(280, 165));
            // JFormDesigner - End of component initialization  //GEN-END:initComponents
        public String getFoodType() {
            return comboBox1.getSelectedItem().toString();
        public String getMobName() {
            return textField1.getText().toString();
        // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
        // Generated using JFormDesigner Evaluation license - Burak kemal
        private JButton button1;
        private JComboBox<String> comboBox1;
        private JLabel label1;
        private JLabel label2;
        private JLabel label3;
        private JTextField textField1;
        // JFormDesigner - End of variables declaration  //GEN-END:variables

    Here the .JAR file 


    Someone told me that the code is broken, I also tried Computor's woodcutter script. The script doesn't appear. 


    Maybe DreamBot doesn't support JFrames anymore or something? 

    Okay here the problem;


    At Artifacts > add > JAR you get 2 options, Empty or From modules with dependencies


    In the tutorial of Computor he did the second option, but it has to be the first option "Empty".


    they are 2 different things as I understood ( executable and runnable )


    Thanks to @hastag he solved this problem  :wub:

    Link to comment
    Share on other sites


    This topic is now archived and is closed to further replies.

    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.