bumcheekcity's Easy Snapshot Maker

bumcheekcity

Active member
Nope, please report all bugs you find. There will be many :D

I've decided for the time being that the discoveries can be in a nice green and red table, if only for testing what we have and don't have.
 

Bale

Minion
Perhaps you've already noticed this, but I'll mention it anyway: anything made with Transcendental Noodlecrafting is not a discovery. Since they don't go on the discovery page and don't count towards the trophies, you should remove them from the list of potential discoveries on your site.

If that's already on your to-do list, please ignore.
 

bumcheekcity

Active member
Nope, although I DID realise there were far more cooking discoveries on the site than there are actual discoveries.

I'm currently 2 short on meat pasting, 3 cooking, 6 smithing, and I have two surplus in cocktailcrafting. If anyone figures out what one's I'm missing or shouldn't be included, let me know.
 

Muhandes

Member
Nope, please report all bugs you find. There will be many :D

General:
1. There are several discoveries for which there are two recipes. I don't think you take that into account, or at least the display does not.

Cocktailcrafting:
2. The script decided I don't know how to make any of the Distillations: bottle of rum, bottle of sake, bottle of tequila, bottle of vodka, bottle of whiskey, boxed wine, bottle of gin. I swear I do.
3. number 39 is empty, I don't know what it is.
4. I know both recipes of pebblebräu, yet it is displayed red. Probably because of that nice letter a.

Food
5. I know how to make Knob sausage stir-fry, bat wing stir-fry, concentrated cordial of concentration, evil painful penne pasta, evil spicy noodles, eyedrops of newt, eyedrops of the ocelot, flower petal pie, goat cheese taco, jug of baconstone juice, oil of slipperiness, pressurized potion of perception, rocky road ice cream (both recipes), sausage pizza, spicy enchanted bean burrito, spooky shroomkabob, super salad, tofu stir-fry. The script says I don't.
6. I haven't discovered pressurized potion of pneumaticity, evil eyedrops of the ermine, evil libation of liveliness, evil ointment of the occult, evil tomato juice of powerful power. The script says I did.

Meat Pasting
7. 132 is empty

Smithing
8. 252 is empty
9. I know how to make Frost™ brand sword. Might be confused by the (tm).

And a small request: please add counts.
 
Last edited:

bumcheekcity

Active member
Hmmm. I think I need a rethink of the way that the PHP talks to the maps. Oh joy. My host has decided to disallow remote file reading.
 

ereinion

Member
I get the following error when running the script (while updating the map-files):

Code:
...con_meat.txt updated.
Updating con_smith.txt from '' to '2010-01-29T06:13:51-06:00'...
Unexpected error, debug log printed.

Which according to the debug log is a
Code:
class java.lang.NumberFormatException: 1

Is this a known problem, and if it isn't, is there any additional information you'd like me to add?
 

Veracity

Developer
Staff member
I'd like to see more of the stack trace, please. ASH should not get "Unexpected errors".
Thanks.
 

NardoLoopa

Member
using the 1.2beta
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
            KoLmafia r8029, Windows XP, Java 1.6.0_16
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post these logs in the KoLmafia thread.  If 
 you would like us to look at the log, please instead email logs 
 to veracity@hambo.com using the subject "KoLmafia Debug Log" 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Fri Jan 29 13:45:42 EST 2010
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NumberFormatException: 1
java.lang.NumberFormatException: 1
	at net.sourceforge.kolmafia.utilities.StringUtilities.parseIntInternal1(StringUtilities.java:711)
	at net.sourceforge.kolmafia.textui.DataTypes.parseIntValue(DataTypes.java:221)
	at net.sourceforge.kolmafia.textui.parsetree.Type.parseValue(Type.java:155)
	at net.sourceforge.kolmafia.textui.parsetree.CompositeValue.read(CompositeValue.java:118)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.readMap(RuntimeLibrary.java:3571)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.file_to_map(RuntimeLibrary.java:3543)
	at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:119)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:166)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:303)
	at net.sourceforge.kolmafia.textui.parsetree.Expression.execute(Expression.java:111)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:303)
	at net.sourceforge.kolmafia.textui.parsetree.Expression.execute(Expression.java:111)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:78)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:67)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:451)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:94)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:67)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:451)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:127)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:166)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:451)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:127)
	at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:261)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:194)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:187)
	at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:194)
	at net.sourceforge.kolmafia.textui.command.CallScriptCommand.run(CallScriptCommand.java:63)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:497)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:386)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:191)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:172)
 

bumcheekcity

Active member
Thanks for letting me know. Apparantly this problem is caused by my text editor sometimes saving files in UTF-8 with BOM. The solution is to open them up in Notepad++, and change the file encoding to UTF-8 WITHOUT BOM.

The program loads the map, and then tries to store "1" as an int, which it is not.

So there you go. Should be sorted now. The problem is on my end, Veracity. Not a mafia bug.

For those of you that encountered the problem, re-run the program (no re-download is needed) and it should be fixed.
 

Veracity

Developer
Staff member
Oh, yeah, I could tell that you had a bad data file - but KoLmafia should not throw an exception when reading bad data. I will fix that.
 

bumcheekcity

Active member
Right. I've re-uploaded the script as of now. This allows the double recipes of the bloody beer, green beer and pebblebrau to be recognised. There's also a count of the number of discoveries you have. Which as we all know, might be wrong :p

Bale said:
'Twould be nice. Unfortunately he hasn't gotten skill counts working yet. (It says I have 97 skills hardcore permed, but I don't even have that many ascensions!

It's counting your Mr. Store skills, Olfaction and things like that. Does that account for any discrepancy?
 
Last edited:

notusername

New member
Well, there's an always-accurate count of familiars, tattoos, trophies and crafting discoveries at /questlog.php?which=3. It won't help if your intent is to list how many the script is actually recognizing, and won't fix the skill-count, but if your goal is to just display the right number, it could work... or perhaps a hard-coded comparison for error-checking would work in the meantime. Something like: "You have x[quest log] discoveries out of 100. You seem to be missing y[100 - total detected].".

Perhaps this is not what you are looking for. My compliments on this project, in any event.
 

Bale

Minion
It's counting your Mr. Store skills, Olfaction and things like that. Does that account for any discrepancy?

Silly me. I've got 9 skills that were auto-permed! (88 + 9 = 97) Yep, that's the discrepancy. I only wish I'd mentioned this sooner so that you could have pointed it out long ago.
 

Veracity

Developer
Staff member
You have discovered 132/133 Meat-Pasting recipes.
My snapshot says I have found 130 out of 131

You only have one each of the following:

Staff of Ed Eye of Ed (0) + Staff of Ed, almost (0)
Staff of Ed Staff of Fats (1) + headpiece of the Staff of Ed (1)
makeshift SCUBA gear fishbowl (0) + hosed tank (0)
makeshift SCUBA gear fishtank (0) + hosed fishbowl (0)

You have discovered 139/139 Cocktailcrafting recipes.
My snapshot says I have found 133 out of 137

You only have one each of the following, which explains the 137 vs 139:

rum and cola Dyspepsi-Cola (0) + bottle of rum (1)
rum and cola bottle of rum (1) + Cloaca-Cola (0)
whiskey and cola bottle of whiskey (1) + Cloaca-Cola (0)
whiskey and cola bottle of whiskey (1) + Dyspepsi-Cola (0)

You claim I do not know the following - although I do - which explains the 133 vs. 137

14 bloody beer ice-cold Sir Schlitz (6) + tomato (9)
135 bloody beer ice-cold Willer (0) + tomato (9)
47 green beer ten-leaf clover (0) + ice-cold Sir Schlitz (6)
69 pebblebräu ice-cold Sir Schlitz (6) + floaty pebbles (0)

You have discovered 216/216 Cooking recipes.
My snapshot says I have found 213 out of 213

You only have one each of the following, which explains the 213 vs 216:

pr0n cocktail catsup (0) + pr0n legs (6)
pr0n cocktail ketchup (0) + pr0n legs (6)
plain pizza tomato (9) + flat dough (0)
plain pizza wad of dough (5) + tomato (9)
rocky road ice cream glass of baboon milk (0) + floaty gravel (0)
rocky road ice cream glass of goat's milk (0) + floaty gravel (0)

You have discovered 235/257 Meatsmithing recipes.
My snapshot says I have found 229 out of 251

You only have one each of the following, which explains the 229 vs 235 (and 251 vs. 257):

dripping meat crossbow catsup (0) + basic meat crossbow (0)
dripping meat crossbow ketchup (0) + basic meat crossbow (0)
dripping meat staff catsup (0) + basic meat staff (0)
dripping meat staff ketchup (0) + basic meat staff (0)
dripping meat sword basic meat sword (0) + catsup (0)
dripping meat sword basic meat sword (0) + ketchup (0)
meatloaf helmet basic meat helmet (0) + catsup (0)
meatloaf helmet basic meat helmet (0) + ketchup (0)
gatorskin umbrella goatskin umbrella (0) + gator skin (0)
gatorskin umbrella titanium assault umbrella (0) + gator skin (0)
sticky meat kilt really really sticky spider web (0) + basic meat kilt (0)
sticky meat kilt really really sticky spider web (0) + basic meat skirt (0)

You have discovered 41/41 Jewelrycrafting recipes.

craft.php?mode=discoveries&what=jewelry
 

bumcheekcity

Active member
Thanks, Veracity. Here's the problem. For recipes where there's two options, then the script has to check for the ingredients (hard-coded) as well as the item name. For items with only one recipe, the script just checks for the item name appearing inbetween <b> tags. This means I have part of the script like this:

switch (name)
{
case "bloody beer (Sir S)" :
if (index_of(html, "<b>bloody beer</b> <font size=1><br/>ice-cold Sir Schlitz (0) + tomato (0)</font>") != -1)
{
ret = ret + "|1";
} else {
ret = ret + "|";
}
break;

case "bloody beer (Willer)" :
if (index_of(html, "<b>bloody beer</b> <font size=1><br/>ice-cold Willer (0) + tomato (0)</font>") != -1)
{
ret = ret + "|1";
} else {
ret = ret + "|";
}
break;

So I'm going to need a regular expression that will match:

<b>bloody beer</b> <font size=1><br/>ice-cold Willer (SOMENUMBER) + tomato (SOMENUMBER)</font>

And then I can do the rest. Unfortunately, I'm not (any) good at regular expressions. Can someone help me out by showing how I'd do this in ASH?

Also, and finally, someone might have thousands of an item. In this case, we may need to account for possible commas in the HTML of the page.

Oh, and as a sidenote, I'm going to be changing it to:

switch (name)
{
case "bloody beer (Sir S)" :
regCheck("<b>bloody beer</b> <font size=1><br/>ice-cold Sir Schlitz (0) + tomato (0)</font>");
break;

case "bloody beer (Willer)" :
regCheck("<b>bloody beer</b> <font size=1><br/>ice-cold Willer (0) + tomato (0)</font>");
break;

............

default :
if (index_of(html, "<b>"+name+"</b>") != -1)
{
ret = ret + "|1";
} else {
ret = ret + "|";
}
break;

Where void regcheck(string) is an appropriate function. For obvious reasons.

Edit: What I have so far is:

void regCheck(string checkthis, string html)
{
string checkthis2 = replace_string(checkthis, "(0)", "\\(([0-9]+)\\)");
checkthis2 = replace_string(checkthis2, "<font size=1>", "<font size=1><font size=2>[<a href=\"craft.php?mode=(\\w+)&a=(\\d+)&b=(\\d+)\">(\\w+)</a>]");
matcher reg = create_matcher(checkthis2, html);
if (reg.find())
{
ret = ret + "|1";
print("managed to find " +checkthis2);
} else {
ret = ret + "|";
print("no find " +checkthis2);
}
abort();
}

It doesn't work, even when I have the recipe in question.
 
Last edited:

xKiv

Active member
Code:
string checkthis2 = replace_string(checkthis, "(0)", "\\(([0-9]+)\\)");
checkthis2 = replace_string(checkthis, "<font size=1>", "<font size=1><font size=2>[<a href=\"craft.php?mode=(\\w+)&
a=(\\d+)&b=(\\d+)\">( \\w+)</a>]");

Why are you assigning a value to checkthis2, then never using it and overwriting it with replace_String(checkthis,...)?
 
Last edited:

bumcheekcity

Active member
Typo. It should say checkthis2 there as well, re-overwriting it, if you see what I mean. I fixed that yesterday, but it still didn't work. I hate regex :(
 
Last edited:

xKiv

Active member
So .. what does that print( ... chekThis2) actually print?
And what's the part of the html you want to match (for that particular invocation)?

For example, I don't see any <font size=2> on the discoveries page ... except for recipes that I can craft.

You appear to be using [...] for a non-capturing group (and not even in the correct place), which it isn't. That would be (?:...). [abc...] means "one of a, b, c, ...".
You probably also forgot a ? after the group, so it only matches currently craftable recipes.
It's also better to be on the safe side and replace all spaces with a generic "any blanks here": \s+ ; this should also take care of "smartly" embedded newlines
And you forgot to escape the ? in craft.php?mode=
There may be other characters in need of escapement - I am ot sure about & in particular.

Code:
string checkthis2 = replace_string(checkthis, "(0)", "\\(([0-9]+)\\)");
checkthis2 = replace_string(checkthis, " ", "\\s+");
checkthis2 = replace_string(checkthis, "<font size=1>", "<font size=1>(?:<font size=2><a href=\"craft.php\\?mode=(\\w+)&
a=(\\d+)&b=(\\d+)\">( \\w+)</a>)?");

any better?
 

bumcheekcity

Active member
Yeah. <font size=2> is only there IF you can craft a recipe. So I need to match things like:

<b>tomato juice of powerful power</b> <font size=1><font size=2>[<a href="craft.php?mode=cook&a=246&b=346">cook</a>]</font><br/>tomato (2) + scrumptious reagent (24)</font>

And also:

<b>tomato juice of powerful power</b> <font size=1></font><br/>tomato (0) + scrumptious reagent (24)</font>

For context (and for my reference), I'm testing this on bumcheekcity2 who has:
- Staff of Ed (headpiece)
- plain pizza (flat) [WITH ITEMS]
- plain pizza (wad)

The above code didn't work, and showed no items as found. It translates:

<b>bloody beer</b> <font size=1><br/>ice-cold Sir Schlitz (0) + tomato (0)</font>

to:

<b>bloody\s+beer</b>\s+<font\s+size=1><br/>ice-cold\s+Sir\s+Schlitz\s+\(([0-9]+)\)\s++\s+tomato\s+\(([0-9]+)\)</font>

but by exchanging the second and third lines (as I think we should, but it still doesn't work), it translates to:

<b>bloody\s+beer</b>\s+<font\s+size=1>(?:<font\s+size=2><a\s+href="craft.php\?mode=(\w+)&a=(\d+)&b=(\d+)">(\s+\w+)</a>)?<br/>ice-cold\s+Sir\s+Schlitz\s+\(([0-9]+)\)\s++\s+tomato\s+\(([0-9]+)\)</font>

I have so little regex knowledge, and my knowledge is limited to PHP, which is a little different, that I don't know if this is helpful to you or anyone, but thanks for your help.
 
Last edited:
Top