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
  • Timer Problems


    Dexter Bots

    Recommended Posts

    Hello dear community, I have a small problem. I have been using the timers from Dreambot, etc., to create an artifact, and running the script on the Dreambot client works perfectly. Also, on the graphics where it calculates how long the script has been running and based on that, how many locations have been cut, it is also functioning properly. Now, when I tried to load it on the SDN, it gave me this message, something is wrong with the 1st layer, therefore, the methods containing the timers have also been distorted. Code:

    old Variant:

    import org.dreambot.api.utilities.Timer;

    //..

    is Abstract..

    private Timer timeRun;

    private int logsCut;

        @Override
       
    public void onStart(){
            SwingUtilities.invokeLater(() -> {
               
    gui = new WoodcutterGUI(this);
               
    gui.setVisible(true);

    });
                timeRun = new Timer()
      // on client it works same without this..
        }

    Methods ..

    public void breakTime() { // break time when is logout and resume when is logged in..
           
    if (!Client.isLoggedIn()) {
               
    timeRun.pause();
            }
    else if(Client.isLoggedIn()){
               
    timeRun.resume();
            }
        }

    @Override
       
    public void onPaint(Graphics2D graphics) {
    ....

    int logsPerHour = (int) (logsCut / (timeRun.elapsed() / 3600000.0));
                graphics.drawString(
    "" + timeRun.formatTime(), 111, 19);

    .....

    }
    constructor Timer in class Timer cannot be applied to given types; [javac] timeRun = new Timer(); [javac] ^ [javac] required: int,ActionListener [javac] found: no arguments [javac] reason: actual and formal argument lists differ in length.

    cannot find symbol [javac] timeRun.pause(); [javac] ^ [javac] symbol: method pause() [javac] location: variable timeRun of type Timer

    [javac] symbol: method resume() [javac] location: variable timeRun of type Timer

     

    etc

    and the idea for fix it for SDN?:

    private Timer timeRun;
    public Woodcutter(){ //Updated with another Variant because it was Overriden the oder methods or sow..
        timeRun = new Timer();
    }
    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
    ×
    ×
    • 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.