stendhal/doc/mkdocs/lua/objects/properties.md
2023-05-17 02:08:58 -07:00

1.5 KiB


Contents

[TOC]


Introduction

Object instance: properties


Description

Defines functions for accessing Java system properties.


Methods


poperties:enabled

properties:enabled (p)
  • Checks if a property is enabed.
  • Parameters:
  • Returns: (bool) true if enabled.

poperties:equals

properties:equals (p, v)
  • Checks if a property is set to a specified value.
  • Parameters:
    • p: (string) Property name.
    • v: (string) Value to compare with.
  • Returns: (bool) true if the value of the property is the same as v.

poperties:getValue

properties:getValue (p)
  • Retrieves the value of a property.
  • Parameters:
  • Returns: (string) Property value or nil.

Usage Examples

-- example of only executing script contents on test server

if not properties:enabed("stendhal.testserver") then
    do return end
end