Greyscript Documentation
AptClient
AptClient.show(repository_name:String) : String
Shows all packages available in repository The repository MUST be added in the /etc/apt/sources.txt file.
Returns string with all pachages on success, or a string (containing an error) on failure.
AptClient.search(package_name:String) : String
Search specifically for the package in any of the repositories listed in /etc/apt/sources.txt
Returns either a string with information about the package, or a string (containing an error) on failure.
AptClient.update() : String
Update the list of available packages after adding a new repository in /etc/apt/sources.txt, or if the remote repository has updated its information in /server/conf/repod.conf
Returns string containing all repository addresses with 'Updated' prefix on success, or a string (containing an error) on failure.
AptClient.add_repo(repository_address:String, ?port:Number) : String
Add the repository address in the /etc/apt/sources.txt file
Returns empty string on success, or a string (containing an error) on failure.
AptClient.del_repo(repository_address:String) : String
Remove the repository address in the /etc/apt/sources.txt file.
Returns empty string on success, or a string (containing an error) on failure.
AptClient.install(package_name:String, ?install_path:String) : String
Install the program or library from a remote repository listed in /etc/apt/sources.txt. Unless a path is specified, the program installs in /lib if it is a library or in /bin otherwise
Returns a string (containing an error) on failure or empty on success.
AptClient.check_upgrade(file_path:String) : Number | String
Check if there is a newer version of the file in the repository.
Returns 1 or 0 if an update is or is not found respectively, or a string (containing an error) on failure.
aptclient = include_lib("/lib/aptclient.so") if aptclient.check_upgrade("/lib/metaxploit.so") == 1 then aptclient.install("metaxploit.so", "/lib") end if
CTFEvent
CTFEvent.get_creator_name() : String
Returns a string with the name of the mission creator.
CTFEvent.get_description() : String
Returns a string with the description set from set_config
CTFEvent.get_mail_content() : String
Returns a string with the content of the email that the player will receive upon accepting the mission.
CTFEvent.get_template() : String
Returns a string with the public address of the rented server used as a template for the event.
CTFEvent.player_success() : Number
This function is to be called when the player successfully completes the mission. When it is completed, the player and the event creator will receive a reward. THe more players complete the mission, the higher the mission scores, and the higher the rewards are for the creator & player. Returns false if the player has not accepted the mission or has already completed it, true otherwise.
Shell
Shell.connect_service(ipAddress:String, port:Number, user:String, password:String, ?service:String) : Shell | FtpShell | String
Note: This method cannot be used in encryption configuration.
Connect to a remote service. You can specify 'ftp' in the serviceType to request a FtpShell
Returns a Shell or FtpShell if the connection has been established correctly or null on failure.
Shell.start_terminal() : String | null
Note: This method cannot be used in encryption configuration.
Launch an active terminal from the Shell.
Shell.scp(pathOrig:String, pathDest:String, remoteShell:Shell) : Number | String | null
Copy a file from one computer to the other through the network.
Returns 1 on success, or a string (containing an error) on failure.
Shell.build(pathSource:String, pathBinary:String, ?allowImport:Number) : Number | String
Compile the source code of the file that is in the provided path, and save the executable in the destination path. The name of the executable is the same as that of the source file without the extension. The provided paths must be absolutes.
Returns a string (empty on success, or with an error on failure)
Shell.launch(path:String, args:String) : Number | String
Launches the command in the provided path.
Returns null on success, or 0 on failure.
Shell.host_computer() : Computer | null
Returns the computer associated with the Shell.
Shell.ping(ipAddress:String) : Number | String | null
Returns true if the remote address could be reached, false otherwise. Firewalls do not block ping requests.
Shell.masterkey(ipAddress:String, Port:Number, User:String) : Shell | null
Connect to a remote server, regardless of any security.
*This requires moderator permissions on Multiplayer, and is unavailable in Singleplayer.
Shell.masterkey_direct(publicIpAddress:String, localIpAddress:String, User:String) : Shell | null
Connect to a remote server, regardless of any security. Differences unknown from normal masterkey.
*This requires moderator permissions on Multiplayer, and is unavailable in Singleplayer.
Shell.restore_network(publicIpAddress:String) : Any
Restore a network to it's original state, presumedly as would be done with ConfigLan.
*This requires moderator permissions on Multiplayer, and is unavailable in Singleplayer.
FtpShell
FtpShell.start_terminal() : String | null
Launch an active terminal from the FtpShell.
FtpShell.host_computer() : Computer | null
Returns the computer associated with the FtpShell.
FtpShell.put(pathOrig:String, pathDest:String, remoteShell:Shell) : Number | String | null
Copy a file from one computer to the other through the network.
Returns 1 on success, or a string (containing an error) on failure.
Computer
Computer.get_name() : String
Get the hostname of the computer.
Computer.get_ports() : List[Port]
Returns an array of active ports on the computer.
Computer.File(path:String) : File | null
Returns the file located in the given path, relative or absolute. The file returned can be a folder. If the file does not exist, it is returned null.
Computer.create_folder(path:String, folderName:String) : Number
Create a folder in the specified path.
Computer.is_network_active() : Number
Returns true if the computer has internet access, false otherwise.
Computer.touch(path:String, fileName:String) : Number | String
Note: This method cannot be used in encryption configuration.
Create an empty text file.
Returns 1 on success, or a string (containing an error) on failure
Computer.show_procs() : String
Note: This method cannot be used in encryption configuration.
Returns a string with the list of active processes on the machine.
Computer.network_devices() : List[String]
Returns a string with the list of network devices available on the computer.
Computer.change_password(user:String, password:String) : Number
Change the password of an existing user on the machine, for a new one. It is necessary to be root to be able to execute the method.
Returns 1 on success, or error string on failure
Computer.create_user(user:String, password:String) : Number
Create a user on the machine, with the specified name and password. It is necessary to be root to be able to execute the method.
Returns 1 on success, or error string on failure
Computer.delete_user(user:String, ?removeHome:Number) : Number
Delete the indicated user from the computer, also deleting its home folder optionally. By default, if the optional parameter is not passed, the home folder will not be deleted. It is necessary to be root to be able to execute the method.
Returns 1 on success, or error string on failure
Computer.create_group(user:String, groupName:String) : Number
Create a new group associated with an existing user on the machine. It is necessary to be root to be able to execute the method.
Returns 1 on success, or error string on failure
Computer.delete_group(user:String, groupName:String) : Number
Delete the indicated user group. It is necessary to be root in order to execute this method.
Returns 1 on success, or error string on failure
Computer.groups(user:String) : String
Returns a string with the list of groups created in the indicated user.
Computer.close_program(PID:Number) : Number
Close the program associated with the PID. To show the list of the running programs along with their PIDs use the ps command.
Returns 1 on success, 0 if the process cannot be found, or an error string on failure to terminate the process
Computer.wifi_networks(netDevice:String) : List[String]
Returns a list of the Wi-Fi networks that are available.
Computer.connect_wifi(netDevice:String, bssid:String, essid:String, password:String) : Number
Connect to the indicated Wifi network. Returns true if the connection was successful.
Returns 1 on successful connection, null if the network cannot be found, or an error string on connection failure
Computer.connect_ethernet(netDevice:String, localIp:String, gateway:String) : Number
Notice: Ethernet is currently disabled in multiplayer on both public and nightly builds!
Set up a new IP address on the machine through the ethernet connection. Returns a string with the error message if the connection failed. In case of success, an empty string is returned.
Computer.network_gateway() : String
Returns a string with the gateway configured on the computer.
Computer.active_net_card() : String
Returns a string with the keyword WIFI if the current device is connected to a router by WiFi, if it is connected by cable a string with the keyword ETHERNET is returned.
Computer.local_ip() : String
Returns a string with the computer's local ip address.
Computer.public_ip() : String
Returns a string with the computer's public ip address.
File
File.allow_import() : Number
Returns rather the file is able to be imported.
File.chmod(permission:String, ?isRecursive:Number) : String
Modifies the file's permissions
Takes a permissions string (e.g. u+wr) and optional recursive flag (int 0 or 1)
If the file is a folder and the recursive flag is 1, the permissions change will apply recursively, to all the files and folders inside the folder.
Returns a string (empty on success, or with an error on failure)
File.copy(path:String, newName:String) : String | Number | null
Note: This method cannot be used in encryption configuration.
Copy the file to the specified path.
On success, returns 1 and the terminal outputs the copied file dialogue. On failure, returns either an error (string) such as permission denied or null (if File object not valid).
File.move(path:String, newName:String) : String | Number | null
Note: This method cannot be used in encryption configuration.
Move the file to the specified path.
On success, returns 1. On failure, returns either an error (string) such as permission denied or null (if File object not valid).
File.rename(newName:String) : String | Number | null
Note: This method cannot be used in encryption configuration.
Rename the file with the name provided.
Returns a string (empty on success, or with an error on failure)
File.path(?followSymlink:Number) : String
Returns a string with the absolute path of the file. If followSymlink is true, it will print the path of the symlink destination.
File.parent() : List[File]
Returns the folder that contains this file or null if the initial object is /.
File.name() : String
Returns a string with the name of the file.
File.get_content() : String
Note: This method cannot be used in encryption configuration.
Returns a string with the contents of the text file.
File.set_content(content:String) : String
Note: This method cannot be used in encryption configuration.
Save the text in the file. The content will be overwritten if there is already text saved in the file.
Returns 1 on success, or a string (containing an error) on failure
File.is_binary() : Number
Returns true if the file is binary, false otherwise.
File.is_folder() : Number
Returns true if the file is folder, false otherwise.
File.has_permission(permission:String) : Number
Returns true if the user who launches the script has the necessary permissions. The type_perm parameter is used for reading ('r'), writing ('w') and execution ('x')
File.delete() : String | null
Delete the file
Returns a string (empty on success, or with an error on failure)
File.get_folders() : List[File]
Returns an array of the folders contained in this object. This function is only available if this object is a folder, so it is advisable to first use the is_folder function before calling this method.
File.get_files() : List[File]
Returns an array of files (excluded folders) contained in this object. This function is only available if this object is a folder, so it is advisable to first use the is_folder function before calling this method.
File.permissions() : String
Returns a string with the current file permissions.
File.owner() : String
Returns a string with the name of the file owner.
File.set_owner(ownerName:String, ?isRecursive:Number) : Number
Apply a owner to this file. By default, the owner does not apply recursively. To apply the owner recursively, the optional parameter must be 1.
Returns a string (empty on success, or with an error on failure)
File.group() : String
Returns a string with the name of the group to which this file belongs.
File.set_group(groupName:String, ?isRecursive:Number) : Number
Apply a group to this file. By default, the group does not apply recursively. To apply the group recursively, the optional parameter must be 1.
Returns a string (empty on success, or with an error on failure)
File.size() : String
Returns a string with the size of the file in bytes.
File.meta_info() : Any
Presumedly returns metadata information about a file.
*This requires moderator permissions on Multiplayer, and is unavailable in Singleplayer.
File.symlink(path:String, file_new_name:String) :
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Creates a symbolic link at the specified path.
File.is_symlink() :
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Returns true/false if the file object is a symbolic link.
Crypto
Crypto.aircrack(pathFile:String) : String | null
Returns a string with the password generated from the file created by aireplay.
Crypto.airmon(option:String, device:String) : String | Number
Enables or disables the monitor mode of a network device. The option parameter can only be 'start' or 'stop'.
Crypto.aireplay(bssid:String, essid:String, ?maxAcks:Number) : String | null
Used to inject frames on wireless interfaces.
Once the command with Control+C is stopped, it will save the captured information in a text file called file.cap in the path where the terminal is currently located.
Alternatively, a maximum of captured acks can be specified for the command to stop automatically, saving the file.cap file as described above.
In the event that there is an error, a string will be returned with the message indicating the problem.
Crypto.decipher(encryptedPass:String) : String | null
Note: This method cannot be used in encryption configuration.
Start the process of decrypting the password.
Crypto.smtp_user_list(ipAddress:String, port:Number) : String | List[String] | null
SMTP services are mail services. When using this method with the IP of a mail server, due to a vulnerability in the service, it returns a list of the existing users on the computer where the SMTP service is working. If these users also have an email account registered on the SMTP server, it will be indicated in the list.
Returns a list object of all users on the machine, along with their email address or returns a string containing an error
Metaxploit
Metaxploit.load(path:String) : MetaLib | null
Load the library in memory and return it as a metalib type if the process was successful.
Metaxploit.net_use(ipAddress:String, ?port:Number) : NetSession | null
Note: This method cannot be used in encryption configuration.
It connects to the specified address and establishes a null session to gain access to a library remotely. This type of attack is only available for services that work remotely. If no port is specified, it will connect directly to the router. If the process has been executed correctly, an object of type net_session will be returned.
Metaxploit.scan(metaLib:MetaLib) : List[String]
Analyze the memory areas occupied by the library in search of vulnerabilities. Returns a list with the affected memory zones.
Metaxploit.scan_address(metaLib:MetaLib, memAddress:String) : String
It analyzes a specific memory address and shows the vulnerable parts that can be exploited.
Metaxploit.sniffer(saveEncSource:Number) : String
Note: This method cannot be used in encryption configuration.
The terminal listens to the network packets of any connection that passes through this device. When any connection information is captured, it prints a string with the obtained data. It can save the source code of the encode script if saveEncSource is true. Null is returned if the listen could not be started.
Metaxploit.rshell_client(address:String, ?port:Number, ?procName:String) : Number | String
Launches a process on the victim's machine, which silently tries to continuously connect in the background to the specified address and port. For the reverse shell to run successfully, the rshell service must be installed and the portforward configured correctly on the machine where the server is waiting for the victim's connection.
Metaxploit.rshell_server() : List[Shell]
This method returns a list of shell objects that have been reverse shell connected to this machine. In order to manage the connections received, the rshell service must be installed on the machine that receives the victims' connections.
NetSession
NetSession.dump_lib() : MetaLib
Returns the metalib associated with the remote service.
For example, connecting to a computer with the ssh service will return a metalib libssh object.
In the case of connecting to a router, it returns a metalib kernel_router object.
NetSession.get_num_conn_gateway() : Number
Returns the number of devices connected to it as a gateway.
NetSession.get_num_portforward() : Number
Returns the number of ports configured with a portforward from the remote device.
NetSession.get_num_users() : Number
Returns the number of user accounts on the target
NetSession.is_any_active_user() : Number
Returns true if there are any active users on the system, false otherwise.
NetSession.is_root_active_user() : Number
Returns true if the root user is active on the system, false otherwise.
MetaLib
MetaLib.lib_name() : String
Returns the name of the library.
MetaLib.version() : String
Returns the version of the library.
MetaLib.overflow(memAddress:String, unsecValue:String, ?optArgs:String) : String | Number | Shell | Computer | File
Exploits the indicated vulnerability through the buffer overflow method. The object returned can be of various types or even not return anything, so it is advisable to use the typeof method with the object returned. Depending on the result, it may be necessary to pass extra arguments so that the exploit runs correctly, for example in the case of a password change.
MetaLib.debug_tools(user:String, password:String) :
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Returns the library in debug mode, as an object of type LibraryDebug. To obtain it, it is necessary to provide a valid username and password of a Neurobox engineer.
Router
Router.public_ip() : String
Returns a string with the router's public ip address.
Router.local_ip() : String
Returns a string with the router's local ip address.
Router.ping_port(port:Number) : String
Returns the port object that is behind the port number provided if exists, null otherwise.
Router.port_info(portObject:Port) : String
Returns a string with the information of the port that has been provided. The port provided must not belong to another network than this router.
Router.used_ports() : List[Port]
Returns an array of ports that are being used in this router.
Router.device_ports(ipAddress:String) : List[Port]
Takes a LAN IP address and returns a list with open ports accessible in the network.
Router.devices_lan_ip() : List[String]
Returns a list with any computer whose gateway is the current device with the ips of the routers and switches that it can reach with a ping. Some of the returned addresses could be behind a firewall
Router.essid_name() : String
Returns a string with the ESSID value of the router.
Router.bssid_name() : String
Returns a string with the BSSID value of the router.
Router.kernel_version() : String
Returns a string with the version of the kernel_router.so library
Router.firewall_rules() : String
Returns a string list with the firewall rules present in the router or switch.
Port
Port.get_lan_ip() : String
Returns a string with the local IP address of the computer pointed to by this port.
Port.is_closed() : Number
Returns true if this port is closed, false otherwise.
Port.port_number() : Number
Returns an number with the configured port number.
MetaMail
MetaMail.fetch() : List[String] | String
Get all mails
Returns a string type list of the received emails, with a content preview. In case of error, it returns a string.
MetaMail.read(mail_id:String) : String
Read the full mail. The mail_ID argument can be obtained with fetch method.
Returns either the content as a string or an error message.
MetaMail.send(address:String, subject:String, message:String) : Number | String
Send a new mail to the indicated recipient.
Returns 1 if the mail has been sent correctly, otherwise returns a string with the error.
MetaMail.delete(mail_id:String) : Number | String
Delete the mail that corresponds with mail_ID.
Returns 1 if it was removed successfully or a string with the error message.
General
reset_ctf_password(new_password:String) : String | Number
Reset your player password used for all CTFs.
mail_login(user:String, password:String) : String | MetaMail
Access the email account
Returns a MetaMail type object if the login has been correct. In case of error, it returns a string
print(value:String, ?replaceText:Number) : Number
Print on the Terminal the message.
wait(seconds:Number) : null
Pauses the script for the indicated time. If duration is not specified, the default value is 1 second.
time() : Number
Returns the number of seconds since the program execution began.
typeof(anyObject:Any) : String
Returns a string with the type of the object passed as a parameter.
md5(value:String) : String
Note: This method cannot be used in encryption configuration.
ciphertext = md5("Password")
get_ctf(user:String, password:String, eventName:String) : CTFEvent | String
Gets the event created in the web browser. In case of success, it will return a CTFEvent type object, otherwise it will return a string with the error.
get_router(?ipAddress:String) : Router | null
Returns the router whose public IP matches, otherwise returns null. If the ip_address parameter is not specified, returns the router to which the computer executing this command is connected.
get_switch(ipAddress:String) : Router | null
Returns the switch on the local network whose IP matches, otherwise it returns null.
get_shell(?username:String, ?password:String) : Shell | null
Returns the shell that is executing the script if it is called without parameters. Passing a username and password, it returns a shell with those credentials if are correct.
shell = get_shell
rootShell = get_shell("root","myTotallySecurePassword")
nslookup(hostname:String) : String
Returns the IP address that is behind the web address that has been provided.
whois(ipAddress:String) : String
Shows the administrator information behind the IP provided.
is_valid_ip(ipAddress:String) : Number
Returns true if the provided address is valid, false otherwise.
is_lan_ip(ipAddress:String) : Number
Returns true if the provided address is local, false otherwise. If the provided IP is not valid, it also returns false.
command_info(idCommand:String) : String
Returns the information of common commands of the Operating System, such as mkdir, whois, etc.
current_date() : String
Returns the time and date.
current_path() : String
It returns a string with the path in which the terminal is at the moment of launching the script.
parent_path(path:String) : String
Returns the parent directory of the given path.
home_dir() : String
Returns a string with home folder path of the user who is executing the script.
program_path() : String
Returns a string with the path of the program that is running at this time.
active_user() : String
Returns a string with the name of the user who is executing the script.
user_mail_address() : String
Returns a string with the user's email address that is executing this script. This is only defined on a player's home computer.
user_bank_number() : Number
Returns a string with the bank account number of the user who is executing this script. This is only defined on a player's home computer.
format_columns(columns:String) : String
Format the text provided so that it is ordered by columns.
user_input(message:String, ?isPassword:Number, ?anyKey:Number) : String
Note: This method cannot be used in encryption configuration.
It puts the program on hold to receive the user input, which will be processed as a string. If the password mode is activated, the input text will be hidden with asterisks. If the anyKey argument is true, the entered character will be captured without pressing enter.
include_lib(libPath:String) : Crypto | Metaxploit | AptClient | Blockchain | Service
Includes an external library to be used in scripting. If the library has been included correctly, it will return an object of corresponding type with the library, null otherwise
bitwise(operator:String, num1:Number, num2:Number) : Number
Bitwise operators are used for manipulating data at the bit level. Bitwise operates on one or more bit patterns or binary numerals at the level of their individual bits. They are used in numerical computations to make the calculation process faster. The operator argument accepts the following operators: &, |, ^, <<, >>, >>>
bitAnd(num1:Number, num2:Number) : Number
Returns the bitwise AND operation of the provided inputs.
bitOr(num1:Number, num2:Number) : Number
Returns the bitwise OR operation of the provided inputs.
bitXor(num1:Number, num2:Number) : Number
Returns the bitwise OR operation of the provided inputs.
clear_screen() : null
Note: This method cannot be used in encryption configuration.
Clears all text from the terminal.
exit(?message:String) : null
Stops the execution of the script at the time this method is executed. Optionally you can pass a string as a message that will be printed in the terminal when the program ends.
import_code(absolutePath:String) : null
Includes external code into the current code. Can be used to split code in multiple files. Note: The code will be added to the current code upon compiling.
hash(obj:String) : Number
Note: This method cannot be used in encryption configuration.
Returns a integer that is "relatively unique" to the given value. In the case of strings, the hash is case-sensitive. In the case of a list r map, the hash combines the hash values of all elements.
launch_path() : String
Returns the path of the program that launched this program.
log(num:Number, ?base:Number) : Number
Returns the logarithm of the provided input to the specified base.
abs(num:Number) : Number
Returns the absolute value of the provided input.
acos(num:Number) : Number
Returns the arccosine of the provided input in radians.
asin(num:Number) : Number
Returns the arcsine of the provided input in radians.
atan(num:Number) : Number
Returns the arctangent of the provided input in radians.
tan(num:Number) : Number
Returns the tangent of the provided input.
cos(num:Number) : Number
Returns the cosine of the provided input.
sin(num:Number) : Number
Returns the sine of the provided input.
char(num:Number) : String
Returns the unicode character at the provided input's code point.
floor(num:Number) : Number
Returns the provided input floored to it's base integer.
range(start:Number, ?end:Number, ?increment:Number) : List[Number]
Returns a list object containing values from the start to the end, incrementing by increment.
round(num:Number, ?decimals:Number) : Number
Returns the provided input rounded to the decimal place provided.
rnd(?seed:Number) : Number
Returns a random float between 0 and 1. If seed is provide, it seeds the random number with the given value.
sign(num:Number) : Number
Returns the sign of the provided input.
sqrt(num:Number) : Number
Returns the square root of the provided input.
str(num:Number) : Number
Converts the provided input into a string.
ceil(num:Number) : Number
Returns the provided input raised to the next or equal integer.
pi() : Number
Returns 3.14159265358979 (this will probably never be useful!)
slice(sequence:Any, from:Number, ?to:Number) : String | List[Any]
Returns the provided string or list from index start to index end.
get_custom_object() :
Returns an empty Map object that can be used to share data back and forth with programs launched with shell.launch.
lan_ip(computer:Computer) : String
Same as Computer.local_ip, but works exclusively with Computer and not Router
public_ip_pc(computer:Computer) : String
Same as Computer.public_ip, but works exclusively with Computer and not Router
delete_mail(metamail:MetaMail, mail_id:String) : Number | String
Same as MetaMail.delete, but works exclusively with MetaMail and no other types
delete_subwallet(subwallet:SubWallet) : Number | String
Same as SubWallet.delete, but works exclusively with SubWallet and no other types
get_balance_subwallet(subwallet:SubWallet) : Number | String
Same as SubWallet.get_balance, but works exclusively with SubWallet and not Wallet
String
String.remove(subString:String) : String
Returns the string without the first occurrence of the provided substring.
String.hasIndex(index:Number) : Number
Returns 1 if the index exists. Returns 0 otherise.
String.indexOf(subString:String, ?startIndex:Number) : Number | null
Returns the first index of the provided input with the string. Optionally searches after begin. Returns Null if not found.
String.lastIndexOf(subString:String) : Number
Returns the last index of the provided input with the string. Returns -1 if not found.
String.split(delimiter:String, ?regexOptions:String) : List[String]
Returns a list object of substrings. Uses regular expressions.
String.replace(old:String, new:String, ?regexOptions:String) : String
Returns the string with any instances of new replaced with old. Uses regular expressions.
String.insert(index:Number, value:Any) : String
Inserts the provided value into the specified index on the string. Returns the updated string.
String.trim() : String
Returns the string stripped of any spacing at the beginning or end.
String.indexes() : List[Number]
Returns a list object containing indexes of all characters in the string.
String.code() : Number
Returns the unicode code point of the first character in the string.
String.len() : Number
Returns the length of the provided object.
String.lower() : String
Returns the lowercase string.
String.upper() : String
Returns the uppercase string.
String.val() : Number
Converts the string to a float.
String.values() : List[String]
Returns a list object containing values of all characters in the string.
String.to_int() : Number
Converts the string to a integer.
String.is_match(pattern:String, ?regexOptions:String) : Number
Returns a boolean dependent on if the string contains the pattern.
String.matches(pattern:String, ?regexOptions:String) : List[String]
Returns a list of every match.
List
List.hasIndex(index:Number) : Number
Returns 1 if the index exists. Returns 0 otherise.
List.indexOf(value:Any) : Number | null
Returns the index of the provided value. Optionally searches after begin. Returns Null if not found.
List.remove(index:Number) : List[Any]
Returns the list without the first occurrence of the provided input.
List.join(delimiter:String) : String
Concatenates all items within the list and returns them in a single string.
List.push(value:Any) : List
Pushes the provided input onto the end of the list. Returns the updated list, and updates the list in it's place.
List.insert(index:Number, value:Any) : List
Inserts the provided value into the specified index on the list. Returns the updated list, and updates the list in it's place.
List.pop() : Any
Returns the last element of the list, and removes that element from the list.
List.pull() : Any
Returns the first element of the list, and removes that element from the list.
List.shuffle() : List
Randomly remaps values in a list, leaving the keys in their original order.
List.reverse() : List
Reverses the list, rearranging the element in reverse order.
List.sort(?key:String, ?ascending:Number) : List
Sorts a list alphanumerically.
List.indexes() : List[Number]
Returns a list object containing the list's indexes
List.len() : Number
Returns the length of the provided object.
List.values() : List[Any]
Returns a list object containing the list's values
List.sum() : Number
Returns the total of all numeric values in a list.
Map
Map.hasIndex(key:Any) : Number
Returns 1 if the index exists. Returns 0 otherise.
Map.indexOf(value:Any) : Number | null
Returns the first index of the provided input with the string. Optionally searches after begin. Returns Null if not found.
Map.push(key:Any) : Map
Pushes the provided input onto the end of the map. Returns the updated map, and updates the map in it's place.
Map.remove(key:Any) : List[Any]
Returns the map without the first occurrence of the provided input.
Map.indexes() : List[Any]
Returns a list object containing the map's indexes.
Map.len() : Number
Returns the length of the provided object.
Map.pop() : Any
Returns the key of the first element in the map, and removes that element from the map.
Map.shuffle() : Map
Randomly remaps values in a map, leaving the keys in their original order.
Map.sum() : Number
Returns the total of all numeric values in a map.
Map.values() : List
Returns a list object containing the map's values.
Blockchain
Blockchain.amount_mined(coinName:string) : Number
Returns an int with the number of units of the coin that have been mined in total.
Blockchain.coin_price(coinName:string) : Number | String
Returns an int with the current unit value of the currency. In case of an error, a string is returned with the details.
Blockchain.create_wallet(username:string, password:string) : Wallet | String
Returns an object of type wallet, used to manage cryptocurrencies. In case of a error, a string is returned with the details.
Blockchain.delete_coin(coinName:string, username:string, password:string) : null
Remove a crypto currency from the world. The credentials used in the creation of the currency are necessary.
Blockchain.get_coin(coinName:string, username:string, password:string) : Coin | String
Returns an object of type Coin used to manage the currency. A string with the details is returned in case of an error.
Blockchain.login_wallet(username:string, password:string) : Wallet | String
Returns a wallet type object or a string in the event of an error, indicating the reason.
Blockchain.show_history(coinName:string) : Map
Returns a map with the latest changes in the value of a specific currency. The Key of the map is the index represented by an int. Value contains a list, where index 0 is the price of the coin it had in the past, index 1 indicates the date on which the price change occurred.
Wallet
Wallet.buy_coin(currencyName:string, quantity:Number, UnitPrice:Number) : Number | String
Publish a purchase offer indicating the number of coins you wish to buy and the price ($) per unit you are willing to pay. The purchase will be finalized if there is any sale offer with a price less than or equal to the one proposed in the purchase. If there is no eligible offer to sell at that time, the offer to buy will remain publicly visible until a new offer to sell satisfies the requirements. If the publication has been successful, true is returned, in case of error a string with the details is returned.
Wallet.cancel_pending_trade(currencyName:string) : null
Cancel any pending offer of a certain coin.
Wallet.get_balance(coinName:string) : Number | String
Returns an int with the number of coins of a given currency. In case of error, a string with the details is returned.
Wallet.get_global_offers(currencyName:string) : Map
Wallet.get_pending_trade(currencyName:string) : List
Wallet.get_pin() : String
Returns a string with a PIN that refreshes every few minutes. This PIN is used to obtain an account in cryptocurrency services.
Wallet.list_coins() : List[String]
Returns a string list with the names of the coins available in the wallet.
Wallet.list_global_coins() : List[String]
Returns a string list with the names of all the currencies that exist.
Wallet.reset_password(newPassword:string) : Number | String
Change the password of the wallet. Only the account owner can change the password. Returns true if the process completed successfully, in case of error a string with the details is returned
Wallet.sell_coin(currencyName:string, quantity:Number, UnitPrice:Number) : Number | String
Publish a sale offer indicating the amount of coins you want to sell and the price ($) per unit you want to assign. The sale will be finalized if there is any purchase offer with a price greater than or equal to that proposed in the sale. If there is no existing offer to buy that matches the requirements at that time, the offer to sell will remain publicly visible until a new offer to buy satisfies the requirements. If the publication has been successful, true is returned, in case of error a string with the details is returned.
Wallet.show_nodes(coinName:string) : Number | String
Returns an int indicating the number of devices mining a specific coin for the same wallet. In case of error a string is returned with the details.
SubWallet
SubWallet.check_password(subWalletPass:string) : Number
Returns true if the credentials are correct, false otherwise.
SubWallet.delete() : Number | String
Delete the account registered in the crypto currency. Returns true on success or a string with the details of the error. It can return false if the account to be deleted does not exist.
SubWallet.get_balance() : Number | String
Returns an int with the amount of coins that the Subwallet has. In case of error, a string with the details is returned
SubWallet.get_info() : String
Returns a string with the information stored by the coin creator
SubWallet.get_user() : String
Returns a string with the username associated with this subwallet
SubWallet.last_transaction() : Map
Returns a list with the information of the last transaction. Index 0 is a string with the other subWallet. Index 1 is an int with the amount. Index 2 is an int with the direction of the transaction (0 Deposit, 1 Withdrawal). Index 3 is a string indicating the date of the transaction
SubWallet.mining() : null
Starts the process of mining the cryptocurrency. The process leaves the terminal busy until a coin is mined, returning true
SubWallet.set_info(info:string) : null
Optional information that the coin creator can store in the Subwallet for any use.
SubWallet.wallet_username() : String
Returns a string with the name of the wallet to which this subwallet belongs.
Coin
Coin.reset_password_coin(newPassword:string) : Number | String | null
Reset the password for this coin.
Coin.create_subwallet(walletID:string, pin:string, subWalletUser:string, subWalletPass:string) : null
Register a new account in the Coin that can be used to manage services such as stores. It is necessary to use the PIN that the owner of the wallet that wants to register has to provide.
Coin.get_address() : String
Returns the configured address that will be shown to users who do not have the currency, indicating where they have to register.
Coin.get_cycle_mining() : Number
Returns an int with the number of hours (game time) that each mining cycle lasts. When a cycle ends, it is decided who gets the reward (1 coin) and the next cycle begins.
Coin.get_mined_coins() : Number
Returns an int with the number of coins that have been mined so far.
Coin.get_reward() : Number
Returns an int with the number of coins that will be received as a reward after each mining cycle.
Coin.get_subwallet(subWalletUser:string) : SubWallet
Returns an object of type SubWallet, in case of error it returns a string with the details.
Coin.get_subwallets() : List[SubWallet]
Returns a list of objects of type SubWallet with all the accounts registered in the crypto currency, in case of error it returns a string with the details.
Coin.set_address(address:string) : null
Configure a valid address that will be shown to users who do not have the currency, indicating where to register.
Coin.set_cycle_mining(rateHours:Number) : null
Assign the hours (game time) that each mining cycle lasts. When a cycle ends, it is decided who gets the reward (1 coin) and the next cycle begins
Coin.set_reward(coinAmount:Number) : null
Assign the reward that miners will receive after each mining cycle
Coin.transaction(origSubWallet:string, destSubWallet:string, amount:number) : Number | String
Make a transaction of the currency between the indicated subwallets. In case of error, a string with the details is returned.
Service
Service.install_service() : Number | String
Installs the necessary files for the correct functioning of the service and starts it. Returns true if the installation has been completed successfully, in case of error a string with the details is returned.
Service.start_service() : Number | String
Start the service and open its associated port on the local machine. The service needs portforward in the router to be accessible from the outside. Returns true if the service has started correctly, in case of error a string with the details is returned
Service.stop_service() : Number | String
Stop the service and close its associated port on the local machine. Returns true if the service has been stopped correctly, in case of error a string with the details is returned
TrafficNet
TrafficNet.camera_link_system() : Number | String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Opens a traffic camera system window with controls to switch between cameras.
TrafficNet.locate_vehicle(licensePlate:String) : Number | String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Searches traffic cameras to see if a vehicle with the specified license plate can be identified. If true, the viewer will switch to the camera. If not, a string indicating an error is returned.
TrafficNet.next_camera() : Number | String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Switches to the next camera.
TrafficNet.prev_camera() : Number | String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Switches to the previous camera.
TrafficNet.traffic_light_config() : String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
[Work in progress] - Wild speculation, but maybe this will let you kill NPCs, or at least delay them from reaching work?
DebugLibrary
DebugLibrary.payload(memoryZone:String, path:String) :
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Returns a list with a single partial object of type Computer if potential zero-day vulnerabilities are found in the specified memory zone. If a file path is provided, its associated partial object of type File will also be added to the list. Additionally, if this file is a library, its metalib object will also be added to the returned list.
DebugLibrary.apply_patch(path:String) : String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Applies the patch with the corrected code to the text file specified in the path. Returns true if the patch has been applied successfully, false otherwise.
DebugLibrary.scan() : String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Scans the library in debug mode to find possible code errors that could lead to a vulnerability. If any potential issues are found, the associated code snippet is printed.
DebugLibrary.unit_testing(errorLines:List[Number]) : String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Automated tests are conducted on the specified lines of code. If potential vulnerabilities are found due to existing errors in these lines, the partial objects that would be obtained by exploiting it are printed, as well as the memory zone affected by the new vulnerability and its details.
SmartAppliance
SmartAppliance.model() : String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Returns the model of the appliance as a string.
SmartAppliance.override_settings(power:Number, temperature:Number) : Number | String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Overrides the power and temp. values of the appliance. Returns true if successful, otherwise returning a string as an error.
SmartAppliance.set_alarm(enable:Number) : Number | String
NIGHTLY BUILD: This function is only available in the nightly (or experimental?) branch of the game. It is subject to change at any time.
Activates or deactivates the sound alarm that indicates if there is any malfunction in the appliance.