Skip to content

Subathon script functions

Functions for C# (Cb.Call) and Python (cb.call). See Script functions for how to use them.

subathon.addTime

Adds seconds to a subathon timer, or takes them away with a negative number.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.
seconds How many seconds, like 300.
useMultiplier Optional. true to use the timer's multiplier.

Gives back: The seconds really added (less when the longest length was reached).

var answer = await Cb.Call("subathon.addTime", new { timer = "Subathon", seconds = 300 });
answer = cb.call("subathon.addTime", timer="Subathon", seconds=300)

subathon.get

Gives you a subathon timer: its time left, state and settings.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.

Gives back: An object with id, name, state (Stopped, Running, Paused or Ended), remainingSeconds, elapsedSeconds, addedSeconds, multiplier, initialSeconds, maxSeconds and values, or null when there is no such timer.

var answer = await Cb.Call("subathon.get", new { timer = "Subathon" });
answer = cb.call("subathon.get", timer="Subathon")

subathon.list

Gives you every subathon timer.

Gives back: A list of timers, each like subathon.get gives.

var answer = await Cb.Call("subathon.list");
answer = cb.call("subathon.list")

subathon.pause

Pauses a running subathon timer.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.

Gives back: true.

var answer = await Cb.Call("subathon.pause");
answer = cb.call("subathon.pause")

subathon.reset

Stops a subathon timer and puts back its starting length.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.

Gives back: true.

var answer = await Cb.Call("subathon.reset");
answer = cb.call("subathon.reset")

subathon.resume

Carries on with a paused subathon timer.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.

Gives back: true.

var answer = await Cb.Call("subathon.resume");
answer = cb.call("subathon.resume")

subathon.setMultiplier

Changes how much event time counts, like 2 for happy hour. Time already added does not change.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.
multiplier 2 = double, 1 = normal, 0.5 = half.

Gives back: true.

var answer = await Cb.Call("subathon.setMultiplier", new { multiplier = 2 });
answer = cb.call("subathon.setMultiplier", multiplier=2)

subathon.setTime

Sets how many seconds a subathon timer has left.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.
seconds The time left in seconds.

Gives back: true.

var answer = await Cb.Call("subathon.setTime", new { seconds = 3600 });
answer = cb.call("subathon.setTime", seconds=3600)

subathon.start

Starts a subathon timer, or carries on after a pause.

Value What to put in
timer Optional. The timer's name. Leave it out for the first timer.

Gives back: true. Fails when there is no such timer.

var answer = await Cb.Call("subathon.start", new { timer = "Subathon" });
answer = cb.call("subathon.start", timer="Subathon")