New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gambling-system

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gambling-system

Create a gambling system using JSON easily.

latest
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

###gambling-system@2.0.1

Requirements :

  • fs
  • A JSON file. (In this case is named coins.json)

So you take an idea, This is mostly thinked to be used with WebSockets unique IDs or **Discord users IDs. To create each profile you need an ID, or a name to organize.

'ID': {coins: 100, bank: 100}

Commands :

CommandsUse
Gambling.create(ID_or_name, defaultCoins, defaultBank);Creates a profile with an ID of ID_or_name, and with default defaultCoins, and defaultBank
Gambling.add(ID_or_name, coinsToAdd);Adds coinsToAdd to the ID_or_name profile.
Gambling.remove(ID_or_name, coinsToRemove);Removes coinsToRemove to the ID_or_name profile.
Gambling.withdraw('force or verify', ID_or_name);Removes coinsToWithdraw from ID_or_name profile's bank and add them to the default 'Wallet'.
_PD : For first argument you need to put 'force' or 'verify'. Force will change the value without checking, and verify will check the user has the coins to withdraw.

To intialze gambling-system first write this code at the top of your main file.

let QuickGambling = require('gambling-system');
const Gambling = new QuickGambling.system.currency('./coins.json');

To create a profile with an ID or name you need to use write this :

// Guide :
    Gambling.create(ID_or_name, defaultCoins, defaultBank); 

// In use :
    Gambling.create(socket.id, 50, 0); 
  • ID_or_name :
    • You can plug in a name or a unique number.
  • defaultCoins :
    • You can plug in the amount of coins the user will have when the profile is created.
  • defaultBank :
    • You can plug in the amount of coins the user will on his bank when the profile is created.
  • coinsToAdd :
    • You can plug in the amount of coins will be added to a ID_or_name's profile.
  • coinsToRemove :
    • You can plug in the amount of coins will be removed from ID_or_name's profile.

Keywords

gambling

FAQs

Package last updated on 04 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts