Adventure Advisor

Bale

Minion
Thank you. I can't imagine why I couldn't find that. Would you be willing to implement it? Please? Surely I'm not the only one who cares?
 

Bale

Minion
Adventure Advisor v 2.6 released!


Changelog:
version 2.6 March 26, 2012
  • Improved Manor logic thanks to the new lastManorUnlock preference
  • Fixed Fun House bug
 
Last edited:

caphector

Member
For some reason the script is aborting it's execution with an unexpected error.

Here is what it prints out in the graphical CLI:

Checking for updates (running Adventure Advisor ver. 2.6)...
You have the latest AdventureAdvisor.txt. Will not check again today.
Unexpected error, debug log printed.
Script execution aborted

What files does it reference that might be causing this error?
 

caphector

Member
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
          KoLmafia v15.1 r10906, Mac OS X, Java 1.6.0_31
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Thu Apr 12 10:43:50 PDT 2012
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.to_url(RuntimeLibrary.java:2067)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:114)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:167)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionReturn.execute(FunctionReturn.java:99)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:95)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:67)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:167)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:105)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionReturn.execute(FunctionReturn.java:99)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:167)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:392)
	at net.sourceforge.kolmafia.textui.parsetree.Expression.execute(Expression.java:221)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:392)
	at net.sourceforge.kolmafia.textui.parsetree.Expression.execute(Expression.java:221)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:392)
	at net.sourceforge.kolmafia.textui.parsetree.Expression.execute(Expression.java:221)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:105)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:167)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.Loop.execute(Loop.java:58)
	at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.executeSlice(ForEachLoop.java:165)
	at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.execute(ForEachLoop.java:110)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:167)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:463)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:369)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:296)
	at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:289)
	at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:109)
	at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:76)
	at net.sourceforge.kolmafia.request.RelayRequest.handleSimple(RelayRequest.java:1629)
	at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1657)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:221)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:184)
	at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:480)
	at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:159)
	at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:132)
 

Theraze

Active member
So one of the $location.to_url() calls is failing? Odd...

Using the 2.6 version, I get the following messages:
Checking for updates (running Adventure Advisor ver. 2.6)...
haunted wine cellar (automatic)
haunted wine cellar (northeast)
haunted wine cellar (northwest)
haunted wine cellar (southeast)
haunted wine cellar (southwest)
Multiple matches against Haunted Wine Cellar.
hidden city (automatic)
hidden city (encounter)
Multiple matches against Hidden City.
post-war sonofa beach
wartime sonofa beach
Multiple matches against Sonofa Beach.
haunted wine cellar (automatic)
haunted wine cellar (northeast)
haunted wine cellar (northwest)
haunted wine cellar (southeast)
haunted wine cellar (southwest)
Multiple matches against Haunted Wine Cellar.
hidden city (automatic)
hidden city (encounter)
Multiple matches against Hidden City.
post-war sonofa beach
wartime sonofa beach
Multiple matches against Sonofa Beach.
Unexpected error, debug log printed.
Script execution aborted
But more matches than you did. Looks like if you try to turn a non-specific location into an url, you get a debug, which makes sense. Your zlib verbosity appears to be set to 0... set that back to 3 and you should get the same log messages as I got. For the rest of it... that's stuff Bale needs to fix up at some point. :)
 

caphector

Member
My zlib verbosity was at three.

I zipped AdventureAdvisor.txt and AdventureAdvisor_caphector.txt and and the issue went away. I can only assume there was an error in one of those files.
 

Theraze

Active member
Yeah, seems sort of like the AdventureAdvisor.txt file isn't supposed to exist anymore. Since after deleting mine (from December 29, 2011) the messages stopped and it displayed the listing properly, but it didn't recreate the AA file.
 

Bale

Minion
Yeah, seems sort of like the AdventureAdvisor.txt file isn't supposed to exist anymore. Since after deleting mine (from December 29, 2011) the messages stopped and it displayed the listing properly, but it didn't recreate the AA file.

Then you have another copy of AdventureAdvisor.txt somewhere in your directory. A datafile will work in the main kolmafia directory as well as most (all?) subdirectories. This script will NOT without the datafile.
 

Theraze

Active member
I have AdventureAdvisor_<character>.txt but no AdventureAdvisor.txt at all in my mafia folder tree.
 

Winterbay

Active member
Yeah, it works in /scripts as well which confused me at one point when I put a file in there for safekeeping while I tested something and didn't get the expected result :)
 

Bale

Minion
I have AdventureAdvisor_<character>.txt but no AdventureAdvisor.txt at all in my mafia folder tree.

remove both "Adventure Advisor" and "map_AdventureAdvisor" from zversions.txt and you'll get a message about downloading a new copy, but you won't find it because it downloads to the same exact spot that you are not finding it.
 

caphector

Member
Mine has NOT reappeared, even after relaunching Mafia. I checked using find:

$ find . -name *AdventureAdvisor* -print
./data/AdventureAdvisor_caphector.txt
./relay/relay_AdventureAdvisor.ash

AdventureAdvisor appears to be running fine at this point despite not having AdventureAdvisor.txt.
 

Bale

Minion
Obviously that is impossible since my script needs the data in AdventureAdvisor.txt to function. You are mistaken about something.
 

Theraze

Active member
Yeah, I'm having the same experience. No clue how it's working. The zversions does have it, so it hasn't been trying to re-download it, but... personally from looking at your script, I see:
Code:
	file_to_map("AdventureAdvisor_"+my_name()+".txt", vars);
Code:
		map_to_file(vars, "AdventureAdvisor_"+my_name()+".txt");
and
Code:
	map_to_file(vars, "AdventureAdvisor_"+my_name()+".txt");

What I never see is any sort of straight AdventureAdvisor.txt loading...
 

Bale

Minion
You didn't see this:

Code:
string mfname = "AdventureAdvisor";

...

void populate_kingdom() {
	// Set Kingdom locations from an external file.
	if(!file_to_map(mfname+".txt",kingdom) || count(kingdom) == 0)
 

fronobulax

Developer
Staff member
You didn't see this:

Code:
string mfname = "AdventureAdvisor";

...

void populate_kingdom() {
	// Set Kingdom locations from an external file.
	if(!file_to_map(mfname+".txt",kingdom) || count(kingdom) == 0)

I did a lot of clean up.

After running and getting
Checking for updates (running Adventure Advisor ver. 2.6)...
Updating AdventureAdvisor.txt from '' to '2012-04-11T00:04:17-05:00'...
...AdventureAdvisor.txt updated.
Requests complete.

the only new file is AdventureAdvisor_cafebabe.txt.

I'd look at the places the map file is being written and verifying that the filenames are what is expected.
 

Theraze

Active member
Ah. Well, despite that, mafia's folders contained no AdventureAdvisor.txt in any of its locations, unless you know of any good reason why
dir advent*.txt /s/a
would fail it. Subdirectories and all files, including hidden and system, should definitely display the file if it exists... Even today:
Checking for updates (running Adventure Advisor ver. 2.6)...
Updating AdventureAdvisor.txt from '2012-04-11T00:04:17-05:00' to '2012-04-11T00:04:17-05:00'...
...AdventureAdvisor.txt updated.
Still doesn't save... think I've got it though. You run map_to_file in the checker, but never file_to_map to actually save it back to the local HD. This section:
Code:
	// Set Kingdom locations from an external file.
	if(!file_to_map(mfname+".txt",kingdom) || count(kingdom) == 0)
		if(!file_to_map("http://zachbardon.com/mafiatools/autoupdate.php?f="+mfname+"&act=getmap", kingdom) && count(kingdom) == 0)
			abort("Kingdom location data is corrupted or missing. Troublesome!");
is why it never gets noticed... comment out the line that emergency-loads from zarqon's server and run it without an AA.txt file and it aborts. Put it back in, and the script runs happy and free, unaware that it doesn't have any local data files.
 
Top