-
Notifications
You must be signed in to change notification settings - Fork 0
Scripting
HugeBrain16 edited this page Feb 19, 2026
·
7 revisions
Used to declare/define a variable
let n = 10;
let x;
let y;
x = 10;
y = 20;
Used to define a function
func say(msg) {
println(msg);
}
say("Great things are happening...");
Used in a function to return a value
func format(user, msg) {
return user + ": " + msg;
}
let str = format("mango", "says this");
println(str);
null
let x = 10;
println(x);
x = null;
println(x);
boolean types
func match(str1, str2) {
if (str1 == str2)
return true;
return false;
}
let status = match("hello", "hello");
println(status);
Print values to terminal
can take unlimited arguments
let msg = "Important message";
print(msg);
Print values to terminal with newline
can take unlimited arguments
let msg = "Critical message";
println(msg);
Execute commands
takes 1 argument
println("Right now is...");
exec("time");
exec("date");
takes 1 argument
let score = 1337;
println("My score: " + as_str(score));
takes 1 argument
let score = 1337;
let input_score = "-1000";
score = score + as_int(input_score);
println(score);
takes 1 argument
let asdf = "1.25";
println(as_float(asdf));
opens a file with the specified mode
let file = file_open("readme.txt", "r");
if (file)
println("File exist.");
reads data from file by the specified length
let file = file_open("readme.txt", "r");
let content = file_read(file, 32);
println(content);
writes string into the specified file
let file = file_open("readme.txt", "w");
file_write(file, "This is the start of the readme");