Its quite possible I'm overlooking something basic. I just got into ASH scripting yesterday but I've been over the wiki and read a bunch of information here on the boards but I can't figure out what's wrong with this code.
Here's a short version of the script that produces the error message I'm seeing:
When run, I get the error message "net.sourceforge.kolmafia.KoLmafiaASH$AdvancedScriptException: Invalid type name 'sk' (buff.ash, line 15)"
I've attached buffkeep1.txt in case it provides a necessary clue. Interestingly, if you comment out line 15, the script works properly - I didn't see anything on the wiki or here regarding this error message or the possibility that file_to_map'ed records were read only.
Thank you for taking the time to look this over.
Here's a short version of the script that produces the error message I'm seeing:
Code:
record BuffKeep {
int cost_per_mil; // how much for 100 turns
int min_turns; // minimum number of turns for the buff
int min_buy; // minimum number of turns to buy
int last_turns; // number of turns when starting
int tried_order; // highest order value attempted
};
void main() {
BuffKeep [skill] buffkeep;
file_to_map( "buffkeep1.txt", buffkeep );
foreach sk in buffkeep {
buffkeep[sk].cost_per_mil = buffkeep[sk].cost_per_mil * 10000;
print( "Searching for "+skill_to_string(sk)+"... ("+buffkeep[sk].min_turns+":"+buffkeep[sk].last_turns+":"+buffkeep[sk].cost_per_mil+")" );
}
}
When run, I get the error message "net.sourceforge.kolmafia.KoLmafiaASH$AdvancedScriptException: Invalid type name 'sk' (buff.ash, line 15)"
I've attached buffkeep1.txt in case it provides a necessary clue. Interestingly, if you comment out line 15, the script works properly - I didn't see anything on the wiki or here regarding this error message or the possibility that file_to_map'ed records were read only.
Thank you for taking the time to look this over.