Utility Script Location names

This Ash scriptlet is meant for those of us who have large scripts which use Location names a lot.

Simply import this script into your script, or copy/paste it to the top of your script.

Usage:
Replace all instances of $location[location name] with the equivalent variable name declared in this script. Later, when kolmafia changes (I'm sure there was a good reason for it) the repair process will be shortened down to just these occurrences (hopefully). If you want to see the real need for this, see cjswimmers softcore ascention script. http://kolmafia.us/index.php/topic,11.0.html Try to fix it for the new versions of kolmafia! Ouch!

Edit: if someone could modify this to use location number instead of name, we might never have to fix this problem again  ;D

Edit2: it's missing a few. I see that I missed the sewer locations, but I'm still trying to figure out the name the newest kolmafia will accept for them.

Edit3: it's still missing a few, but I finally looked at the main interface for the correct name for the sewer adventures. These have been added.
 

Attachments

  • LocNames.ash
    3.6 KB · Views: 104
[quote author=Sprinky link=topic=138.msg667#msg667 date=1146747562]
I am not sure about this. Does this "Location Number" the 'adventure.php?snarfblat="X"' number?
[/quote]

I believe so, The location number can be obtained from the kolmafia source code also.
 

cjswimmer

Member
efilnikufecin, I took your recommendation and added a function to my ascension script to allow for nicknames of locations to be used instead of the actual location references. I took a different approach though. Instead of declaring all the location variables as you did in your file, I wrote a function that takes a string parameter and returns the location object. I was worried that declaring so many variables would be an unnecessary waste of memory. I've mentioned that the original idea was yours in my script.
 
Top