I read somewhere, I believe, that you were a little unhappy with the state of this script. So, as a sort of introduction-to-ash project, I rewrote it a bit.
It's not really smarter than before , but the code is a little cleaner and takes advantage of some ash features that seem to have been created after the script was written.
In brief:
- Code prepared to use zlib-style version checking on this thread, although you could certainly switch it back to the older style.
- Code prepared to use Map Manager (code actually still relies on local files, as it seemed a bit cheeky to upload things that don't belong to me, for a script that's not mine).
- Uses locdata [int] maps rather than locdata arrays. This enables much nicer looping, and gets rid of the need to track array size.
- Uses sort! This means that map files no longer have to be maintained in a particular order. Which implies that only one map file is actually necessary.
- Abstracted the process of choosing a location into its own function, choose_loc(). It just made achieve() easier to read.
- Likewise abstracted the "do you have an mcd?" functionality out of adjust_mcd() into has_mcd(). The moxie-sign code is Deeply Suspect here as it will hit the server until the beach is open. Maybe it's best to replace it with the meatcar check (which has its own problems, but at least doesn't hit the server). EDIT: Bale has just posted a feature request for beach_available(). I love this forum.
- Changed Bonerdagon and Boss Bat mcd checks to check if the var is >= 0, not > 0. After all, 0 ought to be a legal preference for these.
- The logic of achieve is now (slightly) smarter: it will re-evaluate locations when your buffed moxie or max hp change, as these may allow you into a better zone.
- update_damage() is now called. The change from arrays to maps fixed the wonky looping problem.
- A few unused variables removed. (You could remove okmonster() too, unless you're using it in some other script; it's never called.)
- Removed the part of update_xp() which was setting South of the Beach to 0 xp. If it's so bad, I would argue that it just shouldn't be in the map.
- I also may have gone a little crazy with whitespace and comments as I was working out which bits did what.
I was also curious as to why there was no mcd override setting for the Goblin King, but I left him alone. And the integer division you're doing in okloc() and update_misc() makes me worried, but works out just fine, so I left it.
Testing has been fairly minimal, alas, as my characters are all currently pretty high-level and don't represent all moon signs. What I've tested, however, works fine.
I don't expect, of course, that you'll adopt this whole-cloth. But it was a fun exercise for me, and I hope bits of it may be helpful if you do ever rewrite this script. (Of course, if you did want to snag the whole thing, it would be terribly flattering.)