Difference between revisions of "Gkini"

From Vendetta Lua
Jump to: navigation, search
m (Reverted edits by Otutytaqo (Talk) to last version by ArielF)
Line 13: Line 13:
  
  
>== Functions ==
+
== Functions ==
  
 
=== ReadInt ===
 
=== ReadInt ===
'''Definition:'''<br>
+
'''Definition:'''<br>
ReadInt(string section, string key, int default) -&gt; int value
+
ReadInt(string section, string key, int default) -> int value
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Read an integer from the given section and key
 
Read an integer from the given section and key
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
'''section''' a section of the config file&lt;br&gt;
+
'''section''' a section of the config file<br>
'''key''' key within a section&lt;br&gt;
+
'''key''' key within a section<br>
 
'''default''' value to return if key not found
 
'''default''' value to return if key not found
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
'''Returns:'''
 
'''Returns:'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&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;
+
<source lang="lua">gkini.ReadInt("Vendetta", "showhelpstring", 1) -> 0 -- showhelpstring is ccurrently set to 0</source>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
 
=== ReadString ===
 
=== ReadString ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
ReadString(string section, string key, string default) -&gt; string value
+
ReadString(string section, string key, string default) -> string value
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Read a string from the given section and key
 
Read a string from the given section and key
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
'''section''' a section of the config file&lt;br&gt;
+
'''section''' a section of the config file<br>
'''key''' key within a section&lt;br&gt;
+
'''key''' key within a section<br>
 
'''default''' value to return if key not found
 
'''default''' value to return if key not found
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
'''Returns:'''
 
'''Returns:'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&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;
+
<source lang="lua">gkini.ReadString("Vendetta", "Username", "dude") -> "hans" -- get the default username from the config file</source>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
  
 
=== WriteInt ===
 
=== WriteInt ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
WriteInt(string section, string key, int value) -&gt; nil
+
WriteInt(string section, string key, int value) -> nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Write an integer to the given section and key
 
Write an integer to the given section and key
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
'''section''' a  section of the config file&lt;br&gt;
+
'''section''' a  section of the config file<br>
'''key''' key within a section&lt;br&gt;
+
'''key''' key within a section<br>
 
'''value''' value of a key as an integer
 
'''value''' value of a key as an integer
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
'''Returns:'''
 
'''Returns:'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&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;
+
<source lang="lua">gkini.WriteInt("Vendetta", "showhelpstring", 1) -- change the showhelpstring option to 1</source>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
  
 
=== WriteString ===
 
=== WriteString ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
WriteString(string section, string key, string value) -&gt; nil
+
WriteString(string section, string key, string value) -> nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
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.
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
'''section''' a  section of the config file&lt;br&gt;
+
'''section''' a  section of the config file<br>
'''key''' key within a section&lt;br&gt;
+
'''key''' key within a section<br>
 
'''value''' value of a key as a string
 
'''value''' value of a key as a string
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
'''Returns:'''
 
'''Returns:'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&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;
+
<source lang="lua">gkini.WriteString("Vendetta", "Username", "dude") -- change the Username option to dude</source>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
 
[[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 18:54, 20 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:
ReadInt(string section, string key, int default) -> int value

Description:
Read an integer from the given section and key

Arguments:
section a section of the config file
key key within a section
default value to return if key not found

Returns:

Example:

gkini.ReadInt("Vendetta", "showhelpstring", 1) -> 0 -- showhelpstring is ccurrently set to 0




ReadString

Definition:
ReadString(string section, string key, string default) -> string value

Description:
Read a string from the given section and key

Arguments:
section a section of the config file
key key within a section
default value to return if key not found

Returns:

Example:

gkini.ReadString("Vendetta", "Username", "dude") -> "hans" -- get the default username from the config file




WriteInt

Definition:
WriteInt(string section, string key, int value) -> nil

Description:
Write an integer to the given section and key

Arguments:
section a section of the config file
key key within a section
value value of a key as an integer

Returns:

Example:

gkini.WriteInt("Vendetta", "showhelpstring", 1) -- change the showhelpstring option to 1




WriteString

Definition:
WriteString(string section, string key, string value) -> nil

Description:
Write a string to the given section and key. String length is limited to 763 characters.

Arguments:
section a section of the config file
key key within a section
value value of a key as a string

Returns:

Example:

gkini.WriteString("Vendetta", "Username", "dude") -- change the Username option to dude