Script idea for the KoL wiki

GValko

Member
Would it be possible to write a script that when passed an item name would automagically generate a filled out template for that item? The item teplate is fairly standardized, so all I'd really be looking in a log/output would be
Code:
{{item
|itemid=
|descid=
|desc=
...
}}

I'm not really looking at generating the metadata pages, those are fairly easy to do by hand.

Does anyone know if someone's tried to do something like this or would know how to do it?
 

heeheehee

Developer
Staff member
Are you asking for an ASH script, or what?

If so, here's a quick bit of code I hacked together. Uses Zarqon's ZLib.
Code:
import <zlib.ash>
void main(item it) {
	record descid {
		int id;
		item i;
		string plural;
	};
	descid [int] itdesc = file_to_map(itemdescs.txt);
	print("{{item "+it);
	print("|itemid="+it.to_int());
	print("|descid="+itdesc[it.to_int()].id);
	string url = visit_url("desc_item.php?whichitem=721301736");
	print("|desc="+excise(url,"<blockquote>","</blockquote>"));
}

It isn't quite copy-paste format just yet, but it's a start.
 
Last edited:

GValko

Member
Well just an idea on how to work it. I really haven't used maps, so I've always been a bit tenative to use them. I'll get around to playing with it in the next week or two, thanks for the suggestion. (Everything just is about to come up for my studies this week)
 
Top