// WRITERS (Duplex to support reading if chained) // write notes to REPL get toRepl() { return track( new Duplex({ objectMode: true, // drops hwm to 16 read() {}, write(chunk, encoding, callback) { const note = chunk.input.replace(/^(.)\#/,'$1s') // use typeString over stdout as the latter won't allow the user // to delete as though they entered the text themselves robot.typeString(`${note}, `) callback(null, chunk) this.push(chunk) } }) ) }
var vm_loc = robot.getMousePos(); vm_loc.x += settings.cursol_speed / 100 * Math.sign(x_moment) * Math.pow(x_moment / 0.18, 2); vm_loc.y += settings.cursol_speed / 100 * Math.sign(y_moment) * Math.pow(y_moment / 0.12, 2); vm_loc.x = vm_loc.x > screen_size.x ? screen_size.x - 5 : (vm_loc.x < 0 ? 5 : vm_loc.x); vm_loc.y = vm_loc.y > screen_size.y ? screen_size.y - 5 : (vm_loc.y < 0 ? 5 : vm_loc.y); if(cursol_toggle == 0){ robot.moveMouse(vm_loc.x, vm_loc.y); } else { robot.dragMouse(vm_loc.x, vm_loc.y); robot.mouseToggle("down") },400); cursol_toggle = 1; } else { robot.mouseToggle("up"); cursol_toggle = 0; robot.mouseClick(button = "right"); } else if (data.blinkSpeed >= settings.click_th){ robot.mouseClick(); robot.scrollMouse(0, Math.sign(tilt_moment) * Math.pow((Math.abs(tilt_moment) - 0.1)/ 0.02, 2));