ereinion
Member
I wrote the following snippet to list all the clubs I currently have in my inventory:
This works, but I am curious if there is any way to get a list of all available clubs without parsing and searching the descriptions of all the items in my inventory? I assume this information is available to e.g. the modifier-maximizer, since you can specify that you just want to equip clubs there, but I haven't found any way to make this information available to my script.
Code:
void main() {
item it;
buffer it_desc;
matcher club_matcher;
string pattern;
pattern = "Type: <b>weapon \\((\\d+-handed) club\\)<\\/b>";
foreach it in get_inventory() {
if (weapon_type(it) == $stat[muscle]) {
it_desc = visit_url("desc_item.php?whichitem=" + to_string(it.descid));
club_matcher = create_matcher(pattern, it_desc);
if (find(club_matcher)) {
print (it.name + " - " + group(club_matcher, 1), "green");
}
}
}
}
This works, but I am curious if there is any way to get a list of all available clubs without parsing and searching the descriptions of all the items in my inventory? I assume this information is available to e.g. the modifier-maximizer, since you can specify that you just want to equip clubs there, but I haven't found any way to make this information available to my script.