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
  • Try asking for help in the chatbox
  • Script no longer produces a .jar after trying to add a GUI, but it did before


    Before
     Share

    Recommended Posts

    Thanks a lot @Mad and @Hopewelljnj, on one of my scripts I had forgotten the Script Manifest and on the other it was somehow glitched, but making a new package and copying over all the code seemed to work! Thanks a lot guys :D :D

     

     

    I decided I was going to try to make my first (yay!) gui, so when I followed some tutorials I got my code and went to compile it, but it didn't appear in my scripts folder (auto compiles there).. I have no idea what went wrong. I'm using the intelliJ IDE, and I made a little gif showing wat I mean: http://i.imgur.com/CQfXFhT.webm

     

     

    >You have no ScriptManifest

    Edited by Before
    Link to comment
    Share on other sites

    Edit: None of my scripts are compiling now. My life D:


    Go back to artifacts, tick the box -> build on make, then do project -> make module.

    No workie :(


    Go back to artifacts, tick the box -> build on make, then do project -> make module.

    actually, the script I just wrote now compiled into a jar (the one I did that to), but it won't appear in the dreambot scripts on the client now

    Link to comment
    Share on other sites

    Paste your code, otherwise hard to help

    Just made this one that won't compile too

    package main;
    
    import org.dreambot.api.methods.magic.Magic;
    import org.dreambot.api.methods.magic.Spell;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.methods.map.Tile;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.wrappers.items.GroundItem;
    
    import java.util.Random;
    
    public class Main extends AbstractScript
    {
        private Area chickenFarm1 = new Area(3236,3300,3225,3296,0);
        private Tile chickenFarmGate = new Tile(3237,3296,0);
        private Tile lummyCastleStairs = new Tile(3206,3208,0);
        private Random Rand = new Random();
    
        @Override
        public int onLoop()
        {
            if (!getInventory().isFull())
            {
                if (!chickenFarm1.contains(getLocalPlayer()))
                {
                    while (getLocalPlayer().getZ() != 0)
                    {
                        GameObject stairs = getGameObjects().closest("Staircase");
                        if (stairs == null)
                        {
                            Spell lummyTele = new Spell()
                            {
                                @Override
                                public int getParent()
                                {
                                    return 218;
                                }
    
                                @Override
                                public int getChild()
                                {
                                    return 1;
                                }
                            };
                            getMagic().castSpell(lummyTele);
                            sleep(7000+Rand.nextInt(2000));
                        }
                        else
                        {
                            stairs.interact("Climb-down");
                        }
                        sleep(600+Rand.nextInt(600));
                    }
                    while (!chickenFarm1.contains(getLocalPlayer()) || chickenFarmGate.distance(getLocalPlayer()) > 5)
                    {
                        getWalking().walk(chickenFarmGate);
                        sleep(2000+Rand.nextInt(800));//fuck SleepUntil. Botty AF
                    }
                    GameObject gate = getGameObjects().closest("Gate");
                    if (gate.hasAction("Open"))
                    {
                        gate.interact("Open");
                    }
                    getWalking().walk(chickenFarm1.getRandomTile());
                }
    
                GroundItem bone = getGroundItems().closest("Bones");
                if (bone != null)
                {
                    bone.interact("Take");
                }
    
            }
            else
            {
                if (getLocalPlayer().getZ()==0)
                {
                    while (lummyCastleStairs.distance(getLocalPlayer()) > 5)
                    {
                        getWalking().walk(lummyCastleStairs);
                        sleep(600+Rand.nextInt(600));
                    }
                }
                if (getLocalPlayer().getZ() != 2)
                {
                    GameObject stairs = getGameObjects().closest("Staircase");
                    stairs.interact("Climb-up");
                }
                else
                {
                    GameObject bank = getGameObjects().closest("Bank Booth");
                    bank.interact("Bank");
                    sleep(300);
                    sleepUntil(() -> getBank().isOpen(), 2000);
                    sleep(200+Rand.nextInt(50));
                    getBank().depositAllItems();//bank that shit up
                }
            }
    
    
    
            return 200;
        }
    }
    
    

    It just claims that it works but it's not showing up in the dreambot client. (Jar is being produced)

    Edited by Before
    Link to comment
    Share on other sites

    You have no ScriptManifest

    My life

     

    THAT's a mistake I will never make again.

    You have no ScriptManifest

    Paste your code, otherwise hard to help

    Okie that solved that one but my gui one is still broke.. Here's my gui code:

    package main;
    
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class defendTheCastleGUI extends JFrame {
    
        private Main ctx;
        public defendTheCastleGUI (Main main)
        {
            this.ctx = main;
            initComponents();
        }
    
        private void button1ActionPerformed(ActionEvent e) {
            ctx.setStartScript(true);
            this.setVisible(false);
        }
    
        private void initComponents() {
            label1 = new JLabel();
            textField1 = new JTextField();
            textField2 = new JTextField();
            button1 = new JButton();
    
            //======== this ========
            Container contentPane = getContentPane();
            contentPane.setLayout(null);
    
            //---- label1 ----
            label1.setText("Enter one or two names");
            contentPane.add(label1);
            label1.setBounds(new Rectangle(new Point(65, 15), label1.getPreferredSize()));
            contentPane.add(textField1);
            textField1.setBounds(75, 40, 130, textField1.getPreferredSize().height);
            contentPane.add(textField2);
            textField2.setBounds(75, 70, 130, textField2.getPreferredSize().height);
    
            //---- button1 ----
            button1.setText("Start");
            button1.addActionListener(e -> {
    			button1ActionPerformed(e);
    			button1ActionPerformed(e);
    		});
            contentPane.add(button1);
            button1.setBounds(new Rectangle(new Point(165, 220), button1.getPreferredSize()));
    
            contentPane.setPreferredSize(new Dimension(400, 300));
            pack();
            setLocationRelativeTo(getOwner());
        }
    
        public String getFirstName()
        {
            return textField1.getText();
        }
        public String getSecondName()
        {
            return textField2.getText();
        }
    
        private JLabel label1;
        private JTextField textField1;
        private JTextField textField2;
        private JButton button1;
    }
    
    
    

    And my getter is just

    public void setStartScript(boolean startScript) {
            this.startScript = startScript;
        }
    

    All my other code has worked before and is unchanged, it has script manifest and it won't compile. It's the one seen in the gif.

    Edited by Before
    Link to comment
    Share on other sites

    My life

     

    THAT's a mistake I will never make again.

    Okie that solved that one but my gui one is still broke.. Here's my gui code:

    package main;
    
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class defendTheCastleGUI extends JFrame {
    
        private Main ctx;
        public defendTheCastleGUI (Main main)
        {
            this.ctx = main;
            initComponents();
        }
    
        private void button1ActionPerformed(ActionEvent e) {
            ctx.setStartScript(true);
            this.setVisible(false);
        }
    
        private void initComponents() {
            label1 = new JLabel();
            textField1 = new JTextField();
            textField2 = new JTextField();
            button1 = new JButton();
    
            //======== this ========
            Container contentPane = getContentPane();
            contentPane.setLayout(null);
    
            //---- label1 ----
            label1.setText("Enter one or two names");
            contentPane.add(label1);
            label1.setBounds(new Rectangle(new Point(65, 15), label1.getPreferredSize()));
            contentPane.add(textField1);
            textField1.setBounds(75, 40, 130, textField1.getPreferredSize().height);
            contentPane.add(textField2);
            textField2.setBounds(75, 70, 130, textField2.getPreferredSize().height);
    
            //---- button1 ----
            button1.setText("Start");
            button1.addActionListener(e -> {
    			button1ActionPerformed(e);
    			button1ActionPerformed(e);
    		});
            contentPane.add(button1);
            button1.setBounds(new Rectangle(new Point(165, 220), button1.getPreferredSize()));
    
            contentPane.setPreferredSize(new Dimension(400, 300));
            pack();
            setLocationRelativeTo(getOwner());
        }
    
        public String getFirstName()
        {
            return textField1.getText();
        }
        public String getSecondName()
        {
            return textField2.getText();
        }
    
        private JLabel label1;
        private JTextField textField1;
        private JTextField textField2;
        private JButton button1;
    }
    
    
    

    And my getter is just

    public void setStartScript(boolean startScript) {
            this.startScript = startScript;
        }
    

    All my other code has worked before and is unchanged, it has script manifest and it won't compile. It's the one seen in the gif.

    Add this to your main class

     

    @Override
    public void onStart()
    {
        defendTheCastleGui gui = new defendTheCastleGui(this);
    }
    
    Edited by Hopewelljnj
    Link to comment
    Share on other sites

     Share

    ×
    ×
    • 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.