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
  • Help Running a Script Locally


    Constuck
     Share

    Recommended Posts

    So, I've been getting into scripting again after a six month hiatus, and I'm trying to get a test script running just to get myself back in the groove. Unfortunately, I can't get my .jar file to be recognized as a "Local Script" Any ideas what I'm doing wrong or what I'm missing? Could my manifest not be correct?

     

    Here's my source code:

    package testScript;
    
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    
    @ScriptManifest(author = "Constuck", description = "Testing state retrieval code.", category = Category.UTILITY, name = "Test", version = 1.0)
    public class Script extends AbstractScript implements MouseListener{
    
    	public int onLoop() {
    		return 0;
    	}
    
    	public void mouseClicked(MouseEvent e) {
    		
    	}
    
    	public void mouseEntered(MouseEvent e) {
    		
    	}
    
    	public void mouseExited(MouseEvent e) {
    		
    	}
    
    	public void mousePressed(MouseEvent e) {
    		if(getClient().getMenu().getMenuOptions()[0] != null)
    			log("[0] \"" + getClient().getMenu().getMenuOptions()[0] + "\"");
    		if(getClient().getMenu().getMenuOptions()[1] != null)
    			log("[1] \"" + getClient().getMenu().getMenuOptions()[1] + "\"");
    		if(getClient().getMenu().getMenuOptions()[2] != null)
    			log("[2] \"" + getClient().getMenu().getMenuOptions()[2] + "\"");
    		if(getClient().getMenu().getMenuOptions()[3] != null)
    			log("[3] \"" + getClient().getMenu().getMenuOptions()[3] + "\"");
    		log("-----");
    	}
    
    	public void mouseReleased(MouseEvent e) {
    		
    	}
    
    }
    

    Thanks!

     

    Edit: Currently I'm using the DreamBot/Scripts directory as my workspace in Eclipse. Although I believe I did this in the past, I am not totally sure. Could this cause an issue?

    Edited by Constuck
    Link to comment
    Share on other sites

    Yes, I am building a jar. It is in the scripts folder and I have tried refreshing. So far no progress. Tomorrow morning Ill edit this post and add a picture of my export settings.

     

    Edit (Export Settings):

    Fku1snL.png

     

    It is supposed to be a JAR file rather than a Runnable JAR File right?

     

    Edit: I just moved my Eclipse workspace to another folder so that the jar was the only thing in Scripts and the client found it. Curious as to why that was the issue but happy it's resolved.

    Edited by Constuck
    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.