This guide creates an event where many JOIs contribute points toward one goal. Different Items and Boops can participate because the App holds the event variables and status embed.
1. Create the App variables
Open the App’s Main editor and declare all four variables together:
app var $eventProgress = 0;
app var $eventGoal = 10000;
player var $personalContribution = 0;
app const $eventPercent = clamp(($eventProgress / $eventGoal) * 100, 0, 100);
2. Add a reusable status embed
Add this declaration to the App’s Main module:
embed eventStatus -> "Community Event" {
description: format("{$eventProgress} of {$eventGoal} points collected"),
fields: (
format("{}%", round($eventPercent)) -> "Complete" with progress => $eventPercent,
$personalContribution -> "Your contribution",
),
}
3. Link a contribution Boop
Link a Boop to the App, then put its input and text together in the Boop’s Code module:
var points = 1 with {
input: true,
required: true,
min: 1,
max: 100,
};
text {
let accepted = min(points, $eventGoal - $eventProgress);
accepted = max(0, accepted);
$eventProgress += accepted;
$personalContribution += accepted;
show chip format("+{accepted} event points");
show embed eventStatus;
"@1 contributed to the community event!"
}
The App-wide total changes for everyone. The Player contribution changes only for the JOI using the Boop.
4. Link other creations
Any linked Item or Boop can use the same $eventProgress, $personalContribution, App media, and eventStatus template.
One Item might contribute points through a daily action. Another Boop might show the current total without changing it:
text {
show embed eventStatus;
"@1 checks the event progress."
}
5. Add an Automation
Put both reset declarations in the App’s Automations editor. A Player Automation resets each JOI’s contribution, while an App Automation resets the one global total:
player automation resetPersonalContribution {
config {
schedule: weekly("monday", "00:00"),
}
reset($personalContribution);
}
app automation resetEventProgress {
config {
schedule: weekly("monday", "00:00"),
}
reset($eventProgress);
}
These need two Automations because a Player Automation changes each JOI’s values in the Player scope, while an App Automation changes values in the App scope.
6. Test the system
Sandbox Mode can preview an individual contribution, but it does not save App variable changes. Use it to verify the calculation and output before testing a real linked creation.
If this event will award Lore, Lore::earn() requires the App to be verified by JOI and still respects each account’s rolling daily reward limit.