···11+import { bloxstraprpc } from "../lib/Constants";
22+import * as fs from "fs";
33+import * as path from "path";
44+55+const loggedIdsFile = path.resolve(process.env.HOME || "~", ".tuxstrap_logged_ids");
66+77+// Ensure the file exists
88+if (!fs.existsSync(loggedIdsFile)) {
99+ fs.writeFileSync(loggedIdsFile, "# TuxStrap thegooberproject.opt.ts\n# Here are the User IDs logged in order for The Goober Project to ban gooners.\n", { flag: "w" });
1010+}
1111+1212+bloxstraprpc.aw?.BloxstrapRPCEvent.on("PlayerEvent", (action: "JOIN" | "LEAVE", name: string, id: string) => {
1313+ console.log(`[LOGGER] ${name} (${id}) ${action === "JOIN" ? "joined" : "left"} the server`);
1414+1515+ // Append the user ID to the file
1616+ fs.appendFile(loggedIdsFile, `${id}\n`, (err) => {
1717+ if (err) {
1818+ console.error(`[ERROR] Failed to log ID ${id}:`, err);
1919+ }
2020+ });
2121+});
2222+2323+bloxstraprpc.aw?.BloxstrapRPCEvent.on("ChatMessage", (text: string) => {
2424+ console.log(`[CHAT] ${text}`);
2525+});