StendhalScripting/LuaAPI: Difference between revisions

Content deleted Content added
imported>AntumDeluge
ConversationPhrases: example usage
imported>AntumDeluge
add scripting category
 
(7 intermediate revisions by the same user not shown)
Line 65:
 
Defines functions for accessing Java system properties.
 
Methods:
 
; ''<span style="color:green;">properties:getValue</span>(p)''
: Retrieves the value of a property.
: '''''p:''''' (string) Property name.
: '''''returns:''''' (string) Property value or `nil`.
 
; ''<span style="color:green;">properties:enabled</span>(p)''
: Checks if a property is enabed.
: '''''p:''''' (string) Property name.
: '''''returns:''''' (boolean) `true` if enabled.
 
; ''<span style="color:green;">properties:equals</span>(p, v)''
: Checks if a property is set to a specified value.
: '''''p:''''' (string) Property name.
: '''''v:''''' (string) Value to compare with.
: '''''returns:''''' (boolean) `true` if the value of the property is the same as `v`.
 
Examples usage:
 
<pre>
-- example of only executing script contents on test server
 
if not properties:enabed("stendhal.testserver") then
do return end
end
</pre>
 
== game ==
Line 746 ⟶ 774:
* [[StendhalScripting/Lua#Lua_Basics|Lua: Basics]]
* [[StendhalScripting/Lua#Stendhal_Application|Lua: Stendhal Application]]
 
 
[[Category:Stendhal]]
[[Category:Documentation]]
[[Category:API]]
[[Category:Scripting]]
[[Category:Lua]]