Difference between pages "My companion" and "Svn info"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(see also)
 
imported>Bale
(r12215)
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|my_companion}}{{
+
#vardefine:name|svn_at_head}}{{
#vardefine:return_type|string}}{{
+
#vardefine:return_type|record}}{{
  
 
FunctionPage|
 
FunctionPage|
Line 10: Line 10:
 
aggregate={{#var:aggregate}}|
 
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
return_also={{#var:return_also}}
+
return_also={{#var:return_also}}|
 +
parameter1={{Param|string|projectname}}|
 +
p1desc={{Pspan|projectname}} is the name of a project which may exist on an SVN repo|
 
}}|
 
}}|
  
function_description=If your current path is Avatar of Jarlsberg this returns your current companion. If you have no current companion or you are not Jarlsberg's Avatar, then this returns an empty string.|
+
function_description=Provides information about a given project. {{Pspan|projectname}} will match any unique substring of any project in the /svn folder, but it is case sensitive. It returns a record with five fields:
 +
<syntaxhighlight>
 +
record {
 +
  string url;                // The url that the project was checked out from
 +
  int revision;              // The revision that the working copy is at
 +
  string last_changed_author; // The author who committed the last change
 +
  int last_changed_rev;      // The revision that most recently modified this working copy (note, not necessarily the same as revision field)
 +
  string last_changed_date;  // The date/time when lastChangedRevision happened
 +
};
 +
</syntaxhighlight>|
  
 
code1={{CodeSample|
 
code1={{CodeSample|
title=Code Samples|
+
title=Code Sample|
description=Determines Item Drop bonus granted by from Companion.|
+
description=Checks svn repo for a project|
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
if( my_path() == "Avatar of Jarlsberg" ) {
+
print( "To install ChIT, copy/paste the following line into your CLI and hit enter." );
  if( my_companion() != "Eggman" )
+
print( "svn checkout " + svn_info( "mafiachit" ).svn, "blue" );
      print( "You need to equip the Eggman for item drops." );
+
</syntaxhighlight>}}|
  else {
+
cli_equiv=The CLI command "svn list" provides a list of all installed scripts.|
      int drop = 50;
+
see_also={{SeeAlso|svn_exists|svn_at_head}}|
      if( have_skill($skill[Working Lunch]) )
 
        drop += 25;
 
      print( "The item drop bonus from the Eggman is " + drop );
 
  }
 
}
 
</syntaxhighlight>
 
}}|
 
see_also={{SeeAlso|my_familiar|my_thrall}}|
 
 
}}
 
}}
  
[[Category:Your Character]]
+
[[Category:Miscellaneous Functions]]

Revision as of 01:00, 12 November 2014

Function Syntax

record svn_at_head(string projectname )

  • projectname is the name of a project which may exist on an SVN repo

Provides information about a given project. projectname will match any unique substring of any project in the /svn folder, but it is case sensitive. It returns a record with five fields:

record {
   string url;                 // The url that the project was checked out from
   int revision;               // The revision that the working copy is at
   string last_changed_author; // The author who committed the last change
   int last_changed_rev;       // The revision that most recently modified this working copy (note, not necessarily the same as revision field)
   string last_changed_date;   // The date/time when lastChangedRevision happened
};

Code Sample

Checks svn repo for a project

print( "To install ChIT, copy/paste the following line into your CLI and hit enter." );
print( "svn checkout " + svn_info( "mafiachit" ).svn, "blue" );

CLI Equivalent

The CLI command "svn list" provides a list of all installed scripts.

See Also

svn_exists() | svn_at_head()