set distance

master
vitrinekast 10 months ago
parent 55bbf32e68
commit a9bf7cadf9

@ -3,7 +3,7 @@ const express = require('express')
const tmi = require('tmi.js'); const tmi = require('tmi.js');
const { init, translate, circle, rectangle, to, label } = require("./hpgl.js"); const { init, translate, circle, rectangle, to, label } = require("./hpgl.js");
const distance = 3; let distance = 3;
const app = express() const app = express()
const client = new tmi.Client({ const client = new tmi.Client({
@ -61,12 +61,18 @@ app.listen(3001, () => {
const parseMessage = (message) => { const parseMessage = (message) => {
message = message.trim();
if (message.toLowerCase().startsWith("lb")) { if (message.toLowerCase().startsWith("lb")) {
var words = message.toLowerCase().replace("lb", ""); var words = message.toLowerCase().replace("lb", "");
toPlotter(label(words)); toPlotter(label(words));
} else if (message.toLowerCase().startsWith("distance")) { } else if (message.toLowerCase().startsWith("distance")) {
console.log("do: ", message);
var value = Number(message.replace("distance ", ""));
console.log("do the value of ", value);
distance = value;
} else { } else {
switch (message.toLowerCase()) { switch (message.toLowerCase()) {
case 'init': case 'init':

Loading…
Cancel
Save