Script debugging help

StDoodle

Minion
Argh, for the life of me I can't see what I'm doing wrong in this script.

The purpose of the script is to find out which monsters KoLmafia still appears to have incomplete info on, so that I can hardcode them into my fight script. It seems to handle the attack, defense and hp fine, as well as which monsters have incomplete info.

However, there's an additional routine that should be building data on where each monster includes (including every known combat instance). With the map_to_file() functions added for debugging, it seems to be doing this correctly, but then failing somehow to use this information when building the map of "badinfo" monsters... and I can't figure out why not.

Anyone who may be able to take a look and point out the stupid mistake I'm making would be greatly appreciated!
 

Attachments

Does curarea = get_monsters(loc) actually work? I thought we needed to run a foreach over get_monsters() or any aggregate returning function in order to assign them to a map.

For that matter, why bother with curarea at all? Would it be simpler just to foreach i,m in get_monsters(loc) lookupdata[m,loc] = true ?
 
Yeah, I got rid of that for simplicity. ;) That part was working though; however, the flip side wasn't. Specifically, directly passing a map or slice thereof into a field value for a record doesn't seem to work. However, using new record() and omitting the map field didn't cause issues, and after that I used a foreach to load said data. *shrug* Some of the whole "when you can pass maps back and forth and when you can't" is still quite mysterious to me. ;)
 
That bit where you were passing a partial aggregate into a new record() looked weird to me, but I thought it would probably work.

So you got it working now? Great!
 
Back
Top