Waste of JavaScript — parts & microscripter (this game only) =========================================================== About Roblox “Waste of Space” (the game WoJ is inspired by) ------------------------------------------------------------ Waste of Space is a space sandbox massively multiplayer game on Roblox, created by Eggs D Studios. It uses a classic drag-and-drop building system and a unique crafting system so players can build ships, planet-wide factories, Dyson swarms, and more. The game includes combat, aliens, many mechanical / logic / electrical parts, and programming via microcontrollers running a customized Luau environment. It draws inspiration from Factorio, No Man’s Sky, Space Engineers, and Mindustry. Official experience (Roblox): https://www.roblox.com/games/4490046941/Waste-of-Space Waste of JavaScript (this file) is NOT that game: it is a small browser build on hexsodi.io with JavaScript microscripters and a limited palette — useful for porting ideas, not a Roblox substitute. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING This file documents ONLY this browser build. Many Roblox Waste of Space parts (bins, hyperdrives, starmap, extractors, …) are still NOT here — but see Thruster, Reactor, and Gun below for partial WoS-style systems in JavaScript. Pilot-style names GetPort / TriggerPort / Beep are stubs (see below). For a printable list of what is missing, open woj-not-implemented.txt (also inside woj-documentation.zip). !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! BUILD PALETTE (placeable parts) ------------------------------- These are the only part types in this build. Names match internal ids (Pilot-style strings use the same spellings where noted). iron — hull / structure titanium — hull / structure wire — connector (graph edge for “connected” assemblies) battery — power storage; Hammer → Config sets % and watts; thrusters drain % when firing; Reactors refill % vehicleSeat — seat (enter with click when wired to an assembly) ionrocket — thruster (Space / Thrust / Thrust button; Pilot name IonRocket) thruster — WoS-style thruster block (stronger than ionrocket; same thrust controls) reactor — WoS-style power gen: adds charge per second to every battery on the same assembly (rate scales with Hammer “Value”) gun — WoS-style fixed gun: fires with api.ship.fire() from a microscripter on the same assembly; laser damage scales with Hammer “Value” microscripter — runs JavaScript in a Web Worker (hammer → config) port — required on the chain to the microscripter for disk/modem/PC I/O disk — persistent storage (IndexedDB); see below modem — fetch() to URLs you choose (subject to browser CORS) pc — p5.js sketches + simple 2D physics API from script sign — display text (hammer config) screen — 3D face with canvas texture; Hammer → Screen mode paints on the glass in-world; microscripter can draw via api.screen / GetPartFromPort(..., "Screen") There are still no bins, containers, extractors, hyperdrives, life sensors, etc. (Roblox-style GUI TouchScreen is not this build’s screen part.) ACCESS (Javlox) --------------- On hexsodi.io, WoJ redirects to /javlox/ until you save a local profile (localStorage). Character colors apply to your avatar. Local dev: ?skipjavlox=1 on the WoJ URL. WIRING ------ The microscripter only “sees” parts in the same connected component (wire graph) as itself. You still need a port on that chain for disk/modem/PC operations to be allowed (same as before). Screen drawing from a microscripter only requires the Screen on the same assembly (no extra port). JAVASCRIPT API (global: api) ---------------------------- api.log(...args) — lines in the microscripter console api.find(type?) — connected parts { id, type, label }[]; filter by part type string api.ship.fire() — if the assembly has Gun parts, fires lasers from each (damages parts on hit); otherwise a short thrust pulse on that assembly api.disk.read() — one string blob for the first attached disk (legacy) api.disk.write(text) — replace whole disk string api.modem.fetch(url, init) — HTTP; response text truncated server-side in worker handler api.pc.runP5(code) — run p5 in the PC panel (needs port + pc) api.pc.physics.* — addBox, step, snapshot, clear (2D demo physics) api.screen.draw(partId, ops) — run canvas ops on a connected Screen (ops: { op: "clear"|"fillRect"|"disk", ... }) PILOT-COMPATIBLE GLOBALS (JavaScript, async) -------------------------------------------- WoJ injects names similar to Roblox Pilot.Lua so you can port patterns, not line-for-line Luau. For the real Roblox Pilot.lua global API (Luau), see the community-maintained pages: https://arvidsilverlock.github.io/Pilot.lua-Luau-LSP/globals https://arvidsilverlock.github.io/Pilot.lua-Luau-LSP/raw-documentation task.wait(seconds) — await task.wait(0.5) JSONEncode / JSONDecode SandboxID — microscripter part id (string) SandboxRunID — random per run GetPartFromPort(n, "Disk"|"Modem"|"IonRocket"|"Thruster"|"Reactor"|"Gun"|"PC"|"Screen"|…) — "Screen" → 3D screen part; "PC" → pc; port index n is 1-based among parts of that type on this micro’s component GetPartsFromPort(_, type) GetPort(n) — stub (logs) TriggerPort(n) — stub (logs) Beep(pitch) — logs only Disk object (when attached + port): ClearDisk(), Write(key, str), Read(key), ReadEntireDisk() — stored as JSON key/value in the same disk slot as api.disk (legacy plain text becomes {_legacy: "..."} until rewritten). Screen object (on same assembly): Clear(color?), FillRect(x,y,w,h,color), DrawDisk(cx,cy,r,color) — async; same ops as api.screen.draw. Modem object: PostRequest(domain, body), GetRequest(domain) → uses fetch; SendMessage / RealPostRequest are not real cross-region WoS behavior. PLAYER / WORLD -------------- WASD, orbit camera, click to place, hammer tools, multiplayer via room query ?room=… No WoS regions, coordinates, resources, or crafting. For Roblox Waste of Space Pilot.Lua (bins, reactors, starmap, …) see pilot-lua-wos-appendix.txt — that is reference-only and does not describe WoJ.