Gkini: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
ArielF (talk | contribs)
m Added to category.
Otutytaqo (talk | contribs)
No edit summary
Line 13: Line 13:




== Functions ==
>== Functions ==


=== ReadInt ===
=== ReadInt ===
'''Definition:'''<br>
'''Definition:'''&lt;br&gt;
ReadInt(string section, string key, int default) -> int value
ReadInt(string section, string key, int default) -&gt; int value
<br><br>
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
'''Description:''' &lt;br&gt;
Read an integer from the given section and key
Read an integer from the given section and key
<br><br>
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
'''Arguments:'''&lt;br&gt;
'''section''' a section of the config file<br>
'''section''' a section of the config file&lt;br&gt;
'''key''' key within a section<br>
'''key''' key within a section&lt;br&gt;
'''default''' value to return if key not found
'''default''' value to return if key not found
<br><br>
&lt;br&gt;&lt;br&gt;
'''Returns:'''
'''Returns:'''
<br><br>
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
'''Example:'''&lt;br&gt;
<source lang="lua">gkini.ReadInt("Vendetta", "showhelpstring", 1) -> 0 -- showhelpstring is ccurrently set to 0</source>
&lt;source lang=&quot;lua&quot;&gt;gkini.ReadInt(&quot;Vendetta&quot;, &quot;showhelpstring&quot;, 1) -&gt; 0 -- showhelpstring is ccurrently set to 0&lt;/source&gt;
<br><br>
&lt;br&gt;&lt;br&gt;




=== ReadString ===
=== ReadString ===
'''Definition:'''<br>
'''Definition:'''&lt;br&gt;
ReadString(string section, string key, string default) -> string value
ReadString(string section, string key, string default) -&gt; string value
<br><br>
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
'''Description:''' &lt;br&gt;
Read a string from the given section and key
Read a string from the given section and key
<br><br>
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
'''Arguments:'''&lt;br&gt;
'''section''' a section of the config file<br>
'''section''' a section of the config file&lt;br&gt;
'''key''' key within a section<br>
'''key''' key within a section&lt;br&gt;
'''default''' value to return if key not found
'''default''' value to return if key not found
<br><br>
&lt;br&gt;&lt;br&gt;
'''Returns:'''
'''Returns:'''
<br><br>
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
'''Example:'''&lt;br&gt;
<source lang="lua">gkini.ReadString("Vendetta", "Username", "dude") -> "hans" -- get the default username from the config file</source>
&lt;source lang=&quot;lua&quot;&gt;gkini.ReadString(&quot;Vendetta&quot;, &quot;Username&quot;, &quot;dude&quot;) -&gt; &quot;hans&quot; -- get the default username from the config file&lt;/source&gt;
<br><br>
&lt;br&gt;&lt;br&gt;






=== WriteInt ===
=== WriteInt ===
'''Definition:'''<br>
'''Definition:'''&lt;br&gt;
WriteInt(string section, string key, int value) -> nil
WriteInt(string section, string key, int value) -&gt; nil
<br><br>
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
'''Description:''' &lt;br&gt;
Write an integer to the given section and key
Write an integer to the given section and key
<br><br>
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
'''Arguments:'''&lt;br&gt;
'''section''' a  section of the config file<br>
'''section''' a  section of the config file&lt;br&gt;
'''key''' key within a section<br>
'''key''' key within a section&lt;br&gt;
'''value''' value of a key as an integer
'''value''' value of a key as an integer
<br><br>
&lt;br&gt;&lt;br&gt;
'''Returns:'''
'''Returns:'''
<br><br>
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
'''Example:'''&lt;br&gt;
<source lang="lua">gkini.WriteInt("Vendetta", "showhelpstring", 1) -- change the showhelpstring option to 1</source>
&lt;source lang=&quot;lua&quot;&gt;gkini.WriteInt(&quot;Vendetta&quot;, &quot;showhelpstring&quot;, 1) -- change the showhelpstring option to 1&lt;/source&gt;
<br><br>
&lt;br&gt;&lt;br&gt;






=== WriteString ===
=== WriteString ===
'''Definition:'''<br>
'''Definition:'''&lt;br&gt;
WriteString(string section, string key, string value) -> nil
WriteString(string section, string key, string value) -&gt; nil
<br><br>
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
'''Description:''' &lt;br&gt;
Write a string to the given section and key. String length is limited to 763 characters.
Write a string to the given section and key. String length is limited to 763 characters.
<br><br>
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
'''Arguments:'''&lt;br&gt;
'''section''' a  section of the config file<br>
'''section''' a  section of the config file&lt;br&gt;
'''key''' key within a section<br>
'''key''' key within a section&lt;br&gt;
'''value''' value of a key as a string
'''value''' value of a key as a string
<br><br>
&lt;br&gt;&lt;br&gt;
'''Returns:'''
'''Returns:'''
<br><br>
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
'''Example:'''&lt;br&gt;
<source lang="lua">gkini.WriteString("Vendetta", "Username", "dude") -- change the Username option to dude</source>
&lt;source lang=&quot;lua&quot;&gt;gkini.WriteString(&quot;Vendetta&quot;, &quot;Username&quot;, &quot;dude&quot;) -- change the Username option to dude&lt;/source&gt;
<br><br>
&lt;br&gt;&lt;br&gt;


[[Category:Tables]]
[[Category:Tables]]
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://itukane.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
----
=[http://itukane.co.cc CLICK HERE]=
----
</div>

Revision as of 10:23, 18 November 2010

These are functions to manipulate the games config file config.ini.

The format of the file looks like this:

[section]
key=value
.
.

value can either be a string or an integer all identifiers are case sensitive



>== Functions ==

ReadInt

Definition:<br> ReadInt(string section, string key, int default) -> int value <br><br> Description: <br> Read an integer from the given section and key <br><br> Arguments:<br> section a section of the config file<br> key key within a section<br> default value to return if key not found <br><br> Returns: <br><br> Example:<br> <source lang="lua">gkini.ReadInt("Vendetta", "showhelpstring", 1) -> 0 -- showhelpstring is ccurrently set to 0</source> <br><br>


ReadString

Definition:<br> ReadString(string section, string key, string default) -> string value <br><br> Description: <br> Read a string from the given section and key <br><br> Arguments:<br> section a section of the config file<br> key key within a section<br> default value to return if key not found <br><br> Returns: <br><br> Example:<br> <source lang="lua">gkini.ReadString("Vendetta", "Username", "dude") -> "hans" -- get the default username from the config file</source> <br><br>


WriteInt

Definition:<br> WriteInt(string section, string key, int value) -> nil <br><br> Description: <br> Write an integer to the given section and key <br><br> Arguments:<br> section a section of the config file<br> key key within a section<br> value value of a key as an integer <br><br> Returns: <br><br> Example:<br> <source lang="lua">gkini.WriteInt("Vendetta", "showhelpstring", 1) -- change the showhelpstring option to 1</source> <br><br>


WriteString

Definition:<br> WriteString(string section, string key, string value) -> nil <br><br> Description: <br> Write a string to the given section and key. String length is limited to 763 characters. <br><br> Arguments:<br> section a section of the config file<br> key key within a section<br> value value of a key as a string <br><br> Returns: <br><br> Example:<br> <source lang="lua">gkini.WriteString("Vendetta", "Username", "dude") -- change the Username option to dude</source> <br><br>