Difference between revisions of "Gkmisc"

From Vendetta Lua
Jump to: navigation, search
m (Added to category.)
(GetGameTime)
Line 68: Line 68:
 
<br><br>
 
<br><br>
 
'''Description:'''<br>
 
'''Description:'''<br>
 +
Similar to os.time(), but returns a value in milliseconds, which doesn't depend on the system's time.
 +
For my system, floor(gkmisc.GetGameTime()/1000) + 1254130450 = os.time()
 
<br><br>
 
<br><br>
 
'''Arguments:'''
 
'''Arguments:'''
Line 75: Line 77:
 
'''Example:'''
 
'''Example:'''
 
<br><br>
 
<br><br>
 
  
 
=== GKGetHostName ===
 
=== GKGetHostName ===

Revision as of 22:38, 20 October 2009

date

Definition:

Description:
print formatted date [1]
same as Os#date but the year is shifted ~2000 years forward (ingame date)

Arguments:

Returns:

Example:

DiffTime

Definition:

Description:


Arguments:

Returns:

Example:


chatfilter

Definition:

Description:


Arguments:

Returns:

Example:


strnatcasecmp

Definition:
Natural Sort Order
Description:

Human readable natural sort order for strings. Similar to strnatcmp(), except that the comparison is not case sensitive. For more information see: Martin Pool's » Natural Order String Comparison page. [2]
Arguments:
(a,b)
Returns:
+1 = left side (a) smaller, 0 = equal, -1 = right side (b) smaller.
Example:
table.sort(my_table, function(a,b) return gkmisc.strnatcasecmp(a,b) < SORT_DIRECTION end

strnatcmp

Definition:

Description:


Arguments:

Returns:

Example:


GetGameTime

Definition:

Description:
Similar to os.time(), but returns a value in milliseconds, which doesn't depend on the system's time. For my system, floor(gkmisc.GetGameTime()/1000) + 1254130450 = os.time()

Arguments:

Returns:

Example:

GKGetHostName

Definition:

Description:


Arguments:

Returns:

Example: