Skip to content
Dashboard, statistics, web services.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/runemate
README.md

README.md

OCCode

Dashboard, statistics, web services.

The examples in this repository produce the following result (Extended view that the user sees).

Screenshot

Dashboard preview

Methods

[Useful] Notifications

void sendNotification(String title, String message, Notification type)

Argument Description
String title Title of the notification. Keep it short and simple.
Eg: Level up!
String message Message of the notification. Make it simple.
Eg: Magic level is now 99!
Notification type Notification type. One of: [Success, Warning, Error, Information].

Preview: Notification example

Custom Action

Note: Should be called in setup.

void addCustomAction(String name, String buttonText, Consumer<String> selectedAction)

Argument Description
String name Action name to be displayed in dashboard.
String buttonText Text display on the button under "Options" on dashboard.
Consumer<String> In this case (no options), the argument passed to the consumer will be an empty string.
addCustomAction("Break", "Start") { 
   println("Break has started.")
   startBreak()
}

void addCustomAction(String name, String buttonText, List<String> actions, Consumer<String> selectedAction)

Argument Description
String name Action name to be displayed in dashboard.
String buttonText Text to be displayed on a button.
Recommended: "Select", "Choose"...
List<String> options Possible options / actions for the user to choose from. [Combobox]
Consumer<String> In this case (no options), the argument passed to the consumer will be an empty string.
addCustomAction("Food", "Select", listOf("Lobster", "Salmon", "Orange")) { 
   currentFood = it
   println("User selected $it to be used as current food.")
}

Status

Note: Should be called in update. void setStatus(String status)

Argument Description
String status Status to be displayed on users' view.

Login username

Note: Should be called in update. void setLoginUsername(String username)

Argument Description
String loginUsername Username / Alias that will tell the user which account is being used.
Recommended: Environment.getAccountAlias();

Custom metrics

Note: Should be called in update. void setCustomMetric(String metricName, Object metricValue)

Argument Description
String metricName Name of the metric.
Eg: "Health", "Experience", "Experience p/h"...
Object metricValue Value of the custom metric. If it's a number, graphs will be generated and analytics performed.

Setup

Note: Should be called in script's onStart. void setup(Runnable runnable)

Argument Description
Runnable runnable Runnable in which you set the custom actions and update method.

Update

Note: Should be called in setup. void update(Runnable runnable)

Argument Description
Runnable runnable Runnable in which you set the custom metrics status and login username.

[Optional] When to stop

Note: Should be called in setup. void setWhenToStop(Supplier<Boolean> supplier)

Argument Description
Supplier<Boolean> Condition when the bot should stop.
Eg: Out of food.

[Reccomended] Is safe to stop

Note: Should be called in setup.

void setIsSafeToStop(Supplier<Boolean> supplier)

Argument Description
Supplier<Boolean> Condition when the bot is safe to stop.
Eg: When not in combat.
You can’t perform that action at this time.