[pwn] Get Top X Leaderboard

Description

This extension provides a way to display a leaderboard using any numeric user variables or user counters from a Twitch Reward. It will also provide arguments for displaying the same list in OBS and other things. This leaderboard will also work with multiple platforms, so if someone from YouTube uses the command it will pull the user variables from YouTube users and create a leaderboard. Meaning the leaderboards are separated by platform.
After importing you can just duplicate the action and define another user variable and command to make multiple leaderboards.

For Twitch Reward Leaderboard Streamer.bot 0.2.5 is required.

Import File

[pwn]_Leaderboard_Get_Top_X_1_0_6_by_pwnyy.sb (15.9 KB)

Installation

In Streamer.bot click the Import button in the top menu. Drag the .sb file into the Import String field. The import will include one action and one command.

Initial Step

Since the import includes a command you will have to enable the command by going to the Commands tab and then searching for the [Leaderboard] Get Top X command, right-clicking it, and selecting “Enable”. If you don’t need the command and want to create your own you can also just delete it.

Configuration

To be fair, I might have overdone it with the amount of configurations one can have in this extension for just a leaderboard, but most, well hopefully all settings have a use-case. The configurations are done via Set Argument sub-actions. Please make sure you only change the value and not the Variable name.

General Settings

Argument Name Value Description
userVarOrRewardId string/text Set the user variable name or reward id you want to make a leaderboard of
isRewardId True/False Whether or not the userVarOrRewardId is a Twitch reward id or not
isPersisted True/False Whether or not the the leaderboard should check the persisted uservar/user counters or not
defaultTop long/number Set the default amounf of leadboard users shown. Non-decimal number
orderByDescending True/False Whether the leaderboard is shown in a value descending order or not
ignoredGroups string/text Which user groups should be excluded from the leaderboard. Separate them by comma. Example: Bots, NotWorthyGroup

Additional Settings

Settings Table
Argument Name Value Description
includeBroadcasterLeaderboard True/False Whether or not broadcaster is included in the leaderboard
broadcasterUsage True/False Wheter or not the broadcaster can use the command
orderByDescending True/False Whether the leaderboard is shown in a value descending order or not
populateRedeemerVariables True/False Whether or not to populate redeemer variables, can decrease response time
rankFormat string/text Format how the user ranking should be shown rankPosition rankUser rankValue. Default: %rankPosition% - %rankUser% (%rankValue%)
valueDivider numeric Value by which the end value, shown in the leaderboard, will be divided by
valueFormat string/text Format of value - Possible formats here only choose ones that are compatible with decimal type. Default: F0

Command Input Settings

Settings Table
Argument Name Value Description
ignoreCommandInput True/False Whether or not the input a user gives matters. If True then the defaultTop will be used
minInput long/number The minimum a user input should be. Non-decimal number
maxInput long/number The maximum a user input should be. Non-decimal number

Time Settings

These are settings only meant if your user variable are supposed to be showing something like watchtime, so the value of the user variable needs to be in seconds.

Settings Table
Argument Name Value Description
isTimeInSeconds True/False Whether or not the value is time in seconds and should be formatted
shortFormTime True/False Whether or not the short form format should be used. Example: 1h 1m 2s
showSeconds True/False If seconds should be displayed or not

Language Settings
Set your language for years, months, hours, minutes and seconds.
First the singular version and then the plural version as shown in the example, so separated by a comma.

Argument Name Value Description
secondsLang string/text second,seconds
minutesLang string/text minute,minutes
hoursLang string/text hour,hours
daysLang string/text day,days
monthsLang string/text month,months
yearsLang string/text year,years

Arguments Generated

Most of these can be used in the Message Outputs

Argument List
Argument Name Value Description
rankList string/text List of users in the rankFormat you defined
rankListObs string/text List of users in the rankFormat for OBS, so every new user is it’s own line
rankDictionary Dictionary For use in C# Dictionary<string,(string,string,string)> Key = userId, Value = Displayname, LoginName and Value
topNumber long/number The number of leaderboard users that are shown
Redeemer Variables only if populateRedeemerVariable = True
lbRedeemer string/text Display name of redeemer
lbRedeemerLogin string/text Login name of redeemer
lbRedeemerId string/text User id of redeemer
lbRedeemerRank long/number Rank of redeemer. If redeemer does not have user variable, will be last overall place.
lbRedeemerValue string/text The value of the users rank
Single Users of Leaderboard # is user rank start at 1
lbUserRank# long/number Rank of current user
lbUser# string/text Display name of user
lbUserLogin# string/text Login name of user
lbUserId# string/text User id of user
lbUserValue# string/text Value of user

Message Outputs

Due to multiple platform support and also cause leaderboard can sometimes be a bit more lengthy you will have to define your message in arguments. They will then get send to the correct platform and also get split up.

Argument Name Value Description
noUsersMessage string/text Message which will be output if there are currently no users in the leaderboard
defaultMessage string/text Message output when users are in the leaderboard
wrongInputMessage string/text Message which will be output when the input is an incorrect value

Command

Make sure if you want your leaderboard to be usable by multiple platforms that in your command settings you also check the Sources for Twitch/YouTube/Trovo message.

Testing Phase Log

Version 1

  • Initial Version. Technically there have already been several version but we’ll call it v1 for now.

Version 2 (1.0.5)

  • Adding rankDictionary for C# usage

Version 3 (1.0.6) - 2024.11.20

  • Add support for Reward User Counter
  • Add support for YouTube multibroadcast send message
2 Likes

I have had no issues running this extension. Ran with 0.2.3, the 0.2.4 betas up to, and now include 0.2.4 stable. I have tested it with, my own xp, gold and level system. The (core) points system, the StreamUp Currency system and a watchtime system. All returns the values and in the chosen output Top 3/5. Platform: Twitch.