pr-client-xt

1.0.0 • Public • Published

pr-client-xt

pr-client-xt is a custom made client used to connect to https://www.pianorhythm.me/

Installation

npm install pr-client-xt

Usage

const PRClient = require("pr-client-xt");

var options = {
    uri: "www.pianorhythm.me",
    path: "/socketcluster/",
    userColor: "#7d9cf5",
    multiplex: true,
    secure: true,
    username: "Username",
    password: "Password" // Leave blank if you want to login as a guest
};

var client = new PRClient(options);

client.setChannel("Foobar");
client.setName("Fookat"); // You must do these first before starting the client
client.start();

client.on("hi", () => {
  console.log("Connected.");
});

Playing and stopping notes

client.startNote("note", "velocity");

client.stopNote("note");

Moving the cursor

let data = {
  mX: 50, 
  mY: 50, 
  id: "client id", 
  socketID: "socket id", 
  type: "pos"
}

client.moveMouse(data);

Recieving chat messages

client.on("msg", function(msg) {
  // Message content and format
  let author = msg.p;
  let name = author.name;
  let id = author.id;
  let nickname = author.nickname;
  let socketID = author.sID;

  let content = msg.a.;
})

Sening chat messages

client.say("Foo Test");

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i pr-client-xt

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

9.11 kB

Total Files

3

Last publish

Collaborators

  • vbupcni