Zlib Variable Manager

Apparently, That FN Ninja and Zarqon just agreed on a format. Now all that's left is for the file containing the descriptions to exist, and for script authors to actually write the descriptions.
 
I just actually gave it a whirl -- it's quite handy! I really like the delete functionality (which is not in ZLib's CLI settings handling).

For improved usability I'd suggest a three-column table (documentation in the third column) and a smaller font for the setting names. I also like the idea of a "show more" link after the first n characters of the description, rather than "show/hide". I don't like needing to click for information -- I want it all visible and easy to read, so I tend to be picky about things like this. :)

I'm quite thrilled that you have taken this further -- it's been sitting in my to-do list forever, making me feel annoyed and incapable. So, thanks.

If you don't mind Ninja, I'll whip up the server-side script and then post a modified version of this script with that functionality added. You can then incorporate that functionality as you like. If you have any implementation issues after that, feel free to ask for changes in the server/script interaction.

Opera is a brilliant application and thanks to its popularity in the mobile arena is finally starting to earn more of the following that it deserves. It's one of the first things I install on any new machine (regardless of OS). I'm quite happy that you have joined our ranks. :)
 
Interesting note -- the delete functionality was available in my original version (well, after several updates, but still before the spinoff scripts appeared). =D

Also, regarding the whole concept of "private" scripts -- wouldn't it be possible to create a function similar to load_current_map() in that it pulls the information from the server, but merges the datafiles, rather than override?
 
why is there no descriptions?
Descriptions?! That's a great idea! Why isn't I think of that? Thanks for the idea icon. ;)

I really like the delete functionality.
Yes, as heeheehee mentioned, all credit for delete functionality being included goes to him. I just didn't like the checkboxes for delete and having to have column headers to explain things so I overhauled the implementation.

For improved usability I'd suggest a three-column table (documentation in the third column) and a smaller font for the setting names. I also like the idea of a "show more" link after the first n characters of the description, rather than "show/hide".

Noted. However, I'm not sure about three columns. When I have a chance I'll whip up a version that has three columns and see how it looks. In the mean time, to have everything visible all that you need to do is click expand all descriptions and you're set.

If you don't mind Ninja, I'll whip up the server-side script and then post a modified version of this script with that functionality added. You can then incorporate that functionality as you like. If you have any implementation issues after that, feel free to ask for changes in the server/script interaction.
Sounds great. I'm to the point where I'm ready to start testing the submission of documentation editing anyways.

vman_edit.PNG
 
Last edited:
It's actually a Mafia property (as Zarqon said), which can be set via "set valueOfAdventure = 1000". Or, y'know, edit your prefs file.
 
I was trying out relay_pref_manager.ash and it all seemed to work perfectly. Very handy ! Thanks. However, each time I loaded the script in the browser, this got printed to the CLI:

Unexpected error, debug log printed.
CCS set to default
(but battle action is currently set to attack with weapon)

The zlib version doesn't do this.

I am curious as to what may be causing this.
 
Yep. Everything seems to work fine too. Filter works. If I change something, it gets changed. Just that weird message whenever the relay page is first loaded.
 
Well, from what it says, it seems to be trying to load/use something that doesn't exist... and whaddya know, I get the same thing now.
Unexpected error, debug log printed.
CCS set to default
and for my log, same:
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
at net.sourceforge.kolmafia.request.RelayRequest.pseudoResponse(RelayRequest.java:443)
at net.sourceforge.kolmafia.request.RelayRequest.sendLocalFile(RelayRequest.java:673)
at net.sourceforge.kolmafia.request.RelayRequest.handleSimple(RelayRequest.java:1448)
at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1463)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:73)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1744)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1696)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

No clue what's causing it now. My suspicion would be somehow tied into the CCS settings, but... looks fine when you actually look at the preference... Hmm...

Edit: Ran the page with debug on, got a 9 meg log. seems this might be it:
[NORMAL] <- void
Entering function check_version
switch
Value: get_property()
Param #1: "_version_prefMan"
[NORMAL] <- "_version_prefMan"
Entering function get_property
Function get_property returned:
[NORMAL] <-
test: version
[NORMAL] <- v0.2
test:
[NORMAL] <-
Eval: create_matcher()
Param #1: "<b>KoLmafia Preference Manager (.+?)</b>"
[NORMAL] <- "<b>KoLmafia Preference Manager (.+?)</b>"
Param #2: visit_url()
Param #1: download
[NORMAL] <- ""
Entering function visit_url
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
at net.sourceforge.kolmafia.request.RelayRequest.pseudoResponse(RelayRequest.java:443)
at net.sourceforge.kolmafia.request.RelayRequest.sendLocalFile(RelayRequest.java:673)
at net.sourceforge.kolmafia.request.RelayRequest.handleSimple(RelayRequest.java:1448)
at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1463)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:73)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1744)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1696)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.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.FunctionCall.execute(FunctionCall.java:104)
at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:101)
at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:451)
at net.sourceforge.kolmafia.textui.parsetree.Switch.execute(Switch.java:153)
at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:451)
at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:129)
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:129)
at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:265)
at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:198)
at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:191)
at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:110)
at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:77)
at net.sourceforge.kolmafia.request.RelayRequest.handleSimple(RelayRequest.java:1435)
at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1463)
at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:453)
at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:143)
at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:120)
Function visit_url returned:
[NORMAL] <- ""
Entering function create_matcher
Function create_matcher returned: <b>KoLmafia Preference Manager (.+?)</b>
Set: <b>KoLmafia Preference Manager (.+?)</b>
[NORMAL] <- "<b>KoLmafia Preference Manager (.+?)</b>"

Looks like it might be the implementation of check_version. It's giving that error when it tries to visit the url.
 
Last edited:
I was trying out relay_pref_manager.ash and it all seemed to work perfectly. Very handy ! Thanks.

You are welcome. :)

Looks like it might be the implementation of check_version

This is because the version tracking for PrefMan wasn't fully implemented. I added it in to v0.3. I still don't know what's going on with the CCS though.

Preference Manager v0.3 Update

Implemented version tracking. Now parses the descriptions of the properties from the KoLmafia wiki.

prefman descs1.PNG
 
From what it seemed from the debug logs, the CCS thing is just that the visit_url ended up with an incorrect check, which screws with the loading of values...

Edit: Okay... checked it out and for some reason, while it can be displayed if you manually run the check, customCombatScript will NOT display... that's why it's showing in the gCLI.

Workaround is to just skip it completely... tell the check not to try to show it, and it'll do everything else. No clue why it's considered different though... forcing it into to_string() did nothing, etc. Ah well. Anyways, workaround code... change this:
PHP:
  if(def == "false" || def == "true")
   set_property(setting, write_check(get_property(setting).to_boolean(), setting, "").to_string());
  else{
   attr("size=50");
   set_property(setting, write_field(get_property(setting), setting, ""));
  }
to this:
PHP:
  if(def == "false" || def == "true")
   set_property(setting, write_check(get_property(setting).to_boolean(), setting, "").to_string());
  else if(setting != "customCombatScript"){
   attr("size=50");
   set_property(setting, write_field(get_property(setting), setting, ""));
  }

Doesn't remove any [current] functionality, as it doesn't display the CCS anyways, just skips trying. If ever it gets figured out why CCS doesn't display, the else if can be changed back to a pure else.
 
Last edited:
Back
Top