-
Notifications
You must be signed in to change notification settings - Fork 4
Standard Library
using filesystem
Returns the content of a given file.
filesystem.read <file>
Returns a line of the content of a given file.
filesystem.get_line <file> <line>
Returns 1 if the given file/directory exists and 0 if not.
filesystem.exists <file>
Returns 1 if it's a directory, 0 if not.
filesystem.exists <file>
Returns the extension of the given file. (Also works for not existing files)
filesystem.extension <file>
Returns the filename of the given file. (Also works for not existing files)
filesystem.filename <file>
Clears a file and writes the given string into it.
If the file doesn't exist, a new one gets created.
filesystem.write <file> <content>
Appends the given string to the content of the given file.
If the file doesn't exist, a new one gets created.
filesystem.append <file> <content>
Returns the size of the given file in bytes.
filesystem.size <file>
using os
Returns a random number.
os.rand([max],[min])
Returns the current date and time.
os.date()
Halts the program for a given period of time.
os.sleep(<time>)
time
is in milliseconds.
Returns the name of the current operating system.
Names are:
- Windows
- Linux
os.name()
Exits the current program with a given exit code.
os.exit(<code>)
Returns the current MeowScript version
Format: MAJOR.MINOR.PATH
os.version()
Returns the original file that got executed first by the interpreter.
os.origin_file()
Returns 1 if the current file is the origin-file, 0 if not.
os.main_file()
Returns the current filename
os.file()
Clears the console.
os.clear()
Returns a list of all arguments provided to the interpreter when the oringinal file got executed.
$ meow-script main.mws <arg1> <arg2> ...
os.args()
Returns the current unix time stamp.
os.utime()
Returns based of the argument either the seconds, minutes or hours.
os.time("seconds")
os.time("minutes")
os.time("hours")
using math
Returns the bigger one of two numbers.
math.max(<num1>,<num2>)
Returns the smaller one of two numbers.
math.min(<num1>,<num2>)
Returns the square root of a number.
math.sqrt(<num>)
Returns the floor of a number.
math.floor(<num>)
Returns the ceil of a number.
math.ceil(<num>)
Returns the sin() of a number.
math.sin(<num>)
Returns the cos() of a number.
math.cos(<num>)
Returns the sin() of a number.
math.tan(<num>)
Returns the absolute value of a number.
math.abs(<num>)
Returns the log10() of a number.
math.log10(<num>)
Returns the number without any decimals.
math.int(<num>)
Returns a rounded version of a number.
os.round(<num>,<digits>)