PDA

View Full Version : Ascension counts



ckb
02-20-2011, 10:46 PM
I wanted an easy count of all the ascentions I have done, parsed by class. I am upto 185 now, and I have nearly all the skills, so I want to choose a class I may have been neglecting. I did this quick, and it could probably be more efficient, but it parses the html from ascensionhistory.php?who="+my_id() AND ascensionhistory.php?who="+my_id()+"&prens13=1

This is version 1.0, and it just spits on class and # of runs.
I might add HC vs. SC later... or paths... maybe. If someone else does it for me, that would be cool too. ;)

Feel free to use it, modify it, steal it, whatever. If you are bcc and want to add this info to your snapshot maker, that would be dope.

Note that it lists two total numbers, one is a sum of all the runs counted, and one is my_ascensions() - these may be different if you suffered through white wednesday. If they are wrong for another reason (or if something else is wrong) let me know - I have only tested it with my main.

Enjoy,
ckb

Grotfang
02-21-2011, 02:18 PM
Not going to do it for you, but the following gives you a nice framework to build ascension summaries from. The matcher (+ documentation beneath) are the main things to note, but I include an example of how to build a summary similar to the one you produce above.


int [string] classCount;

matcher mat = create_matcher( "<td class=small valign=center>(\\d+) &nbsp;&nbsp;</td><td height=30 class=small valign=center>(.+?)&nbsp;&nbsp;</td><td class=small valign=center><span title=\"Level at Ascension: (\\d+)\">(\\d+)</span> &nbsp;&nbsp;</td><td class=small valign=center><img src=\"http:\/\/images.kingdomofloathing.com/itemimages/(.+?).gif\" width=30 height=30 alt=\"(.+?)\" title=\"(.+?)\"></td><td class=small valign=center>(.+?)&nbsp;&nbsp;</td><td class=small valign=center><span title='Total Turns: (.+?)'>(.+?)</span></td><td class=small valign=center><span title='Total Days: (.+?)'>(.+?)</span></td><td>(.+?)</td><td class=small valign=center>(.+?)</td>" ,
visit_url( "ascensionhistory.php?back=self&who=" + my_id() ) + visit_url( "ascensionhistory.php?who=" + my_id() + "&prens13=1" ) );
/*
group 1 = asc no
group 2 = date
group 3 = level at ascension
group 4 = level
group 5 = class img
group 6 = class name
group 7 = class name
group 8 = sign
group 9 = total turns
group 10 = turns
group 11 = total days
group 12 = days
group 13 = familiar info
group 14 = restrictions
*/
while( mat.find() )
{
switch( mat.group( 6 ) )
{
case "Seal Clubber":
classCount["Seal Clubber"] = classCount["Seal Clubber"] + 1;
break;
case "Turtle Tamer":
classCount["Turtle Tamer"] = classCount["Turtle Tamer"] + 1;
break;
case "Pastamancer":
classCount["Pastamancer"] = classCount["Pastamancer"] + 1;
break;
case "Sauceror":
classCount["Sauceror"] = classCount["Sauceror"] + 1;
break;
case "Accordion Thief":
classCount["Accordion Thief"] = classCount["Accordion Thief"] + 1;
break;
case "Disco Bandit":
classCount["Disco Bandit"] = classCount["Disco Bandit"] + 1;
break;
default:
break;
}
}

foreach i in classCount
{
print( i + ": " + classCount[i] );
}

slyz
02-21-2011, 03:10 PM
while( mat.find() ) classCount[ mat.group( 6 ) ] += 1 ;

takes less typing :p

kain
03-03-2011, 01:45 PM
neat

-edit- much less impressive if you make me break out HC/BM runs ... what, I totally didn't do ONLY the bare minimum.

CLASS - TOTAL RUNS - HARDCORE - BADMOON
Seal Clubber - 29 - 3 - 1
Turtle Tamer - 43 - 3 - 1
Pastamancer - 47 - 4 - 1
Saucer - 70 - 3 - 1
Disco Bandit - 34 - 7 - 1
Accordion Thief - 48 - 6 - 1

total # runs counted = 271
total runs done = 271

slyz
03-03-2011, 09:45 PM
Showoff ^^

Bale
03-03-2011, 10:06 PM
That IS very impressive. Mine is not nearly so awesome.


Seal Clubber runs = 21
Turtle Tamer runs = 24
Pastamancer runs = 20
Saucer runs = 19
Disco Bandit runs = 25
Accordion Thief runs = 31
total # runs counted = 140
total runs done = 140

I'm a bit surprised that Sauceror is the least common. I guess it's because I took a while to warm up to them, so they lacked in my early career. ATs are the most common because I'm lazy.

slyz
03-03-2011, 10:41 PM
I'm a pretty lazy player (but when I ascend, I really try to make it count!)

Seal Clubber runs = 8
Turtle Tamer runs = 7
Pastamancer runs = 6
Saucer runs = 9
Disco Bandit runs = 8
Accordion Thief runs = 15
total # runs counted = 53
total runs done = 52
Now that I'm almost done perming the sauce spellslinging suit, I think half my runs will be S from now on.

Winterbay
03-04-2011, 01:59 PM
Seal Clubber runs = 18
Turtle Tamer runs = 11
Pastamancer runs = 7
Saucer runs = 12
Disco Bandit runs = 7
Accordion Thief runs = 9
total # runs counted = 64
total runs done = 67

I wonder why I've done so many SC runs when I find Myst classes so much more fun to play...

slyz
03-04-2011, 02:04 PM
Hellseal levelling for basementing?

Winterbay
03-04-2011, 02:05 PM
I think I've only done two hellseal powered basement runs and the one I just did was the second one. Most basement runs have been done while I was gunning for those pesky level 30 trophies anyway.

ckb
03-04-2011, 04:11 PM
I might add HC vs. SC later... or paths... maybe. If someone else does it for me, that would be cool too. ;)


Hey, I did go an add some more details. It would look better if it used a monospaced font in Kolmafia, but it is easy enough to read as it is. I added the new version to the first post.

Oh, and here's my results:



CLASS - TOTAL RUNS - HARDCORE - BADMOON
Seal Clubber - 32 - 27 - 2
Turtle Tamer - 27 - 26 - 1
Pastamancer - 26 - 24 - 1
Saucer - 33 - 29 - 1
Disco Bandit - 31 - 28 - 1
Accordion Thief - 37 - 29 - 1
total # runs counted = 186
total runs done = 187


ckb

StDoodle
03-04-2011, 05:33 PM
You could always use print_html() and use tables. ;)

fronobulax
03-04-2011, 06:07 PM
CLASS - TOTAL RUNS - HARDCORE - BADMOON
Seal Clubber - 15 - 15 - 1
Turtle Tamer - 9 - 8 - 1
Pastamancer - 10 - 10 - 1
Saucer - 12 - 11 - 1
Disco Bandit - 10 - 10 - 1
Accordion Thief - 6 - 5 - 1
total # runs counted = 62
total runs done = 62

Thanks. I am wondering about Seal Clubber, Pastamancer and Disco Bandit where the HC + BM > Total. This (http://www.koldb.com/player.php?name=cafebabe) agrees with the total of 62 runs, but I haven't had time to figure out what might be wrong.

Theraze
03-04-2011, 06:14 PM
Seal Clubber is 15+1=15. One of those might be the current run...

heeheehee
03-04-2011, 11:31 PM
I'd say more likely is that BM is a subset of HC (so counted as both HC and BM, but only counted once toward the total), and there are some runs which were SC, so that's why the total isn't always equal to HC.

ckb
03-04-2011, 11:52 PM
I'd say more likely is that BM is a subset of HC (so counted as both HC and BM, but only counted once toward the total), and there are some runs which were SC, so that's why the total isn't always equal to HC.

Yup. BM is both BM and HC, so it counts as both. I could change this I suppose... but it is in line with the total - sub - sub line of thought I had going.


And thanks for the print_html() tip StDoodle. Maybe I will pretty it up a bit.

OK, there - are you happy now. You made me make it look awesome. versions 3 up on post 1

ckb