Byte is a lightweight interpreted scripting language designed for simplicity, educational use, and rapid prototyping. Its syntax allows for variables, functions, loops, conditionals, buttons, object interactions, and basic graphics operations easily with it's simple keywords and syntax. Byte is particularly suitable for creating small games or interactive scripts with minimal overhead. Note: Future updates may introduce new keywords or behavior, so older scripts may occasionally require adjustments.
STR
— this signals the interpreter that the script is beginning.end
and loops with -
.VAR [name]
. They are global unless inside a function.//
for full-line comments or =//
for inline comments.Below is a comprehensive list of keywords with their purpose and example usage:
Keyword | Description | Example |
---|---|---|
STR | Indicates the start of a script. | STR |
EXE | Executes a named function. | EXE [MyFunction] |
RED | Reads input from the user (not fully interactive in web context). | RED "Hello" |
DLE | Deletes a variable or data reference. | DLE a.z.a |
VAR | Declares a variable, initialized to 0 by default. | VAR [Counter] ST |
STO | Immediately stops script execution. | STO |
THN | Used in conditional statements for readability. | IF X > 5 THN |
WIT | Pauses execution for a given number of seconds. | WIT = 3 |
RRI | Prints output to the console. | RRI("Hello")- |
onStr | Automatically runs when the script starts. | onStr = ... end |
func | Defines a reusable function. | func MyFunc = ... end |
const | Declares an immutable value. | const PI = 3.14 |
-c + N | Loop that executes N times. Multi-line or single-line versions supported. | -c + 5 = ... - |
Button | Creates a clickable UI button linked to a function. | Button + "Click" EXE [Func] |
Change | Dynamically updates a variable or value. | Change X = 5 |
SIPHON | Temporarily siphons objects or variables. Duration optional. | SIPHON + 5 |
Share | Exposes data outside of local scope. | Share [Counter] |
addNum / dleNum | Quickly increment or decrement the most recently declared variable. | addNum + 1 |
do | Calls a function or evaluates a variable reference that points to a function. | do MyFunc |
IF / AND / NOT / END | Conditionals for logical flow control. | IF X > 0 AND Y < 10 THN ... END |
LIN | Stores a line of input or string globally. | LIN Hello |
raycast / Hit / velocity / Spawn.New | Object detection, movement, or spawning primitives. | velocity = 5 |
Keybind | Assign a keyboard key to trigger a function. | Keybind + "A" EXE [Func] |
math.Add / math.Sub / math.Mul / math.Div | Basic arithmetic operations. Can operate on variables or numbers. | math.Add 2 + 3 = |
+ - * /
.+
.true
or false
.Spawn.New
, SIPHON
, raycast
and movement commands.Variables declared globally persist throughout the script; inside a function, they are local unless explicitly shared. Memory management is automatic, except const
, which is immutable.
IF / AND / NOT / THN / END
— supports logical operators and nesting.-c + N = ... -
— multi-line blocks or single-line loops.func
and run via EXE
or automatically via onStr
.WIT
instead of busy-wait loops to reduce CPU load.SIPHON
and Share
operations inside loops.byte.json
:fetch('https://bytedev.neocities.org/API/byte.json') .then(res => res.blob()) .then(blob => { const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'byte.json'; a.click(); }) .catch(err => console.error('Error fetching byte.json:', err));
If pasting is blocked, type allow pasting
in the console first.
byte.json
in your project folder, typically the root.Browser example:
fetch('./byte.json') .then(res => res.json()) .then(data => console.log(data));
Node.js example:
const fs = require('fs'); const data = JSON.parse(fs.readFileSync('./byte.json', 'utf-8')); console.log(data);
Math commands start with math.
followed by the operation (Add
, Sub
, Mul
, Div
). Operands can be numeric literals or variables (using do
for variable evaluation). Example:
STR math.Add 1 + 4 = math.Sub 7 - 2 = math.Mul 2 * 4 = math.Div 6 / 3 =
Output:
5 5 8 2
This illustrates Byte's support for arithmetic evaluation inline with script execution. Some answers may not be accurate since computers sometimes struggle with complex math equations. Think: decimals.
VAR
or const
.-c + N
uses a finite N.onStr
initializes them and the function exists.WIT = seconds
inside loops.STO
.Button + "Label" EXE [Function]
inside onStr
.raycast
, assign AT / TA / BT / TS
for movement.STR VAR [Counter] ST IncreaseCounter = Counter = Counter + 1 RRI ("Counter: " + Counter)- end onStr = Button + "Click Me" EXE [IncreaseCounter] end
-c + 3 = RRI("Iteration")- WIT = 0.5 -
SIPHON + 3 RRI ("Siphoned for 3s")-
-c + 10 = IF Counter = 5 THN STO END -
STR
and properly close loops/functions.const
for fixed values and STO
for safe termination.Byte is a compact but versatile language, ideal for scripting, UI interactions, and basic game logic. This documentation covers everything from keywords, syntax, loops, buttons, advanced functions, math operations, and debugging tips. Use this as a reference for your Byte projects.
Questions or suggestions? Contact: bytedevinquiries@gmail.com