Talk:Get version

From Kolmafia
Jump to navigation Jump to search

The code sample on this page should be redone, as that functionality is already built into KoLmafia. --StDoodle (#1059825) 16:52, 29 July 2010 (UTC)

Yeah i know, i couldn't think of anything else, i can't think of any other reason for this function--Icon315 21:51, 29 July 2010 (UTC)

Since the function returns a string, and get_revision returns an int, it seems like any situation in which you'd like to check compatibility or anything else would be much safer to implement with get_revision. After all, there's no real guarantee that the current version format will be stuck to. (I guess nothing is written in stone, but at least it's fairly unlikely that a check versus an int would completely bork things.) I don't want to complain too much, as I've been wanting get_revision for so very long. But yeah... can't think of anything either. --StDoodle (#1059825) 06:02, 30 July 2010 (UTC)

What I'd want for this function to get any action would be a void header() or something that'd run before checking the rest of the script. Of course, this'd go along with having undefined functions return something specific and a way to capture that, but meh. We'd probably also need some way to jump around a script (to skip defining some functions that are either already defined or implemented into ASH). Wayyyy too many changes to ASH needed for this to be of much use, I'm afraid. And the benefit wouldn't really be worth it, even. --Heeheehee 15:01, 30 July 2010 (UTC)
Regarding the most recent code sample: the scriptwriter would have to be absolutely sure to use "item_name".to_item(), as opposed to $item[item_name], as the latter would result in Bad item value: "item_name" (). --Heeheehee 15:14, 30 July 2010 (UTC)