KOL Property Extractor

Lol, the filename is a misnomer. It takes the details.txt file that you've provided a link to, and extracts just the name of the properties.
 

Bale

Minion
I'm not sure what problem to which this is a solution. We've already got a very nice alias that extracts KoLmafia properties for us. We just give a search term and it finds all properties that match the search:

alias pref => ashq record r{string d ; }; r[string,string]m; file_to_map("defaults.txt",m); foreach t,p,d in m if(to_lower_case(p).contains_text(to_lower_case($string[%%]))) print(p+" ("+t+", now '"+get_property(p)+"', default "+d.d+")")

Personally I use a version that can also change those properties:

alias pref => ashq record r{string d;};r[string,string] m; string[int]a; file_to_map("defaults.txt",m); matcher s = create_matcher("(\\w+)(\\s=*\\s*([\\w\\.]+))?",$string[%%]); if(find(s)){foreach t,p,d in m if(to_lower_case(p).contains_text(to_lower_case(s.group(1)))) {print(p+" ("+t+", now '"+get_property(p)+"', default "+d.d+")"); a[count(a)] = p;}if(s.group(2)!=""){if(count(a)==1)set_property(a[0],s.group(3));else print("You do not match exactly one preference!","red");}}else print("Invalid parameters","red");

Does this do something better than that?
 
Whoa! First off, I'm pretty new to the concept of maps, so anything having to utilize them is quite complicated in my opinion. The same goes for records, and especially regular expressions. I wasn't necessarily addressing any problems, just posting a quick and easy tool for anyone looking to get just the names of the properties. The extractor was the result of my needing a way to get the properties from mafia for incorporating them into the auto-completion ash library I have been working on(which now has properties implemented btw). On another note, I also plan on making a version of the ash auto-completion library that incorporates the zlib library.
 

Bale

Minion
Us old timers get a little cranky when we have to run a program to figure out how it improves the status quo. (Which could have been avoided if you'd explained its purpose more clearly.) Sorry if I got any crank on you.
 

Theraze

Active member
Yeah... if I were going to try to extract the properties, what I'd probably just do is save the file to my HD, open in Excel with tab delimiters, and erase all columns past the first. Save, done... and I didn't even have to think about what happens if there's a property with multiple tabs in it. :)
 
That is actually a really good idea. But I modified the code to augment each property so as to make it a simple cut/paste operation to insert each property into the auto-completion file. I just posted a simpler version of the program for general use.
 
Top