// Name: Agar.io Script Setup // Description: Collect requirements and scaffold an Agar.io userscript or bookmarklet draft. // Author: vvar10 // GitHub: vvar10 import "@johnlindquist/kit" type ScriptType = "userscript" | "bookmarklet" const choice = await arg<ScriptType>("Choose script target", [ { name: "Userscript (Tampermonkey/Violentmonkey)", value: "userscript", description: "Best for modifying Agar.io gameplay/UX in browser" }, { name: "Bookmarklet", value: "bookmarklet", description: "Quick one-click script via bookmark bar" }, ]) const scriptName = await arg({ placeholder: "Script name (e.g., Agar.io Helper)", validate: (v: string) => (v.trim().length ? true : "Please enter a name"), }) const shortDesc = await arg({ placeholder: "Short description (one line)", strict: false, }) const details = await editor({ value: `# Describe what you want your Agar.io script to do - Controls/Hotkeys: - UI Changes: - Auto-actions (spawn, split, feed, etc.): - Teaming features: - Anti-bot/Anti-ban considerations: - Other: `, hint: "Add details and press Cmd/Ctrl+Enter to continue", }) const slug = (s: string) => s .toLowerCase() .replace(/[^a-z0-9]+/g, "-") .replace(/(^-|-$)/g, "") const filename = `${slug(scriptName)}${choice === "userscript" ? ".user.js" : ".bookmarklet.txt"}` const draftsDir = kenvPath("drafts", "agario") await ensureDir(draftsDir) const draftPath = path.join(draftsDir, filename) let content = "" if (choice === "userscript") { content = `// ==UserScript== // @name ${scriptName} // @namespace https://${slug(scriptName)}.example // @version 0.1.0 // @description ${shortDesc || "Agar.io helper userscript"} // @author You // @match https://agar.io/* // @run-at document-idle // @grant none // ==/UserScript== ;(function () { "use strict" // Notes / Requirements captured: /* ${details .split("\n") .map(l => " " + l) .join("\n")} */ // Wait for game to be ready const onReady = (fn) => { if (document.readyState === "complete" || document.readyState === "interactive") { fn() } else { window.addEventListener("DOMContentLoaded", fn, { once: true }) } } onReady(() => { // Example: Add a simple overlay const overlay = document.createElement("div") overlay.style.position = "fixed" overlay.style.top = "10px" overlay.style.left = "10px" overlay.style.zIndex = "999999" overlay.style.padding = "6px 10px" overlay.style.background = "rgba(0,0,0,0.6)" overlay.style.color = "#fff" overlay.style.font = "12px/1.4 -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Inter, Helvetica, Arial, sans-serif" overlay.style.borderRadius = "6px" overlay.textContent = "${scriptName} loaded" document.body.appendChild(overlay) // TODO: Implement your features here. // Tip: Prefer interacting with game UI and DOM where possible. // For keybinds: // window.addEventListener("keydown", (e) => { if (e.key === "x") { /* do something */ } }) }) })() ` } else { // Bookmarklet draft const coreJs = `(() => { "use strict"; // Notes / Requirements captured: /* ${details .split("\n") .map(l => " " + l) .join("\n")} */ // Example: Simple notice overlay const el = document.createElement("div"); el.style.position = "fixed"; el.style.top = "10px"; el.style.left = "10px"; el.style.zIndex = "999999"; el.style.padding = "6px 10px"; el.style.background = "rgba(0,0,0,0.6)"; el.style.color = "#fff"; el.style.font = "12px/1.4 -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Inter, Helvetica, Arial, sans-serif"; el.style.borderRadius = "6px"; el.textContent = "${scriptName} active"; document.body.appendChild(el); // TODO: Implement your features here })();` const bookmarklet = `javascript:${encodeURIComponent(coreJs).replace(/%20/g, "+")}` content = `# ${scriptName} (Bookmarklet) ${shortDesc ? `\n${shortDesc}\n` : ""} Paste this as the URL of a new bookmark: ${bookmarklet} --- // Raw (readable) version for editing: ${"```js"} ${coreJs} ${"```"} ` } await writeFile(draftPath, content, "utf8") const edited = await editor({ value: content, language: "javascript", hint: `Saved to ${draftPath}. Edit and press Cmd/Ctrl+Enter to finish.`, shortcuts: [ { name: "Copy to Clipboard", key: `${cmd}+c`, bar: "right", onPress: async (input: string) => { await copy(input) await toast("Draft copied to clipboard") }, }, { name: "Reveal Draft", key: `${cmd}+shift+r`, bar: "right", onPress: async () => { await revealFile(draftPath) }, }, ], onSubmit: async (text: string) => { await writeFile(draftPath, text, "utf8") submit(text) }, }) await copy(edited) await notify(`Saved draft: ${filename}`) await revealFile(draftPath)// Name: Multibox Auto Respawn + Split // Description: Cycle selected tabs (agar.io/delt.io) to auto-respawn and trigger 16-split with configurable keys. // Author: vvar10 // GitHub: vvar10 import "@johnlindquist/kit" const browsers = ["Google Chrome", "Brave", "Edge", "Firefox"] as const type Browser = (typeof browsers)[number] const browser = (await arg("Select your browser", browsers)) as Browser let tabs = await getTabs(browser) if (!tabs?.length) { await notify("No tabs found") exit() } const preferred = tabs.filter(t => /agar\.io|delt\.io|delta\.io/i.test(t.url)) const list = (preferred.length ? preferred : tabs).map(t => ({ name: t.title || t.url, description: t.url, value: t.url, })) const targetUrls = await select<string[]>( { placeholder: preferred.length ? "Select agar.io/delt.io tabs (multi-select)" : "No agar/delt tabs detected. Select tabs to automate (multi-select)", enter: "Start Automation", }, list ) if (!targetUrls?.length) { await notify("No tabs selected") exit() } const [respawnKey, splitKey, perTabDelayMsStr, loopDelayMsStr] = await fields([ { label: "Respawn key", value: "r" }, { label: "16-split key", value: "x" }, { label: "Delay per tab (ms)", value: "250", type: "number" }, { label: "Loop delay (ms)", value: "1000", type: "number" }, ]) const perTabDelayMs = Math.max(0, Number(perTabDelayMsStr) || 250) const loopDelayMs = Math.max(0, Number(loopDelayMsStr) || 1000) let running = true await notify("Automation started. Toggle with cmd+shift+s. Quit with cmd+shift+q.") registerShortcut(`${cmd}+shift+s`, async () => { running = !running await toast(running ? "Resumed" : "Paused", { autoClose: 1500 }) }) registerShortcut(`${cmd}+shift+q`, async () => { await toast("Stopping…", { autoClose: 1000 }) exit() }) await hide() while (true) { if (!running) { await wait(250) continue } for (const url of targetUrls) { try { await focusTab(url, browser) await wait(150) // Respawn if (respawnKey) { await keystroke(respawnKey) await wait(120) } // Trigger 16-split macro (user-mapped to splitKey) if (splitKey) { await keystroke(splitKey) } await wait(perTabDelayMs) } catch { // Ignore focus/keystroke errors and continue } } await wait(loopDelayMs) }