'toledo's tiny tweaks' script collection

toledo

New member
Crimbo 2012 will probably be the last time I play KoL due to real life changes.

I always used and liked mafia and I even wrote some tiny scripts just for myself.
The scripts are offered in this post for you to use, enhance, or just read if you like.

View attachment relay_MediumDrinks.ash - Shamelessly parses the wiki page for the Medium familiar and marks the drinks you already consumed or have in your inventory.

View attachment relay_MonsterManuel.ash - Provides a list of all monsters you have researched casually or thoroughly. Does not list monsters you have not researched at all. Warning: Lots of server hits (27)!

View attachment chatlaunch.ash - My personal TODO list. Feel free to change according to your style. Also adds a direct wiki search box to the right pane.

View attachment game.ash - Changes the frame layout to give the top menu more space by reducing the height of the chat pane.

View attachment main.ash - Adds the notes from the quest log to the main map.

See next post for more...
 

Bale

Minion
Some of those are actually pretty sweet. I'm somewhat impressed by chatlaunch and I'm now using your relay_MonsterManuel to check my factoid gathering. Thanks.
 

Bale

Minion
View attachment 7091 - Provides a list of all monsters you have researched casually or thoroughly. Does not list monsters you have not researched at all. Warning: Lots of server hits (27)!

Taking a look at today's updates:
June 18 - You can now filter Monster Manuel to only show monsters that you have partially researched.

Since I've exhaustively researched over a thousand creatures, my pages of monsters are huge! I wondered if it is it better to have twice as many server hits with only a fraction of the monsters on each page. Well, I ran a test and it seems that hitting each page twice (once for casually researched and a second time for thoroughly) did save 1876 milliseconds. So, for the newer slightly faster version :

PHP:
#Originally written by toledo: http://kolmafia.us/showthread.php?11375-toledo-s-tiny-tweaks-script-collection
# Modified by Bale to allow larger images and make use of KoL update on 18 June 2013

string letters = "abcdefghijklmnopqrstuvwxyz-";
buffer casual;
int numCasual = 0;
buffer thorough;
int numThorough = 0;
buffer page;

void addmon(int i, int numFactoids) {
	page = visit_url("questlog.php?which=6&vl="+letters.char_at(i)+"&filter=" + numFactoids);
	int table = 0;
	int tableEnd = 0;
	while (table != -1) {
		table = page.index_of("<table width=95%>", tableEnd);
		if (table >= 0) {
			tableEnd = page.index_of("</table>", table);
			if (numFactoids == 1) {
				casual.append(page.substring(table, tableEnd + 8));
				numCasual = numCasual + 1;
			}	else if (numFactoids == 2) {
				thorough.append(page.substring(table, tableEnd + 8));
				numThorough = numThorough + 1;
			}
		}
	}
}

for i from 0 to 26 {
	print("Visiting Manuel page "+letters.char_at(i));
	addmon(i, 1);
	addmon(i, 2);

}
replace_string(casual, " width=100></td>", "></td>");
replace_string(thorough, " width=100></td>", "></td>");
write("<h1>" + numCasual + " Casual</h1>");
write(casual);
write("<h1>" + numThorough + " Thorough</h1>");
write(thorough);
 
Last edited:

rlbond86

Member
Sorry to be a thread necromancer, but MediumDrinks has a bug that makes it miss some of the drinks. You need to replace line 14 with

Code:
		if (consumption.index_of(">" + drink + "<") > -1) {

Otherwise, for example, it thinks you've drunk a Mohobo if a Flaming Mohobo is in your consumption history.
 
Top