script-ll is a lined-language designed for writing scripts.
You could go to the examples folder and take a look at the contents of tutorial.ll
To execute a script-ll file, follow the following steps:
- Go to https://github.com/vs-123/script-ll/releases
- Download any one of them based on your OS
- Unpack it
- Add the location of the folder where script-ll belongs to your environment variable path
- Then use the command
script-ll <file>
where<file>
is the name of the file you're executing.
Since 21 October 2021, there are 26 (twenty-six) commands:
exists <VARIABLE_NAME> <TYPE> info: Checks for the existence of a variable called <IDENTIFIER> of type <TYPE>.
var <VARIABLE_NAME> <VARIABLE_VALUE> info: Creates a variable called <VARIABLE_NAME> with the value <VARIABLE_VALUE>.
print <VARIABLE_NAME/STRING/NUMBER> info: Prints the given <VARIABLE_NAME/STRING/NUMBER>.
print_newline info: Prints a newline.
add <NUMBER_1> <NUMBER_2> info: Adds <NUMBER_1> and <NUMBER_2> and stores it to variable 'TEMP'.
sub <NUMBER_1> <NUMBER_2> info: Subtracts <NUMBER_2> from <NUMBER_1> and stores it to variable 'TEMP'.
mul <NUMBER_1> <NUMBER_2> info: Multiplies <NUMBER_1> by <NUMBER_2> and stores it to variable 'TEMP'.
div <NUMBER_1> <NUMBER_2> info: Divides <NUMBER_1> by <NUMBER_2> and stores it to variable 'TEMP'.
mod <NUMBER_1> <NUMBER_2> info: Gets the remainder of <NUMBER_1> and <NUMBER_2> and stores it to variable 'TEMP'.
label <LABEL_NAME> info: Creates a label with the name <LABEL_NAME>.
jmp <LABEL_NAME> info: Jumps to label <LABEL_NAME>.
jmp_gt <NUMBER_1> <NUMBER_2> <LABEL_NAME> info: Jumps to label <LABEL_NAME> if <NUMBER_1> is greater than <NUMBER_2>.
jmp_lt <NUMBER_1> <NUMBER_2> <LABEL_NAME> info: Jumps to label <LABEL_NAME> if <NUMBER_1> is less than <NUMBER_2>.
jmp_eq <NUMBER_1/STRING_1> <NUMBER_2/STRING_2> <LABEL_NAME> info: Jumps to label <LABEL_NAME> if <NUMBER_1/STRING_1> is equal to <NUMBER_2/STRING_2>.
return <NUMBER/STRING> info: Stores <NUMBER/STRING> to variable 'TEMP'.
comment <ANYTHING> info: Does not do anything.
get_os info: Detects the user's operating system and stores it to variable 'TEMP'.
cmd <STRING> info: Executes <STRING> where <STRING> is shell script, bash script, batch script, etc.
input info: Takes input from the command-line.
to_number <VARIABLE_NAME> info: Converts variable <VARIABLE_NAME> to 'Number' type and stores it to 'TEMP'.
to_string <VARIABLE_NAME> info: Converts variable <VARIABLE_NAME> to 'String' type and stores it to 'TEMP'.
read_file <STRING> info: Reads file '<STRING>' and stores its content to 'TEMP' as a String type.
is_match <STRING_1> <STRING_2> info: Checks if <STRING_1> has a match for <STRING_2> where <STRING_2> is a regex, if so, returns Number '1' otherwise '0' and then stores it to 'TEMP' as type Number
count_matches <STRING_1> <STRING_2> info: Counts the number of matches <STRING_1> for <STRING_2> where <STRING_2> is a regex and stores it to 'TEMP' as type Number.
replace_all <STRING_1> <STRING_2> <STRING_3> info: Replaces all matches of <STRING_2> in <STRING_1> with <STRING_3> where <STRING_2> is a regex and then stores the resulting string to 'TEMP'
replace_n <STRING_1> <STRING_2> <STRING_3> <NUMBER> info: Replaces <NUMBER> matches of <STRING_2> in <STRING_1> with <STRING_3> where <STRING_2> is a regex and then stores the resulting string to 'TEMP'