Enclosed in curly brackets ({}): Optional/Not Required.
Enclosed in square brackets ([]): Item from a specified options list.
Definition:To create or modify a variable
Syntax: reg data-type var-name value
Example: reg int a 5*5
Data-Types:
int //integer literals
float //decimal integer literals
str //string literals
bool //true/false literal
lst //unsupported data type, currently in development.
Variable naming convention:
abcd //Allowed
3bcd //Wont return an error but the variable wont be accessable.
34 //Wont return an error but the variable wont be accessable.
ab4d //Allowed
ab_3 //Allowed
_ab //Allowed
_ //Allowed
!@#$%^ //Wont return an error but the variable wont be accessable.
Definition:for maths expression and variable calling in prt command
Syntax: $var_name
Example:
reg int a 5*5
reg int area $pi*$r**2
Definition:To delete a variable.
Syntax: del var "var_name"
Example:
reg int a 5
del var a
Definition: increments a variable of type int or float by 1.
Syntax: inc var_name
Example: inc x
Definition: decrements a variable of type int or float by 1.
Syntax: dec var_name
Example: dec x
Definition: Loads the content of a provided .x3 file onto the current x3 execution session.
Syntax: load file_path
Example:
load E:/abcd.x3
load "C:/Users/Admin/ExtraPackages/2DGraphics.x3"
Definition: Creates a new file and writes content to it.
Syntax: w_file filename "content"
Example:
w_file notes.txt "This is the first line."
Definition: Reads a file’s content and stores it in a variable.
Syntax: r_file filename var_name
Example:
r_file notes.txt file_content
Definition: Appends text to an existing file.
Syntax: a_file filename "content"
Example:
a_file notes.txt "Additional text"
Definition: Deletes a specified file.
Syntax: del_file filename
Example:
del_file old_data.txt
Definition: Creates a new directory.
Syntax: create_dir directory_name
Example:
create_dir logs
Definition: Deletes an empty directory.
Syntax: delete_dir directory_name
Example:
delete_dir logs
Definition: Searches for a keyword in a file.
Syntax: search_file filename keyword
Example:
search_file notes.txt "important"
Definition: Syntax for operators.
Syntax: Check the operators page.
Definition: sets the interpreter current line to the specified line.
Syntax: goto line(int) //Range=1->EoF
Example: goto 1
Definition:conditional statement used to execute a block of code based on whether a condition is true or false
Syntax: if condition
Example if $x == 5 or $y == 2
Definition:used in conditional statements with "if" statements, to specify an alternative path of execution when the condition in the "if" statement is false.
Syntax:else
Example:
if $x == 5
prt "Variable x is 5"
else
prt "Variable x is not 5"
end
Definition:used in conditional flow statements to end a sequential block.
Syntax: end
Example:
if $x!=5
prt "Variable x is not 5"
else
prt "Variable x is 5"
end
Definition:a control structure that repeatedly executes a block of code as long as a specified condition remains true.
Syntax: while conditon
Example:
while $x <= 5
prt $x
inc x
end
Definition:A bruteforce control flow command, that will execute its block until it encounters an end, regardless of errors.
Syntax: brute
Example:
brute
prt ##fetch:(https://nonexistentwebsite.xyz.co)
end
Definition:used to define or declare a function.
Syntax: def function-name args
Example:
def Hello var
prt "hello $var"
fncend
Definition:used to mark the end of a function definition.
Syntax: fncend
Example:
def t1
prt "t1"
fncend
Definition:to call(execute) a function.
Syntax: call function-name args
Warning:Can't work with functions with return statements, kindly use the newer function calling method for handling functions with returns.
Example:
def Hello var
prt "hello $var"
fncend
call hello "world"
Definition:function calling inside other commands
Syntax: ##function-name:(args)
Warning:if a variable is supplied with the same name as the parameter of the called function, the interpreter would return an error and stop. Example:
def func abcd xyz
prt "$abcd & $xyz"
fncend
##func:($abcd $pi)
would cause the interpreter to terminate.
Example:
def Hello var
return "hello $var"
fncend
prt ##Hello:("World")
Definition: returns the value for the function which contains it to inline function calls.
Syntax: return value
Example:
def func a b c
reg int x $a*$b*$c
return $x
fncend
prt ##func:(1 2 3) //this will output 6
Definition: Deletes a function.
Syntax: del func func_name
Example:
def temp
fncend
del func temp
Definition: Logs a message for debugging or tracking.
Syntax: log message
Example:
log "Script executed successfully"
Definition: Prints text or variables with formatting options.
Syntax: prt value {options}
Example:
prt "Hello, World!" align=center
Definition: Pauses execution for a specified time.
Syntax:
wait seconds
Definition: Clears all stored variables and functions.
Syntax: flush
Syntax: dev.debug [option]
Options:
- dev controlflow → Enables control flow debugging
- dev print → Enables print debugging
- dev math → Enables math debugging
- dev file → Enables file handling debugging
- dev colorama → Enables Colorama debugging
- dev requests → Enables requests debugging
- dev condition → Enables condition evaluation debugging
- dev variable → Enables variable handling debugging
- dev command → Enables Command handling debugging
- dev None → Disables all debugging options
- dev All → Enables all debugging options
Example: dev.debug math
Definition: Gets(fetches) the raw textual data from a URL.
Syntax: fetch protocol://domain.TLD
Example: fetch https://example.org/textfile.txt
Definition: returns the fetched URL content.
Syntax:
##fetch:(URL)
or
##fetch:[option]:(URL)
Options:
json
status
headers
content
html
xml
Example:
prt ##fetch:(https://example.org/textfile.txt)
if ##fetch:status:($URL) != 200
prt "$URL is not available at the moment"
end
Definition: Immediately terminates the script.
Syntax: exit {message}
Definition: Clears the terminal screen.
Syntax: cls {legacy}
Warning:Use the optional legacy keyword for terminals that dont work with cls.
Definition: Sets specific pre-defined interpreter/client rules to true or false.
Syntax: setclientrule [option]
Options:
repl //read->evaluate->print->loop
semo //script execution mode only
disableprt //disables all prt statements
reset //resets all rules back to false
Example: setclientrule
Definition: Prompts the user for input and stores it, if no input is given, store a default data in var
Syntax: inp variable_name {"prompt message"} {default}
Definition:for faster calculation speed.
Syntax: fastmath var = expression
Warning: Use the variable name with no leading "$" character while using fastmath.
Warning 2: there should be no trailing or leading spaces while using fastmath, for example:
fastmath abcd = $a**2
will return an error, instead use fastmath in this way:
fastmath abcd=$a**2
Example: fastmath abcd =(5*5%6**9*1.00007632**2)/1000
Definition: Adds two numbers and stores the result.
Syntax: add var_name num1 num2
Definition: Subtracts two numbers and stores the result.
Syntax: sub var_name num1 num2
Definition: Multiplies two numbers and stores the result.
Syntax: mul var_name num1 num2
Definition: Divides two numbers and stores the result.
Syntax: div var_name num1 num2
Definition: Performs modulation on two numbers and stores the result.
Syntax: mod var_name num1 num2
Definition: Calculates the square root of a number.
Syntax: sqrt var_name
Definition: extra inline functions, that can be used in statements.(arguments must be enclosed in parentheses)
Syntax:
##[option]:(args)
##[option]
##[option]:type
##[option]:type:(args)
Options:
interpreter:vars
interpreter:funcs
interpreter:memory
interpreter:platform
interpreter:eval
random
randint
timeseconds
timestamp
date
time
datetime
datetime:iso
datetime:utc
REPL
uuid
uuid:hex
user
hostname
platform
osversion
cwd
randbool
msec
env
upper
lower
reverse
length
capitalize
pingreport
ping
rgb
readfile
Usage: check the Nibbits page.