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
  • Are 3rd party libraries supported? (Google Guava/Apache Commons)


    raptor
     Share

    Recommended Posts

    Title. I need a stopwatch and don't want to roll my own.

     

    Does Dreambot ship with any of these common libs, or is there a way to ship a script with these dependencies?

    Link to comment
    Share on other sites

    setRunTime sets time until done. finished() returns whether it's done. remaining() returns how much time is left. Pretty self explanatory if you ask me :P

     

    By stop watch do you mean something that activates at a certain time or something that counts up. The dreambot timer is very good for counting up. If you need something that runs after a certain time just use the Java Timer with .schedule and create a TimerTask

    Edited by Hopewelljnj
    Link to comment
    Share on other sites

    setRunTime sets time until done. finished() returns whether it's done. remaining() returns how much time is left. Pretty self explanatory if you ask me :P

     

    By stop watch do you mean something that activates at a certain time or something that counts up. The dreambot timer is very good for counting up. If you need something that runs after a certain time just use the Java Timer with .schedule and create a TimerTask

    Sure it's possible to figure out what the methods do based on their names, but the lack of documentation is still very frequently annoying. For example, how would I use the timer to count up? It's possible to figure it out of course, but that might be something a well-documented API would address.

     

    I ended up going with the Google Guava Stopwatch which addressed my needs.

    Link to comment
    Share on other sites

    Sure it's possible to figure out what the methods do based on their names, but the lack of documentation is still very frequently annoying. For example, how would I use the timer to count up? It's possible to figure it out of course, but that might be something a well-documented API would address.

     

    I ended up going with the Google Guava Stopwatch which addressed my needs.

    .elapsed() ?? anyhow there is actually a large project to add to the documentation for db3 which our devs are very busy with at the moment. I think it will be better at that point in time. They aren't spending time updating these docs as many are going to change with the new Dreambot

    Link to comment
    Share on other sites

     

    in onStart
     
    long started = System.currentTimeMillis();
     
     
     
    in onPaint
     
    drawString("Runtime: " + (System.currentTimeMillis() - started) / 1000, 25, 25);
     
    

     

    there isnt always a need to create a class to do something

    Link to comment
    Share on other sites

    in onStart
     
    long started = System.currentTimeMillis();
     
     
     
    in onPaint
     
    drawString("Runtime: " + (System.currentTimeMillis() - started) / 1000, 25, 25);
     
    

    there isnt always a need to create a class to do something

     

     

    Help pls code doesn't compile

    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.