JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q37703F
  • License MIT

Tools for helping run the Games in a Snap event on twitch.tv

Package Exports

  • cias

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cias) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cias

npm install cias

//Required Dependencies

npm install mysql
npm install tmi.js
npm install polyphony.js
npm install obs-websocket-js

This library is meant to act as an extension to polyphony.js to allow for the smooth management and performance of the weekly city-building competition, Cities in a Snap and other E-Sport events.

BEFORE YOU BEGIN

Make a MySQL database table with at least two columns, number and name to correspond to the four participant spots. This will be more flexible in the future, but for now this is how it is.

Then run the twitchCPR.list function (details below) to get your individual reward IDs.

Implementation

Includes

const tmi = require('tmi.js'); // Recommended for chat functionality, though not strictly necessary to function.
const mysql = require(`mysql`);
const config = require('./config'); // Great to store variables safely

Building the Config

    const ciasOPTS = {
        OBSaddress: config.default.obs_address, //Your Host Computer's IP address and websocket port no. (4444 by default)
        OBSpassword: config.default.obs_pass, // Your OBS websocket password (If it exists!)
        MYSQLhost: config.mysql.host, // The location of your database (either localhost, or an IP address if a different server location)
        MYSQLuser: config.mysql.user, // MySQL Username
        MYSQLpassword: config.mysql.password, // MySQL Password
        MYSQLdatabase: config.mysql.database, // MySQL Database Name
        MYSQLtable: `CiaS_Participants` // Participants table name within your database
    }

USE

Announcements

Announces the input text to all participants in an event.

cias.announce(client, msg, context, channel, ciasOPTS);

Participants

Calls and Alters the Participant Database.

cias.participants(client, params, context, channel, ciasOPTS);

Ten Seconds Remaining

Calls and Alters the Participant Database.

cias.tenseconds(client, ciasOPTS);

Starting Timer (30 seconds)

Calls and Alters the Participant Database.

cias.starting(client, ciasOPTS);

Developed by Cazgem (https://twitch.tv/cazgem) for use as part of cities in a snap (https://twitch.tv/citiesinasnap) as well as for his chatbot, Polyphony.