From 9c2e2e1f9ade7ca549094c82b7c6930f934d74a7 Mon Sep 17 00:00:00 2001 From: Elijah R Date: Sun, 23 Jun 2024 21:39:16 -0400 Subject: [PATCH] make personal floppies writable, add success message to myfloppy --- src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index e49d773..d361c61 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,9 +194,11 @@ class HelperBot extends CollabVMClient { else this.QemuChangeDevice("vm.cd", source, opts); } - QemuChangeFloppy(source: string) { + QemuChangeFloppy(source: string, readOnly: boolean = true) { + let opts = "raw"; + if (readOnly) opts += " read-only"; if (this._hasFloppy) - this.QemuChangeDevice("vm.floppy", source, "raw read-only"); + this.QemuChangeDevice("vm.floppy", source, opts); } OnChat(username: string, message: string) { @@ -538,7 +540,8 @@ class HelperBot extends CollabVMClient { if (!fs.existsSync(flppath)) { fs.writeFileSync(flppath, blankflp); } - this.QemuChangeFloppy(flppath); + this.QemuChangeFloppy(flppath, false); + this.Chat("Tried to put media into specified device."); break; } default: