loathers / garbage-collector

Script for farming meat (and garbage) in 2003 web RPG Kingdom of Loathing
24 stars 59 forks source link

[BUG] Searching for "possessed sugar cube"... eventually ends #2074

Open dapanda1 opened 1 week ago

dapanda1 commented 1 week ago

For as long as I can remember, across multiple versions of garbo and mafia, when I run the command: garbo ascend quickgear workshed "model train set" -1 (this occurs with any way I run the command, this is just what I am currently using) it just keeps looking for a possessed sugar cube. Even though I have already used a sweet tooth, made sure the pref is set and also have 1000+ in my inventory, it continues to search. Today it has completely broken and did not stop searching (I waited about 30 minutes).

I updated all the scripts multiple times today to see if that fixed it. This is the first command of the day, other than mafia's breakfast.

Local Version: 51fd4e1312bbd8eff03b6be74e90c640b85cff4e (built from main@afdb1863c0485533ff0b049260424a294c527552)
Garbo is up to date!
Collecting garbage!

Autoattack is disabled.
CCS set to garbo
hpAutoRecoveryTarget => 0
Preference hpAutoRecoveryTarget changed from 0.0 to 0
mpAutoRecoveryTarget => 0
Preference mpAutoRecoveryTarget changed from 0.0 to 0
valueOfInventory => 2
Preference valueOfInventory changed from 2.0 to 2
maximizerCombinationLimit => 100000
Preference maximizerCombinationLimit changed from 0 to 100000
Stash access is disabled. Ignoring request to borrow "repaid diaper, Buddy Bjorn, Crown of Thrones, Pantsgiving, mafia pointer finger ring, Mayflower bouquet" from clan stash.
Skipping fancy chocolate sculpture; too expensive (54995 > 36500).
Skipping fancy chocolate sculpture; too expensive (54995 > 36500).
Searching for "possessed sugar cube"...
Search complete.
Searching for "possessed sugar cube"...
Search complete.
Searching for "possessed sugar cube"...
Search complete.

Running "garbo simdiet" has the same issue of non-stop searching for cubes

Expected behavior If I have already eaten a sweet tooth, it should ignore possessed sugar cubes as part of the diet. It also should have a cap on the number of searches it does for a sugar cube.

Session Log dapanda_20240906.txt

dapanda1 commented 1 week ago

Have been updating mafia and garbo all day to see if any fixes come in. Same behavior.

Edit: I let it run for 90 minutes and it failed as I had set the sweet tooth usage as true but not actually used one. So it looks like it will finish, it just takes a long time (I ran CONSUME ALL and then garbo with nodiet as I couldn't wait any longer and it ran fine)- (I run this on a raspberry pi so I think it is why it took so long when others report 30 minutes)

Looks like a similar thing has been brought up here: https://github.com/loathers/garbage-collector/issues/2060

horrible-little-slime commented 1 week ago

suppressMallPriceCacheMessages should be suppressing that message--I'm not sure what setting you have that's preventing us from caching mall search results.

Diet calculations have recently gotten longer due to the addition of batfellow consumables. We're looking into it, but they are profitable right now.

dapanda1 commented 1 week ago

image Here are my preferences with the word cache, I think the first result is "Cache mall search terms in mall search interface".

I am guessing the data is stored in the mallprices.txt file of the data folder?

If I have one of each of the batfellow consumables in my inventory, before running garbo, would it stop the searching bug:

Searching for "possessed sugar cube"...
Search complete.
Searching for "possessed sugar cube"...
Search complete.
capncastom commented 1 week ago

phew, not just me with the half hr wait for diet calcs. Glad to hear its on the radar, thanks so much for looking into this!

libraryaddict commented 1 day ago

Running jstack will dump this, which looks very relevant. May be a issue in mafia itself, assuming its not garbo spamming it over and over anyways. Do note that the line numbers are probably not accurate to vanilla mafia

"CommandQueueHandler" #154 [19148] prio=5 os_prio=0 cpu=6206359.38ms elapsed=9185.46s tid=0x000001d2501d2ce0 nid=19148 runnable  [0x000000ba6fbfc000]
   java.lang.Thread.State: RUNNABLE
    at java.util.ArrayList.grow(java.base@21.0.1/ArrayList.java:237)
    at java.util.ArrayList.grow(java.base@21.0.1/ArrayList.java:244)
    at java.util.ArrayList.add(java.base@21.0.1/ArrayList.java:515)
    at net.java.dev.spellcast.utilities.LockableListModel.add(LockableListModel.java:276)
    - locked <0x0000000742d94ae8> (a java.util.ArrayList)
    at net.java.dev.spellcast.utilities.SortedListModel.add(SortedListModel.java:93)
    at net.sourceforge.kolmafia.AdventureResult.addResultToList(AdventureResult.java:962)
    at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.getAvailableIngredients(ConcoctionDatabase.java:1079)
    at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.getIngredients(ConcoctionDatabase.java:2520)
    at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.getIngredients(ConcoctionDatabase.java:2515)
    at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.getIngredients(ConcoctionDatabase.java:2506)
    at net.sourceforge.kolmafia.session.InventoryManager.priceToMake(InventoryManager.java:1313)
    at net.sourceforge.kolmafia.session.InventoryManager.priceToAcquire(InventoryManager.java:1256)
    at net.sourceforge.kolmafia.session.InventoryManager.priceToAcquire(InventoryManager.java:1263)
    at net.sourceforge.kolmafia.session.InventoryManager.priceToAcquire(InventoryManager.java:1198)
    at net.sourceforge.kolmafia.textui.RuntimeLibrary.retrieve_price(RuntimeLibrary.java:5979)
    at net.sourceforge.kolmafia.textui.RuntimeLibrary.retrieve_price(RuntimeLibrary.java:5983)
    at net.sourceforge.kolmafia.textui.RuntimeLibrary.retrieve_price(RuntimeLibrary.java:5987)
    at java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.base@21.0.1/DirectMethodHandle$Holder)
    at java.lang.invoke.LambdaForm$MH/0x000001d2108b9800.invoke(java.base@21.0.1/LambdaForm$MH)
    at java.lang.invoke.LambdaForm$MH/0x000001d210614c00.invokeExact_MT(java.base@21.0.1/LambdaForm$MH)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.base@21.0.1/DirectMethodHandleAccessor.java:155)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.base@21.0.1/DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke(java.base@21.0.1/Method.java:580)
    at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.executeWithoutInterpreter(LibraryFunction.java:104)
    at net.sourceforge.kolmafia.textui.javascript.LibraryFunctionStub.execute(LibraryFunctionStub.java:48)
    at net.sourceforge.kolmafia.textui.javascript.AshStub.call(AshStub.java:141)
    at net.sourceforge.kolmafia.textui.javascript.LibraryFunctionStub.call(LibraryFunctionStub.java:100)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1896)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1078)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:87)
    at org.mozilla.javascript.NativeArray.iterativeMethod(NativeArray.java:2211)
    at org.mozilla.javascript.NativeArray.execIdCall(NativeArray.java:454)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:84)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1896)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1078)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:87)
    at org.mozilla.javascript.NativeArray.iterativeMethod(NativeArray.java:2211)
    at org.mozilla.javascript.NativeArray.execIdCall(NativeArray.java:454)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:84)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1896)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1078)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:87)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime.lambda$executeRun$4(JavascriptRuntime.java:376)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime$$Lambda/0x000001d2106693a8.get(Unknown Source)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime.executeFunction(JavascriptRuntime.java:261)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime.executeRun(JavascriptRuntime.java:353)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime.lambda$execute$1(JavascriptRuntime.java:233)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime$$Lambda/0x000001d210668f48.call(Unknown Source)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:383)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3940)
    at net.sourceforge.kolmafia.textui.javascript.JavascriptRuntime.execute(JavascriptRuntime.java:232)
    at net.sourceforge.kolmafia.textui.AbstractRuntime.execute(AbstractRuntime.java:24)
    at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:196)
    at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:477)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:433)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:352)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:239)
    at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:139)
    at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:117)