Utilities
This page documents miscellaneous functions that don't belong to any library.
getType
function
Returns the name of an object type for a specific object.
Syntax:
string getType( mixed object )
base64Encode
function
Syntax:
string base64Encode( string input )
base64Decode
function
Syntax:
string base64Decode( string input )
friendlyTime
function
Converts number of seconds into human-friendly and readable format.
Syntax:
string friendlyTime( int seconds )
Example:
local time = friendlyTime(3600)
print(time) -- "1 hour"
printInfo
function
Same as the native print
function, except for prepending plugin name and highlighting the message with blue color in the Ratchet console. This message will also be saved to the ratchet.log
file located in the server's folder.
Syntax:
void printInfo( [ string input, ... ] )
printSuccess
function
Same as the native print
function, except for prepending plugin name and highlighting the message with green color in the Ratchet console. This message will also be saved to the ratchet.log
file located in the server's folder.
Syntax:
void printSuccess( [ string input, ... ] )
printWarning
function
Same as the native print
function, except for prepending plugin name and highlighting the message with gold color in the Ratchet console. This message will also be saved to the ratchet.log
file located in the server's folder.
Syntax:
void printWarning( [ string input, ... ] )
printError
function
Same as the native print
function, except for prepending plugin name and highlighting the message with red color in the Ratchet console. This message will also be saved to the ratchet.log
file located in the server's folder.
Syntax:
void printError( [ string input, ... ] )