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


    raptor

    Recommended Posts

    Posted

    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?

    Posted

    you can use dreambot Timer and setRunTime

    Posted

    they are supported if they are open source and you include it as source afaik

    Posted

    If you include a library and you're only using a tiny part of it, only put that part in.

     

    Large libraries are not allowed, and you can't include .jars.

    Posted

    Thanks all. @Diddy, thanks for pointing out that class. Unfortunately the documentation for it is non-existent :(

    Posted

    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

    Posted

    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.

    Posted

    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

    Posted

     

    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

    Posted
    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

    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.