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
  • DreamBot Script Skeleton


    Vlad
     Share

    Recommended Posts

    Feel free to suggest anything I could add on to this and I'll add it. ^_^

    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.utilities.Timer;
    
    import java.awt.*;
    
    @ScriptManifest(name = "", author = "", description = "", version = 1, category = Category.MISC)
    public class Skeleton extends AbstractScript {
    
    	private Timer t = new Timer();
    
    	@Override
    	public void onStart() {
    
    	}
    
    	@Override
    	public int onLoop() {
    
    		if (!getClient().isLoggedIn()) {
    			return 600;
    		}
    
    		return Calculations.random(300, 600);
    	}
    
    	@Override
    	public void onExit() {
    
    	}
    
    	public void onPaint(Graphics2D g) {
    		g.setColor(Color.WHITE);
    		g.setFont(new Font("Arial", 1, 11));
    		g.drawString("Time Running: " + t.formatTime(), 25, 50);
    	}
    }
    
    Edited by Vlad
    Link to comment
    Share on other sites

    According to the docs formatTime is static.

    public static java.lang.String formatTime(long timeMilliseconds)

     

    You are right, it's fixed now. I made this before I had access to the docs. :P

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     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.