Skip to main content

LOTJ

LOTJ table holds general utility functions.

date

LOTJ.date() returns the current in-game date.

Example

return LOTJ.date()

dataprog Output:

You boot program '(no subject)' on your datapad.
Program finished. Result: Fri Apr 28 01:26:29 2023

time

LOTJ.time() returns the current in-game time.

stripColor

LOTJ.stripColor(string) removes all color codes from a string.

Parameters

ParameterRequiredDescription
stringYesThe string to remove color codes from.

Example

local str = "&zThis is a &Rcolored&W string.&D"

return LOTJ.stripColor(str)

dataprog Output:

You boot program '(no subject)' on your datapad.
Program finished. Result: This is a colored string.

keywordCheck

LOTJ.keywordCheck(args, keywords) checks if a string matches any of the keywords.

Parameters

ParameterRequiredDescription
argsYesThe string to check.
keywordsYesA table of keywords to check against.

Example

local keywords = {"foo", "bar", "baz"}

return LOTJ.keywordCheck(args, keywords) -- args is passed by dataprog

dataprog Output, using dataprog run 1 foo:

You boot program '(no subject)' on your datapad.
Program finished. Result: true

dataprog Output, using dataprog run 1 qux:

You boot program '(no subject)' on your datapad.
Program finished. Result: false