Get version: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
No edit summary
imported>StDoodle
mNo edit summary
Line 30: Line 30:
see_also={{SeeAlso|get_revision}}|
see_also={{SeeAlso|get_revision}}|
}}
}}
[[Category:Miscellaneous]]
[[Category:Miscellaneous Functions]]

Revision as of 16:54, 29 July 2010

Function Syntax

string get_version()

Returns the latest version of KoLmafia pertaining to your current build.

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 ("You are already using the most current version of KoLmafia.", "blue");

See Also

get_revision()

More Information

Note that a revision is distinct from a build in that a revision is a developer-sanctioned release of enough significance as to be promoted for the general public's use. When using a daily build, this function returns the most recent official version.