Getting Started - itsdax/DaxTracker GitHub Wiki

Steps

  • Create your Script to track via DaxTracker dashboard
  • You should see your script at the homepage. Click on it to see your personalized dashboard and click Show Secret
    • Important: Your Password is used to log in your dashboard. Do NOT expose that anywhere else!
  • Use your Api Key and Secret to start uploading data (See code example below)
  • You should be able to see your data once you start tracking via your bot! Keep in mind that data is aggregated 5 minutes at a time so there is a delay before it shows up.
package scripts;

import org.tribot.script.Script;
import org.tribot.script.ScriptManifest;
import org.tribot.script.interfaces.Ending;
import scripts.dax.tracker.DaxTracker;

@ScriptManifest(name = "Test Script", authors = {"dax"}, category = "Tools")
public class TestScript extends Script implements Ending {

    private DaxTracker daxTracker;

    public TestScript() {
        daxTracker = new DaxTracker("API-KEY", "SECRET-KEY"); // Your credentials here
    }

    @Override
    public void run() {
        while (true) {
            // your script logic here
            if (stuff) doStuff();

            if (choppedDownTree()) {
                daxTracker.trackData("Log", 1);
                daxTracker.trackData("Woodcutting", 25);
            }

            // you can even track time ran. Use seconds instead of milliseconds since you might hit overflow
            daxTracker.trackData("runtime", 123456L);

            sleep(100);
        }
    }

    @Override
    public void onEnd() {
        // Always make sure to call stop to make sure all stats are uploaded to server before exit
        daxTracker.stop();
    }
}