Skip to reading
Lua Scripting

Helper functions and proxy methods / continued

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Helper functions and proxy methods / continued#

HasVisited(scene_id, character_id = "player")

GetGUIProperty(gui_id, property_name, default_value = nil)

SetGUIProperty(gui_id, property_name, value)

GetGUIElementProperty(gui_id, element_id, property_name, default_value = nil)

SetGUIElementProperty(gui_id, element_id, property_name, value)

IfPlayerWasHere(scene_id)

IfPlayerWasNeverHere(scene_id)

IfVariable(variable_id, expected_value = true)

IfInventoryItemWasUsed(item_id)

IfCharacterMoving(character_id = "player")

EndVisualScript(end_parent = false)

End()

NowUnix()

DateTimeNow(utc = false)

DateTimeString(utc = false, use_space = true)

UnixToDateTime(unix_time, _utc = false)

RegexSearch(pattern, text, all_matches = false)

ReadTextFile(path, default_value = "")

WriteTextFile(path, text)

ReadJSONFile(path, default_value = nil)

WriteJSONFile(path, value, indent = "\t")

FileExists(path)

DirectoryExists(path)

StringLength(value)

StringSplit(value, delimiter = " ", allow_empty = true)

Lower(value)

Upper(value)

Trim(value)

Contains(value, search, case_sensitive = true)

StartsWith(value, prefix, case_sensitive = true)

EndsWith(value, suffix, case_sensitive = true)

Replace(value, search, replacement)

Split(value, delimiter = " ", allow_empty = true)

Join(values, delimiter = "")

Page 43 of 133Permalink
Go to page