• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.
Resource icon

TS3 SConomy NG - Simple Currency System 1.8.2

No permission to download
Required SinusBot Version
0.13.0
Compatible Backends
  1. TeamSpeak 3
A very simple currency system based on the time spent on the server (v1.8.x).

[1.0 alpha] Sinusbot seems to crash on the 1.0 alpha version, be sure to have at least the beta1 if you have any problems.

Features (with a lot of options):
- Set an amount of money to deliver to connected client every X seconds / minutes
- Ignore channels (such as AFK)
- Commands
- Customizable commands and messages
- Admin groups can manage wallets (for gifts or sanctions)
- Per group / channel advantages (more money every tick and / or smaller tick as usual) => which are cumulative (tick duration has a -90% lower limit)
- Set servergroup for sales with your own price (or charge for the removal of servergroups, like for jail groups)
- Set soldable servergroups in limited quantity
- Limit the servergroup number that a user can have (global or servergroups for sale)
- Make some servergroups increase the user maximum group number limit (like VIP gives 2 more servergroup slots)
- Limit the user wallet maximum amount (no more currency is generated after that limit is reached)
- Channel description with the store buy / sell history
- Possible integration with other scripts (see below)

Default command list:
* !schelp
=> Display the help​
* !money
=> Display own money​
* !store
=> Display the servergroups available for sale​
* !buy <servergroup ID displayed in !store>
=> Buy a servergroup (if available in store and enough money)​
* !sell <servergroup ID displayed in !store>
=> Sell a servergroup (that is in the !store - can be disabled)​
* !give <client URL, UID or nicknames>
=> Give money to another user (with fees / to connected only - configurable in settings)​
* !see <client URL, UID or nicknames>
=> Admin ONLY: view user wallet​
* !set <client URL, UID or nicknames> <new amount>
=> Admin ONLY: set user wallet amount​
* !addmoney <client URL, UID or nicknames> <amount>
=> Admin ONLY: add the amount to the user wallet​
* !removemoney <client URL, UID or nicknames> <amount>
=> Admin ONLY: remove the amount from the user wallet​
* !addconnectedmoney <amount> <(Give to AFK too, default: false) false|true>
=> Admin ONLY: add the amount to all connected users​
* !addchannelmoney <amount> <(optionnal, default: current) channel name>
=> Admin ONLY: add the amount to all the users within the channel​
* !setallmoney <new amount>
=> Admin ONLY: set all users wallet amount at the same time​
* !setquantity <group ID> <amount>
=> Admin ONLY: set an item quantity in the store (if you wan to reset the count)
* !sconomy-data-migration-tool
=> [Only hardcoded command] Admin ONLY: migrate data from one provider to another (private / public), see below​

Note: the '<' and '>' symbols are here to show a variable, don't use them in commands.

Storage provider
There is currently two provider: private (default) and public.

=> Private: only the Sconomy NG script is allowed to modify the data
=> Public: all the scripts can modify the data (wallet amount and / or progress)
Both of them are shared between instances.

To migrate the wallets (and progress) from one to another, use the following command:
!sconomy-data-migration-tool

It is hardcoded, long and kind of hard to remember for a reason: it overrides the data!
If you copy the data from the public to the private storage, all wallets that was on both sides will be overridden on the private side (the value the wallet has on the public storage will be the new value of the wallet of the private storage).
The command has a safeguard and will ask you to type it twice before performing the operation.
Use this command with care!

Parameters of the command (f.e. !sconomy-data-migration-tool private_public)
* private_public => Copy data from private to public storage
* public_private => Copy data from public to private storage
* unset_private => Clean all data from private storage
* unset_public => Clean sconomy data from public storage

Don't forget to change in the settings which storage provider you want to use after a migration!

Script integration (create your own script based on sconomy)
You won't learn how to create a script here, sorry. But I can show you how to integrate your script with SConomy NG!

This will be super easy, I promise!
There is two values you have access to: sconomy and progress.
=> sconomy: this is float representing the wallet amount
=> progress: this is an integer that represents the current user progress (less interesting, recommended not to use)

Once the admin managing the sinusbot configured SConomy NG to use the public provider (cf. Provider section), you can use the following methods:
- require('store').getGlobal(key)
- require('store').setGlobal(key, value)

The key is forged as follows: userUID+'sconomy' or userUID+'progress'. For example, the wallet amount key could be: OfkwDXL8tHv91ZL8zPzoZPowuBu=sconomy

Based on that, you can simply create an add-to-client-wallet function like that:
JavaScript:
var store = require('store');

...

function addCoinsToUser(client, coinNumber)
{
    // Get the key
    var key = client.uid() + 'sconomy';

    // Load the wallet amount
    // https://sinusbot.github.io/scripting-docs/#storegetglobal
    var oldValue = store.getGlobal(key);

    // Do some checks if needed
    ...

    // Set ne new value
    // https://sinusbot.github.io/scripting-docs/#storesetglobal
    store.setGlobal(key, oldValue + coinNumber);
}


You can also get the configuration from Sconomy NG in case you'd like to use it without re-creating a full configuration. This also implies that the user don't have to fill twice the configuration panel.
Sconomy NG uses the export function (documentation) to provide the function getConfiguration that returns the full configuration object used.
JavaScript:
event.on('load', function()
{
    var sconomyNG = require('sconomy-ng.js');

    if (!sconomyNG)
    {
        engine.log('SConomy NG not found');
    }
    else
    {
        config = sconomyNG.getConfiguration();
    }
}

If you create a script that integrates SCnonomy NG, don't hesitate to ping me, I'll put a link in this post :)

Needed permissions:
i_client_private_textmessage_power (for communication)
i_group_member_add_power (for bought servergroups)
i_group_member_remove_power (for refund of servergroups)
i_client_permission_modify_power (for bought / refund of servergroups)
b_channel_modify_description (for store history)

Installation note: place the script into sinusbot script folder and restart the bot. After that, you can configure it like every script (in the web interface).

Update instructions:
Look at the changelog in the Update tab (link). Each update contains the instructions to be done (if any) to upgade to that version.
If you upgrade, please do all actions from updates that was published before the target one and after the current one.
When new settings are added: please fill them or default ones will be used.

If you wrote a script that uses SConomy NG, please let me know, I'll add it here :)

- Wheel of Fortune
- Upgrade store
- Auction
- Store Extension

Warning: this uses the store API and money is therefor shared between instances.

Inspired by the outdated sconomy: https://forum.sinusbot.com/resources/sconomy-simple-currency-system.138/
Author
Mmoi
Downloads
346
Views
3,654
First release
Last update
Rating
4.92 star(s) 12 ratings

More resources from Mmoi

Latest updates

  1. Give command fix

    - Fix the broken give command
  2. Hotfix

    Fixed: sell command was bugged since 1.8
  3. Admin command added

    Added: !addconnectedmoney command Added: !addchannelmoney command Added: configuration can be...

Latest reviews

Work! Thanks!
Can you update it to 1.0 🤗
M
Mmoi
It already works on 1.0 (at least, with the beta 1 and above)
Could you add !addallmoney to the plugin? :D
M
Mmoi
What for, I'm curious?
And do you mean all connected or all users that have a wallet?
Don't hesitate to PM me, or reply to the script discussion.
Top Plugin.
!setallmoney seems not to work with any number
M
Mmoi
I PMed you to see what's going on.
You were thinking about adding the top15 SC channel?
M
Mmoi
What do you mean by that?
Great stuff!
can you add a command that adds coins to everyone in the same room as the bot?
M
Mmoi
What is the goal here?
Nice, I see you made an auction plugin too with the text message option for paysafecards for example. Would be really cool, if you would implement the option for text message (instead of server group) for the normal Sconomy Plugin too.

So I could just add 1x Text Message with first Paysafecard Code (limited for only 1 purchase)
2nd Text Message with second Paysafecard code (limited for only 1 purchase)
and so on. :D
Thanks a lot! Can u add a feature to list top 5 or top 10 richest users on server in channel description or by command?
M
Mmoi
It is not planned yet
Can u add a feature to multiplie boost gain money if someone is on specific channel?
M
Mmoi
It's already in the 1.6 update (that comes out very soon)
Top