AquaScript - Documentation
Commands and Usages
How to begin!
This is only for local development. For web development go to this link
Just create a ".asq" file and start coding. That's all you need for local development.
As best practice you should clear all the variables before and after your script.
You can run the scripts using the script execution commands in the documentation.
You can start a comment line with "//". Comments can only be one line and they can only be at the start of a line.
Web development is different. There's a structure and architecture, but the coding is the same. This documentation will work for web development too. It just needs a different type of setup.
User output
Say
Usage:
say [argument]
Use:
Outputs the argument to the console.
Say Colour
Usage:
say-c-[name of colour] [argument]
Use:
Outputs the argument to the console with the chosen colour.
Miscellaneous
Greet
Usage:
greet
Use:
Outputs "Greetings World!" to the console.
Hello World
Usage:
hello world
Use:
Outputs "Hello World!" to the console.
Echo on
Usage:
echo-on
Use:
Turns on echo. (a new line stating the last input)
Echo off
Usage:
echo-off
Use:
Turns off echo. (a new line stating the last input)
Colours
Usage:
colours
Use:
Outputs a list of all the usable colours to the console.
Hack
Usage:
hack
Use:
Outputs a random string of ones and zeros to the console.
Aquafetch
Usage:
aquafetch
Use:
Outputs information related to the client machine to the console.
Run
Usage:
run [argument]
Use:
Starts the given process on the client machine. [Runs a program]
Interrupt
Usage:
interrupt [ms]
Use:
Interrupts the program for the given duration in milliseconds.
Running Directory
Usage:
g-rundirec
Use:
Outputs the running directory of the program to the console.
Hide CLI
Usage:
hidecli
Use:
Hides the console.
Show CLI
Usage:
showcli
Use:
Unhides the console.
Get text
Usage:
get-text [path]
Use:
Gets all the text of the file in the given path and outputs it to the console.
Get text [lines]
Usage:
get-text-lines [path]
Use:
Gets all the text of the file in the given path and outputs it to the console in seperate lines.
Quit
Usage:
quit
Use:
Closes the program.
Exit
Usage:
exit
Use:
Closes the program.
Out
Usage:
out [command]
Use:
Sets the "out" variable to the result of the executed command.
Utilize environment
Usage:
env-util [Path]
Use:
Defines the identity of the web program, with the given environment file. {File setup in web documentation}
Projects
Projects
Usage:
projects
Use:
Outputs a list of all the available project branches to the console.
Projects + branch
Usage:
project [branch]
Use:
Outputs a list of all the projects within the chosen branch to the console.
Script execution
Runscript
Usage:
runscrpt [path]
Use:
Executes the script in the given path.
Runscript web
Usage:
runscript-web [link]
Use:
Executes the script in the given URL.
Runscript GUI
Usage:
runscript-gui
Use:
Opens a file browser dialogue and executes the script chosen with the dialogue.
Forms
Extra info: use a '^' symbol to put a space in texts, which are defined in form commands.
Basic form
Usage:
basicform [title] [width] [height] [arguments]
Use:
Opens a window, that interrupts the program, with the given title and arguments in the stated size.
Flow form
Usage:
flowform [title] [width] [height] [arguments]
Use:
Opens a window with the given title and arguments in the stated size.
Form arguments:
Variables
Usage:
vars
Use:
Adds all the user variables as controls into the form.
Quit form button
Usage:
quit-form-button
Use:
Adds a button, that closes the form into the form.
Quit app button
Usage:
quit-app-button
Use:
Adds a button that closes the program(the client/interpreter) into the form.
Image
Usage:
image-[Path]
Use:
Adds a Image with the given path into the form.
Horizontal
Usage:
horizontal
Use:
Sets the flow direction of the form to horizontal.
Wallpapers
Wallpaper
Usage:
wlp-[scaling] [Path]
Use:
Sets the wallpaper of the client machine to the image in the given path with the chosen scaling option.
Wallpaper scaling options
Fit
Usage:
fit
Stretch
Usage:
stretch
Tiles
Usage:
tile
Span
Usage:
span
User variables (non-control)
String
Usage:
#string [Text]
Use:
Creates a string with the given text.
Integer
Usage:
#int [Number]
Use:
Creates an integer with the given number.
Change String
Usage:
#s-[Index] [text]
Use:
Sets the value of the chosen string to the given text.
Change Integer
Usage:
#i-[Index] [Number]
Use:
Sets the value of the chosen integer to the given number.
How to get the index?
Strings and integers are stored in two separate lists.
To get the index of a variable, you can read the order you defined them in the code. The order you defined them matters and the list starts from zero,
Alternative: How to get the index:
Strings
Usage:
strings
Use:
Lists all the strings with their index.
Integers
Usage:
ints
Use:
Lists all the integers with their index.
User variables (controls)
the controls that are used in forms
Button
Usage:
$button [Text]
Use:
Creates a button with the given text.
Label
Usage:
$label [Text]
Use:
Creates a label with the given text.
Input field
Usage:
$input [Text]
Use:
Creates an input field with the given text.
Image
Usage:
$image [Path]
Use:
Creates an image with the given path.
Image (web)
Usage:
$imageweb [Link]
Use:
Creates an image with the given link.
Button functions
Usage:
$b-[index] [commands]
Use:
Changes the function of the given button to the commands. [In code the commands set in this command are separated by semicolons since AquaScript is line-based.]
Change image
Usage:
$img-[Index] [Path]
Use:
Changes the picture of the given image to the image in the given path.
Change image (web)
Usage:
$imgweb-[Index] [Link]
Use:
Changes the picture of the given image to the image in the given link.
Change label
Usage:
$l-[Index] [Text]
Use:
Changes the text of the given label to the Text set in this command.
How to get the indexes?
All the controls are stored in one list.
You need to read the code and check the order the variables were defined. The list starts from zero.
Clears
Clear
Usage:
clear-[type]
Use:
Clears all the variables in the given list.
Clear types:
Out
Usage:
clear-out
Use:
Clears the "out" variable.
Out
Usage:
clear-out
Use:
Clears the "out" variable.
Env
Usage:
env-clear
Use:
Clears the program definiton set in the "env.asv" file.
All
Usage:
clear-all
Use:
Clears all the variables.
Within
Usage:
clear-within
Use:
Clears only the controls, strings, and integers. This is used to have multiple pages in a web program.
Controls
Usage:
clear-usrvars
Use:
Clears all the controls.
Strings
Usage:
clear-strings
Use:
Clears all the strings.
Integers
Usage:
clear-ints
Use:
Clears all the integers.
Math
Addition
Usage:
add [Val1] [Val2]
Use:
Outputs the sum of the given numbers to the console.
Subtraction
Usage:
sub [Val1] [Val2]
Use:
Outputs the difference between the given numbers to the console.
Division
Usage:
div [Val1] [Val2]
Use:
Outputs the quotient of the given numbers to the console.
Multiplication
Usage:
add [Val1] [Val2]
Use:
Outputs the product of the given numbers to the console.
Variable replacement
In code the way you use the value of a variable is by using a keyword, which the interpreter replaces with the value of the variable
OS platform
Usage:
{osplatform}
Use:
This is replaced by the OS platform, which the client is running on.
OS version
Usage:
{osversion}
Use:
This is replaced by the OS version, which the client is running on.
OS Service Pack
Usage:
{ossp}
Use:
This is replaced by the service pack of the OS, which the client is running on.
PC name
Usage:
{pcname}
Use:
This is replaced by the name of the PC, which the client is running on.
Fetch result
Usage:
{fetchresult}
Use:
This is replaced by the result of the "aquafetch" command.
Out
Usage:
{out}
Use:
This is replaced by the out variable.
Res
Usage:
{res}
Use:
This is replaced by the result of the last command, that was executed.
Program defintion variables
You can only use these if the web program has set them up.
IP
Usage:
{ip}
Use:
This is replaced by the link/ip/URL, which the web program runs on.
Name
Usage:
{bane}
Use:
This is replaced by the name of the web program.
Version
Usage:
{ver}
Use:
This is replaced by the version of the web program.
Author
Usage:
{auth}
Use:
This is replaced by the author of the web program.
Description
Usage:
{desc}
Use:
This is replaced by the description of the web program.
Values of user variables
Control
Usage:
{$s[index]}
Use:
This is replaced by the value of the given control.
String
Usage:
{#s[index]}
Use:
This is replaced by the value of the given string.
Integer
Usage:
{#i[index]}
Use:
This is replaced by the value of the given inteer.