PDA

View Full Version : 11.0 (public release) bugs/problems



efilnikufecin
05-02-2007, 01:55 AM
Start a new session, run inv_cleanup get the results expected. Try to run pulvmalldump, nothing happens.

Start a new session, run pulvmalldump it runs as expected up to the point in which it calls inv_cleanup nothing inside inv_cleanup gets executed. Not even the initial Print("using stuff"); statement. "echo call completed, exiting script." does get executed in pulvmalldump, and is the command right after "call inv_cleanup".

Start a new session, run inv_cleanup, runs as expected. Run it again, nothing happens. Run pulvmalldump nothing happens.

Start a new session, run pulvmmalldump runs as expected (except call statement). Run it again, nothing happens. Run inv_cleanup, Nothing happens.

All of the above scripts still generate "unexpected error, Debug log printed" during (the group of) Mallsell statement(s). Kolmafia does not seem to print more than 1 debug log per session, or display such error message more than once per session. Typing this paragraph has caused me to think of commenting out all the mallsell statements. I will try that and edit with the results.

[hr]

Edit: Kolmafia also does not seem to be closing the file it errors on.

[hr]

Edit: the results of the test with a new session, and all mallsell commands removed or commented out starting pulvmalldump which calls inv_cleanup


import complete
creating wads
smashing completed,
dumping items to mall
calling inv_cleanup
UNEXPECTED ERROR. Debug log printed.
call completed, exiting script.


net.sourceforge.kolmafia.KoLmafiaASH$AdvancedScrip tException: Illegal amount of parameters for function file_to_map, got 3, expected 2 (Item_usage.ash, line 15)

Item_usage.ash, line 15, 16, 17, 18:

if (!file_to_map( "itemusage.txt", return_table ))
{
print ("File not loaded, A new file will be created.");
}

It's still file_to_map being called more than once causing the problem?

holatuwol
05-02-2007, 03:24 AM
Kolmafia does not seem to print more than 1 debug log per session, or display such error message more than once per session.
Yeah. In the event of an infinite error generation loop, I'd rather just crash Java than absorb gigabytes of space via debug log. So, KoLmafia prints a maximum of once to the debug log.

This script was really long. o_0 So what I did was I extracted all the data into a map and rewrote your script to see if it would help with the debugging process. I've attached the modified version for your convenience. When I free up some time, the rewritten version is what I'll debug.

efilnikufecin
05-11-2007, 06:23 AM
Yeah. In the event of an infinite error generation loop, I'd rather just crash Java than absorb gigabytes of space via debug log. So, KoLmafia prints a maximum of once to the debug log.


Fair enough



This script was really long. o_0 So what I did was I extracted all the data into a map and rewrote your script to see if it would help with the debugging process. I've attached the modified version for your convenience. When I free up some time, the rewritten version is what I'll debug.


The script is really short now! I was thinking about ways to re-write the script which would make it simpler. This has definitely done that, and I certainly like it! One thing I was unaware of was that kolmafia would accept "mallsell * twinkly wad, * twinkly nuggets, * twinkly powder" or it would have already been added to the list of maps as you did. I had the code written for "mallsell * twinkly wad @ 0, * Twinkly nuggets @ 0" but hadn't implemented it yet since up until a recent version I could not get multiple parameters to work. I think that showed with 1 script having been switched to use them, and the other not.

I want to give you a big thanks for re-writing this! It will save me time in the future because it is really close to what I wanted, and item_cleanup.txt will be simple to add items to, or remove items from!

I just can't describe how much I like the re-write! It will become a model for future scripts which I write as well as being used regularly once it will run!

[hr]

line 36 item_smash.ash "map_to_file( pulverise_data, "pulverise_data.txt" );" needs to be "map_to_file( pulverise_data, "item_smash.txt" );" to match the rename of the file.

[hr]

heh I noticed line 36, but didn't notice line 32 with the same problem[hr]The CLI/GCLI command "session filename" is adding to the file rather than over-writing the file. The result is a 302 error (unexpected redirect to login.php) in programs I use unless I manually delete the file every time, or logout of kolmafia and log into the other.

Edit: Trivial: Changed the error number from 404 to the actual 302, my mind must have been in other places.

hippymon
05-13-2007, 04:11 AM
I am not totally sure what this thread is for, but there are scripts so I am going to try them... What is it for?

efilnikufecin
05-13-2007, 08:06 AM
The scripts move items from inventory to closet, DC, stor, smashes some, and uses some. It tries to do so in the most server friendly way possible. I don't reccomend using it unless you want to hunt down all your stuff if it works.

There's a new problem with build 3761:

UNEXPECTED ERROR. Debug log printed.
java.lang.RuntimeException: Internal error: Cannot assign int [item] to itemset
at net.sourceforge.kolmafia.KoLmafiaASH$ScriptVariabl e.setValue(KoLmafiaASH.java:6364)
at net.sourceforge.kolmafia.KoLmafiaASH$ScriptVariabl eReference.setValue(KoLmafiaASH.java:6429)
at net.sourceforge.kolmafia.KoLmafiaASH$ScriptAssignm ent.execute(KoLmafiaASH.java:7520)
at net.sourceforge.kolmafia.KoLmafiaASH$ScriptScope.e xecute(KoLmafiaASH.java:4234)
at net.sourceforge.kolmafia.KoLmafiaASH.executeScope( KoLmafiaASH.java:2972)
at net.sourceforge.kolmafia.KoLmafiaASH.execute(KoLma fiaASH.java:796)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeScript Command(KoLmafiaCLI.java:2298)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeComman d(KoLmafiaCLI.java:1084)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(K oLmafiaCLI.java:593)
at net.sourceforge.kolmafia.CommandDisplayFrame$Comma ndQueueHandler.run(CommandDisplayFrame.java:247)
at net.sourceforge.foxtrot.AbstractWorkerThread$Abstr actWorkerAction.run(AbstractWorkerThread.java:74)
at java.security.AccessController.doPrivileged(Native Method)
at net.sourceforge.foxtrot.AbstractWorkerThread.runTa sk(AbstractWorkerThread.java:38)
at net.sourceforge.foxtrot.workers.MultiWorkerThread$ 1.run(MultiWorkerThread.java:50)
at java.lang.Thread.run(Unknown Source)

Itemset is type defined as "int [item]"

izchak
05-13-2007, 05:58 PM
Huh. I've got a vaguely similar script to accomplish much the same task as you, efil, although it does it in a slightly different way.
Mine has a separate file for each 'action', smashing, autoselling, displaycasing, and saving for collectors. I keep these data files in my mafia/data directory, although you can keep them elsewhere. *shrug*
Hola's modifications to your script give me an idea for a way to merge all of these separate files into one, although I still need to work on the details of it, seeing as I use some of these separate little files in other scripts of my own already.
Anyways, here is the code I use to handle my item cleanup.


# cleanup inventory type stuff
string cli_queue = "";

boolean DEBUG = false;
void debug(string theString){
if(DEBUG) print(theString);
}
void add_to_cli_queue(item addMe) {
cli_queue = cli_queue + " * " + item_to_string(addMe) + ",";
}
void queue_exec(string starter) {
if(cli_queue == starter) return;
# strip the trailing comma
cli_queue = substring(cli_queue, 0, (length(cli_queue) - 1));
debug("queue follows:");
debug(cli_queue);
debug("this queue will not be processed, since you're debugging");
if(!DEBUG) cli_execute(cli_queue);
}
void check_file(string filename, string action) {
debug("action: " + action);
debug("checking : " + filename);
string [item] listables;
file_to_map(filename, listables);
debug("looping and building the queue");
cli_queue = action;
foreach tempitem in listables {
if(item_amount(tempitem) > 0) {
debug("you have " + item_amount(tempitem) + " " + item_to_string(tempitem));
add_to_cli_queue(tempitem);
}
}
queue_exec(action);
}
void main(){
debug("DEBUG MODE ON");
check_file(my_name() + "_collection.txt", "display put");
check_file("collectors.txt", "closet put");
check_file("smashus.txt", "smash");
check_file("sellus.txt", "sell");
}

As you can see, I have also tried to be as server friendly as possible, what with my queue building up before I call cli_exec() on it...

holatuwol
05-14-2007, 02:44 AM
Funky stacktrace with int [item] and typedefs should be fixed. ... Should be being the key expression. I just modified the appropriate code, but I'm not sure what kind of script I'd need to write to actually test it. ;)

Right now I'm tracking down a really odd bug where mafia seems to run every single .ash script in your folder fairly randomly, which Metraxis reported awhile back.

efilnikufecin
05-14-2007, 12:26 PM
StackTrace is fixed. The script causing the error was your re-write of my inventory cleanup script. Now it's my turn to not have time. I will say that the script is almost working as of version 3765.
It gets up to this point fine:

Updating display case...
Placing items in display case (request 1 of 2)...
Placing items in display case (request 2 of 2)...
For input string: "----"

but I don't know if the error is kolmafia, or the script. I'll post back later when I have time to find out.
[hr]OK I got some better information. The "For input string: "----"" thing was happening on the mallsell command. I modified the script to print the generated command, and here is the output:


mallsell * Angry Farmer candy, * Bit O' Ectoplasm, * Hell ramen, * Imp Ale, * Jumbo Dr. Lucifer, * Knob Goblin firecracker, * Knob mushroom, * Knob sausage, * Knoll mushroom, * Knoll shroomkabob, * Mick's IcyVapoHotness Rub, * Mountain Stream soda, * Tasty Fun Good rice candy, * White Citadel burger, * Yummy Tummy bean, * awful poetry journal, * bat wing, * beertini, * bloody beer, * bloody mary, * boring spaghetti, * bottle of Vangoghbitussin, * bottle of popskull, * bottle of rum, * boxed wine, * broken skull, * bubbly potion, * candy cane, * carob chunk cookies, * carob chunk noodles, * cast, * chaos butterfly, * chorizo brownies, * chorizo taco, * cloudy potion, * cocoa eggshell fragment, * coconut shell, * dark potion, * delicious noodles, * delicious spicy noodles, * disintegrating quill pen, * disturbing fanfic, * dry noodles, * ducha de oro, * effervescent potion, * evil golden arch, * eye of newt, * fizzy potion, * furry fur, * ghuol egg quiche, * ghuol guolash, * gnoll lips, * heavy D, * hellion cube, * hippopotamus skin, * hot wing, * ice-cold Sir Schlitz, * ice-cold Willer, * ice-cold fotie, * inkwell, * lihc eye pie, * little paper umbrella, * magical ice cubes, * margarita, * martini, * marzipan skull, * milky potion, * monkey wrench, * murky potion, * ocean motion, * original G, * papaya sling, * papaya slung, * papaya taco, * penguin skin, * perpendicular hula, * phonics down, * photoprotoneutron torpedo, * plot hole, * probability potion, * procrastination potion, * rat appendix, * rum and cola, * salamander spleen, * salty dog, * salty slug, * screwdriver, * scroll of drastic healing, * scrumptious reagent, * slap and tickle, * sleeping snowy owl, * smoky potion, * snifter of thoroughly aged brandy, * soft green echo eyedrop antidote, * spices, * spicy noodles, * spooky mushroom, * strawberry daiquiri, * strawberry wine, * stuffed spooky mushroom, * super-spikey hair gel, * swirly potion, * tattered scrap of paper, * thin black candle, * tiny house, * tofu casserole, * tomato daiquiri, * useless powder, * vodka and cranberry, * whiskey and cola, * whiskey and soda, * whiskey sour, * white Canadian, * white chocolate and tomato pizza, * wine spritzer, * wussiness potion, * yak skin, * yeti fur

I then for test purpose copied the output, then pasted it as a typed command, and got the following:


> mallsell * Angry Farmer candy, * Bit O' Ectoplasm, * Hell ramen, * Imp Ale, * Jumbo Dr. Lucifer, * Knob Goblin firecracker, * Knob mushroom, * Knob sausage, * Knoll mushroom, * Knoll shroomkabob, * Mick's IcyVapoHotness Rub, * Mountain Stream soda, * Tasty Fun Good rice candy, * White Citadel burger, * Yummy Tummy bean, * awful poetry journal, * bat wing, * beertini, * bloody beer, * bloody mary, * boring spaghetti, * bottle of Vangoghbitussin, * bottle of popskull, * bottle of rum, * boxed wine, * broken skull, * bubbly potion, * candy cane, * carob chunk cookies, * carob chunk noodles, * cast, * chaos butterfly, * chorizo brownies, * chorizo taco, * cloudy potion, * cocoa eggshell fragment, * coconut shell, * dark potion, * delicious noodles, * delicious spicy noodles, * disintegrating quill pen, * disturbing fanfic, * dry noodles, * ducha de oro, * effervescent potion, * evil golden arch, * eye of newt, * fizzy potion, * furry fur, * ghuol egg quiche, * ghuol guolash, * gnoll lips, * heavy D, * hellion cube, * hippopotamus skin, * hot wing, * ice-cold Sir Schlitz, * ice-cold Willer, * ice-cold fotie, * inkwell, * lihc eye pie, * little paper umbrella, * magical ice cubes, * margarita, * martini, * marzipan skull, * milky potion, * monkey wrench, * murky potion, * ocean motion, * original G, * papaya sling, * papaya slung, * papaya taco, * penguin skin, * perpendicular hula, * phonics down, * photoprotoneutron torpedo, * plot hole, * probability potion, * procrastination potion, * rat appendix, * rum and cola, * salamander spleen, * salty dog, * salty slug, * screwdriver, * scroll of drastic healing, * scrumptious reagent, * slap and tickle, * sleeping snowy owl, * smoky potion, * snifter of thoroughly aged brandy, * soft green echo eyedrop antidote, * spices, * spicy noodles, * spooky mushroom, * strawberry daiquiri, * strawberry wine, * stuffed spooky mushroom, * super-spikey hair gel, * swirly potion, * tattered scrap of paper, * thin black candle, * tiny house, * tofu casserole, * tomato daiquiri, * useless powder, * vodka and cranberry, * whiskey and cola, * whiskey and soda, * whiskey sour, * white Canadian, * white chocolate and tomato pizza, * wine spritzer, * wussiness potion, * yak skin, * yeti fur

UNEXPECTED ERROR. Debug log printed.

Debug info:

UNEXPECTED ERROR. Debug log printed.
java.lang.NumberFormatException: For input string: "----"
at java.lang.NumberFormatException.forInputString(Unk nown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at net.sourceforge.kolmafia.StaticEntity.parseInt(Sta ticEntity.java:516)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeAutoMa llRequest(KoLmafiaCLI.java:4024)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeComman d(KoLmafiaCLI.java:1523)
at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(K oLmafiaCLI.java:596)
at net.sourceforge.kolmafia.CommandDisplayFrame$Comma ndQueueHandler.run(CommandDisplayFrame.java:247)
at net.sourceforge.foxtrot.AbstractWorkerThread$Abstr actWorkerAction.run(AbstractWorkerThread.java:74)
at java.security.AccessController.doPrivileged(Native Method)
at net.sourceforge.foxtrot.AbstractWorkerThread.runTa sk(AbstractWorkerThread.java:38)
at net.sourceforge.foxtrot.workers.MultiWorkerThread$ 1.run(MultiWorkerThread.java:50)
at java.lang.Thread.run(Unknown Source)

Edit: And now A little further debugging:
When trying Mallsell 1 item at a time, I get the error when I don't have any of the item, but when I do have the item it works. I believe a simple mod to the script will fix it till kolmafia is fixed.

Edit2: The modification to the script has fixed the problem. Line 45&46 of item_cleanup.ash:

if ( item_actions[key] == "mallsell" && item_amount(key) > 0)
mall_items[key] = maxint;
Just check item_amount before adding the item to the list.

Edit3: Mallsell isn't looping when it has more than 11 items passed to it. It puts 11 of the items into the store, then ignores the rest