// Name: Roblox Auto Player // Description: Opens the Roblox game and simulates basic movement to auto play. // Author: costamartamaria131-lab // GitHub: costamartamaria131-lab import "@johnlindquist/kit" const GAME_URL = "https://www.roblox.com/pt/games/131832665672192/Hide-In-Attic-From-John-bob-And-George-Hampleton" let running = false let removeStopShortcut: (() => void) | null = null const stopShortcut = isMac ? "cmd+shift+s" : "ctrl+shift+s" function randInt(min: number, max: number) { return Math.floor(Math.random() * (max - min + 1)) + min } async function press(key: string, times = 1, delayMs = 60) { for (let i = 0; i < times; i++) { await keystroke(key) await wait(delayMs) } } async function randomStep() { const r = Math.random() if (r < 0.45) { // Move forward await press("w", randInt(2, 6), randInt(50, 120)) } else if (r < 0.6) { // Strafe left await press("a", randInt(2, 4), randInt(70, 120)) } else if (r < 0.75) { // Strafe right await press("d", randInt(2, 4), randInt(70, 120)) } else if (r < 0.85) { // Back a bit await press("s", randInt(1, 3), randInt(80, 130)) } else { // Jump await press("space", 1, 100) } // Small random pause between actions await wait(randInt(200, 600)) } async function autoPlay() { try { await openApp("Roblox") } catch { // Ignore; user may be in browser } running = true removeStopShortcut?.() removeStopShortcut = registerShortcut(stopShortcut, async () => { running = false removeStopShortcut?.() removeStopShortcut = null await toast("Auto Play stopped") await show() }) await toast(`Auto Play started — press ${stopShortcut} to stop`) await hide() while (running) { await randomStep() } } while (true) { const action = await arg( { placeholder: "Roblox Auto Player", enter: "Run", strict: true, preview: md(` - Open the game URL, then bring Roblox to the front - Start Auto Play to simulate basic WASD movement and jumps - Stop anytime with ${stopShortcut} `), }, [ { name: "Open Game in Browser", value: "open" }, { name: running ? "Stop Auto Play" : "Start Auto Play", value: running ? "stop" : "start" }, { name: "Quit", value: "quit" }, ] ) if (action === "open") { await browse(GAME_URL) } else if (action === "start") { if (!running) { await autoPlay() } else { await toast("Already running") } } else if (action === "stop") { if (running) { running = false removeStopShortcut?.() removeStopShortcut = null await toast("Stopping…") await show() } else { await toast("Not running") } } else if (action === "quit") { removeStopShortcut?.() removeStopShortcut = null exit() } }