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
  • Scripts aren't appearing FIX


    Defiled

    Recommended Posts

    Hello Everyone,

    I've been contacted by several newbie scripters complaining about after they add their first script in, all scripts disappear from the Script Manager.

    I'll be listing 2 probable causes and their fixes! So let's get on with it!

     

    First Probable Cause: ScriptManifest isn't added to the main class.

    How to Diagnose:

    1) Open your Script Main Class (The File that contains the OnLoop method)

    2) Look above class declaration

    public class MainClassName extends AbstractScript

    3) Do you see the following or something similar?

    @ScriptManifest(author = "Scripter_Name", category = Category.CATEGORY_ENUM, name = "Script_Name", description = "Brief_Script_Description", version = 1.0)

     

    If the answer is YES, then proceed to the next probable cause otherwise keep reading the following:

    Add the ScriptManifest line above the main class declaration as shown below:

    @ScriptManifest(author = "Scripter_Name", category = Category.CATEGORY_ENUM, name = "Script_Name", description = "Brief_Script_Description", image = "image path", version = 1.0) 
    //ADD THIS ^
    public class Main extends AbstractScript {

     

    A short explanation of the fields:

    author = Put your name there
    
    category = Dreambot has several category that your script type can fall in, ex: FISHING would be Category.FISHING
    
    name = Put your script's name here
    
    description = [OPTIONAL] add a brief description here (Will appear in the script manager)
    
    version = Put the version number of your script here.. default: 1.0
    
    image = Put your script icon/image path. Thanks @Infidel

     

    Second Probable Cause: SDK/JDK isn't set to 8 in the IDE

    Even though you do have JRE 8 installed and used on your computer, you may have selected the wrong JDK Compiler Version when first creating your project and/or you don't have JDK 8.

    How to Diagnose?

    IntelliJ

    Step 1:

     RmpMYZN.png

    - Open Project Structure by clicking the button with "1" written under it in the picture.

    - Click Project on the sidebar

    - Does the SDK say "1.8"? If not, change it to 1.8 and click apply. 

    If SDK 1.8 doesn't appear in the dropdown,carry on to the next step:

     

    Step 2:

    Click "New..." and go to the JDK 1.8 Folder located in either "Program Files" or "Program Files (x86)" and click save.

    If there is no JDK 1.8 in your system, download it here then restart IntelliJ.

    This link might be of further use to you: https://www.jetbrains.com/help/idea/sdk.html

     

    Eclipse

     

    How to Diagnose?

    Step 1: Check what JDK is currently enabled:

    P0tcw.png

    Open the Project Properties by right clicking the project and clicking Properties/Project Configuration

    Click Java Build Path on the side-bar

    If it doesn't say JavaSE-1.8 then carry on to the next step:

     

    Step 2: Change the JDK Enabled version:

    Click on the Add Library button. It brings your screen to point to the Java location.

    Select "Directory", button right besides JRE home and point to the installed folder location.

     

    This link may be useful to eclipse users: https://www.eclipse.org/documentation/

     

    and that's it! I hope this helped you in someway or the other!

     

    Link to comment
    Share on other sites

    6 hours ago, Infidel said:

    Upvoted because good guide and Eclipse > Intellij.

    Extra param for SM, that I might be the only one that uses (Doesn't pop on SDN, but personal / private scripts = A++)

    
    image = "imagesite.com/yourimage.png"

    j0lHODa.png

    Thank you for your contribution! I will add it to the thread.

    Everyone uses the IDE they're comfortable with, for an example I use both of them.. eclipse is really awesome with swift guis cuz of the windowbuilder.. and intellijs auto complete is a lot better than eclipse.

    Link to comment
    Share on other sites

    • 3 weeks later...
    • 4 months later...

    Hello,

    Your guide helped more that other guides but I'm still having issues. The local scripts still won't load. I changed to JDK to 1.8 and it still won't work. I've tried every thread here and can't find a solution. If you (or anyone else who reads this) can help me figure out the issue I will gladly PayPal you. Please PM me. 

     

    There are no error messages. No other scripts in scripts folders. I uninstalled and reinstalled Java 8 twice. I tried different code. I deleted Dreambot and all subfolders and redownloaded it twice as well. 

    I don't know if this is related or not but I am also having issues launching Dream Bot through DBLauncher. It only loads through Clint.jar on my Mac. I've purchased a VPS and set it up and I've been able to run multiple bots there, but now I am trying to get into scripting and I'm using my Mac which I'm still getting use to. I'm fluent with windows and Linux and I don't see what having a Mac would do to cause these issues. I haven't had any issues launching dreambot through DBLauncher on Windows or Linux. I know people can script using Mac because I've seen tutorials. 

     

    I really don't want to write all my code on my VPS, I'd much rather use my Mac. 

     

    I really don't know what I am doing wrong. 

    Here is the pictures of the export: 

    1678589623_ScreenShot2020-06-10at11_16_49AM.thumb.png.1528947a2457110db247fc7900e2a6a5.png

     

    This is the source code: 

    import org.dreambot.api.methods.Calculations;

    import org.dreambot.api.script.AbstractScript;

    import org.dreambot.api.script.ScriptManifest;

    import org.dreambot.api.script.Category;

    import org.dreambot.api.wrappers.interactive.GameObject;

     

    @ScriptManifest(author = "You", category = Category.THIEVING, name ="Thieve", version = 1.0)

    public class main extends AbstractScript {

     

    public void onStart() {

    log("Welcome to Simple Tea Thiever by Apaec.");

    log("If you experience any issues while running this script please report them to me on the forums.");

    log("Enjoy the script, gain some thieving levels!.");

    }

     

    private enum State {

    STEAL, DROP, WAIT

    };

     

    private State getState() {

    GameObject stall = getGameObjects().closest("Tea stall");

    if (!getInventory().isEmpty())

    return State.DROP;

    if (stall != null)

    return State.STEAL;

    return State.WAIT;

    }

     

    public void onExit() {

     

    }

     

    @Override

    public int onLoop() {

    switch (getState()) {

    case STEAL:

    GameObject stall = getGameObjects().closest("Tea stall");

    if (stall != null) {

    stall.interact("Steal-from");

    }

    break;

    case DROP:

    getInventory().drop("Cup of tea");

    break;

    case WAIT:

    sleep(Calculations.random(500, 600));

    break;

    }

    return Calculations.random(500, 600);

    }

    }

    Screen Shot 2020-06-10 at 11.16.49 AM.png

    Link to comment
    Share on other sites

    Check the Builder/Compiler version in Eclipse, try to load it in IntelliJ and build it there. Make sure you're using JDK 1.8 

    Uninstall JDK/JRE and install a new one, sometimes JDK installations can be corrupt.

    Link to comment
    Share on other sites

    On 6/10/2020 at 2:01 PM, Defiled said:

    Check the Builder/Compiler version in Eclipse, try to load it in IntelliJ and build it there. Make sure you're using JDK 1.8 

    Uninstall JDK/JRE and install a new one, sometimes JDK installations can be corrupt.

    I haven’t tried using IntelliJ but I’ve tried the 1.8. I tried installing and uninstalling. If you don’t mind can we maybe do a team viewer or something because its really frustrating 

    Link to comment
    Share on other sites

    Archived

    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.