Get version

From Kolmafia
Revision as of 05:32, 29 July 2010 by imported>Icon315 (Created page with '{{ #vardefine:name|get_version}}{{ #vardefine:return_type|string}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| aggregate={{#var:aggregate}}| r…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

string get_version()

Returns the version of mafia you are currently using.

Code Sample

Will tell you when there is a new version of mafia

string vers = get_version();
string page = visit_url("http://sourceforge.net/projects/kolmafia/files/");
string current = substring ( page, index_of ( page , "Download Now" ) , last_index_of ( page , "View all files" ) );
if (!contains_text( current , vers ))
print ("There is a new version. Go get it here http://sourceforge.net/projects/kolmafia/files/", "red");
else print ("There is not a newer version.", "blue");

See Also

get_revision()