since

From Kolmafia
Jump to navigation Jump to search

since xx.y
since rzzzzz

It works with or without a semi-colon and you can use either angle brackets or quotes around the version if desired. You can only use one form or the other. It must go after any script or notify lines you have and before any import lines.

since allows scripts to require a minimum version of KoLmafia before executing. Without it, the script will not run, showing an error message along with the minimum version needed. This can be used to make sure people have a current version that may include new features. There are 2 forms of versioning, point release and revision.

Point releases use the format xx.y and correspond to a full version release, such as 16.5. This form is preferred if your script does not change on a regular basis. For example, you have a script which works with the familiar Baby Z-Rex. Since version 16.5 contains the information for it, you'll only need to make sure people have that version and use since 16.5.

Revisions use the format rzzzzz and correspond to changes made after a point release, such as r14922. This form is preferred if your script requires information not available in the latest point release, such as a new IotM. For example, the familiar Fist Turkey is not included in 16.5 but your script needs information on it. The latest release with up-to-date information is r14921. In that case, you'll want to use since r14921 in your script. When information on the Fist Turkey is updated further, you'll want to use that revision.

Keep in mind this is different than what your version of your script may be. You may update your script daily, but unless you use new data or ASH functions, you generally don't need to touch your since value. When in doubt, use the version you are currently using. If you only use point releases, use the point release version. If you use daily or hourly builds, use the revision version.

Example

The following will run if your version is at least point release 16.5:


since 16.5;  
import <zlib.ash>;

familiar test_subject=$familiar[Baby Z-Rex];
if(have_familiar(test_subject))
     print("Your "+test_subject+"'s name is "+test_subject.name);
else print("You don't have a "+test_subject);


The following will run if your version is at least revision r14921:


since r14921;  
import <zlib.ash>;

familiar test_subject=$familiar[Fist Turkey];
if(have_familiar(test_subject))
     print("Your "+test_subject+"'s name is "+test_subject.name);
else print("You don't have a "+test_subject);