CLICommands

lottery

snug lottery <COMMAND>

Lottery operations (weighted random selection).

Subcommands

CommandWhat it does
addAdd or update an item in a lottery table
batch-addAdd many items to a table from a JSON file (array of {item_id, weight, meta})
drawDraw items from a lottery table
adjustAdjust item weight atomically
infoGet lottery table information
listList all lottery tables
delete-itemDelete an item from a lottery table
delete-tableDelete an entire lottery table

Run snug lottery <command> --help for that command's own options. The global options apply everywhere.

Examples

snug lottery add -t loot -i rare_sword -w 10 -m '{"rarity":"legendary"}'
snug lottery add -t loot -i common_potion -w 200
snug lottery info -t loot
snug lottery list
snug lottery draw -t loot -c 5 --unique
snug lottery draw -t loot -c 1 --remove
snug lottery draw -t loot -c 3 --seed 42
snug lottery adjust -t loot -i rare_sword --increment 5
snug lottery adjust -t loot -i rare_sword --increment -5 --min-weight 1 --max-weight 100
snug lottery delete-item -t loot -i rare_sword
snug lottery delete-table -t loot -f

Next

On this page