These functions are built into the global scope of CursorScript and are available everywhere.
print(args...)- Prints values to the standard output.printError(args...)- Prints values to the error output (usually in red).clear()- Clears the console screen.
rand(min, max)- Returns a random integer betweenminandmax(inclusive).time()- Returns the current system time in milliseconds.
len(val)- Returns the length of a string or array.push(arr, value)- Appends a value to the end of an array.pop(arr)- Removes and returns the last value of an array.shift(arr)- Removes and returns the first value of an array.unshift(arr, value)- Prepends a value to the start of an array.
str(val)- Converts any value to a string string.typeof(val)- Returns the type of the value as a string (e.g., "number", "object", "array", "function", "promise").concat(args...)- Joins multiple values into a single string separated by spaces.
wait(ms)- Returns a promise that resolves aftermsmilliseconds. Must be used withawait. (Alias:sleep(ms))
exit()- Terminates the program immediately.help()- Prints basic language help and version info.