Bug - Not A Bug r26560 - Scripts menu missing user scripts

matt.chugg

Moderator
In the latest version, all the scripts that would normally be listed are missing

1657793530329.png

I've verified that the scripts are present (files exist in /scripts/), and are still runnable from the CLI and that this issue doesn't exist in r26558 and earlier
 

Irrat

Member
I think this effects maximizer as well, meant to test it after breaking the prism but basically it doesn't remember the last maximizer string used.
 

fronobulax

Developer
Staff member
The absence is deliberate. If you didn't have scriptMRULength set to something positive then you get the functionality that you had before by using the Load Script option.

If scriptMRULength was positive then this is possibly a real bug. I'm in the process of tracking down some concerns.
 

Veracity

Developer
Staff member
I think this is a side-effect of the change made in r26559 and was detailed here. I admit that I didn't expect it to completely empty the Scripts menu.
I wouldn’t say it was a “side effect”. Removing the unwieldy display of every single file in and below your “scripts” menu was intentional.

So, perhaps it should show some scripts but not all. The scriptMRU list - which I do not use - is one way to do that.

What if there was a way for the user to specifically choose which scripts are important enough to not have to lookup every time with a File Picker? We’d need a GUI for that. Something to let us create “Bookmarks”.

Wait. We have that.

Huh. What if all “file” bookmarks (which have to be in one of the supported directories for scripts, or a sub-directory) (and which you can order to your taste) got added to the Scripts menu?

I just thought of this.

This is why I solicited suggestions and bug reports. “The behavior changed” is not a good bug report. “The new feature is not working as intended” is a good bug report. “I miss such-and-such and here is an idea to get the essence of what I miss” is a good suggestion.
 

matt.chugg

Moderator
> get scriptMRULength

0

> set scriptMRULength =10
scriptMRULength => 10
Preference scriptMRULength changed from 0 to 10

It looks like I wasn't using scriptMRU, I've set it and the everything makes sense now.

This is why I solicited suggestions and bug reports. “The behavior changed” is not a good bug report. “The new feature is not working as intended” is a good bug report. “I miss such-and-such and here is an idea to get the essence of what I miss” is a good suggestion.

If in reference to my initial report then you have my apologies, I wasn't aware of the new feature and I hadn't read enough on the previous pathc notes before making the bug report otherwise I would have submitted as a question rather than a bug report, I did change it to not-a-bug as soon as I realised.

For my personal way of using mafia this update is going to be 100% positive now I know I can use MRU list still I don't run enough different scripts to require bookmarks as a new feature and having the subdirectory parts of things like autoscend or utility libraries like zlib.ash no longer appearing in the list makes perfect sense
 

Veracity

Developer
Staff member
Frono invented the scriptMRUlist.

I suggest that he make it configurable via preferences, rather than just via the gCLI. :D
 

fronobulax

Developer
Staff member
Frono invented the scriptMRUlist.

I suggest that he make it configurable via preferences, rather than just via the gCLI. :D

:)

Noted.

Tangentially, my runs are taking forever today so I haven't answered my own questions yet, but so far I have seen:
  • The scriptMRU list fail to update in the GUI. No matter what I did, it remained the same. I think that was because I changed the length and did not restart KoLmafia :)
  • I have seen duplicate entries in the list as displayed. I have not investigated whether this is a display problem or a problem in maintaining the preference.
  • I have not seen scripts I thought had run show up in the list. I think that is an error in my expectations since I might not actually be calling the missing scripts for every character, but if I am it may be a display issue.
 

katyarn

Member
What number do you need to set scriptMRULength to? I tried setting it to 1 and saw no change in the scripts menu after closing and re-opening KoLMafia. Likewise saw no change after setting it to 10.

How do you add folders to the scripts menu?
 

fronobulax

Developer
Staff member
I have scriptMRULength set to 30 since that is the longest the list can be on my screen without scrolling.

At the moment, if you change it and want to see changes then you should shut down mafia completely and restart it.

I don't know what you mean or want by adding folders to the scripts menu. You are supposed to be able to run whatever the entries there are and I don't know how to run a folder.

It is an outstanding feature request to fix the following problem. The priority should probably be raised.

If you have /scripts/katyarn/myScript,ash and you run it from the Load Scripts menu it will appear on the MRU list as myScript. If you try and run from the MRU menu it will fail because it looks for /scripts/myScript.ash.
 

katyarn

Member
I completely closed mafia and re-opened it and saw no changes after increasing scriptMRULength.

By add a folder I meant add one to the bookmarks menu.
 

katyarn

Member
This is what I'm currently seeing on r26561:

1657818341431.png

1657818355284.png

1657818363685.png

Am I missing something? I have fully closed and re-opened KoLMafia multiple times without any luck at getting it to populate the menu with entries.
 

Veracity

Developer
Staff member
Bookmarks are things that you manually create with Preferences/Bookmarks.
These are what will appear on the Bookmarks menu.
The scriptMRUList starts out empty and gets populated when you start running scripts.
As you have it configured, it will remember the last 10 scripts you ran.
But until you run a script, it has nothing to remember.
 

fronobulax

Developer
Staff member
The scriptMRU is populated by running scripts. Select something using "Load script..." and run it. If things are working as expected then you should see that script listed under the phrase "Load script..."

If you don't please stand by because I want to confirm things still work as I expect.
 

fronobulax

Developer
Staff member
Okay, how do we go back to the previous behavior?

You don't. You complain a lot and hope others agree with you and then something gets reverted or added back in.

In the meantime, what is it you did from the old display that you cannot do using "Load script...". I couldn't think of anything which is one of the reasons I was OK with the change.

Also a little patience would be appreciated since I am seeing things I did not expect from the new code and you may be seeing a manifestation of a bug and not the intended behavior.
 

katyarn

Member
Okay, I found having folders to organize scripts to be a useful tool which would put them into submenus in the scripts menu. Is that functionality removed?
 

fronobulax

Developer
Staff member
  • The scriptMRU list fail to update in the GUI. No matter what I did, it remained the same. I think that was because I changed the length and did not restart KoLmafia :)
  • I have seen duplicate entries in the list as displayed. I have not investigated whether this is a display problem or a problem in maintaining the preference.
  • I have not seen scripts I thought had run show up in the list. I think that is an error in my expectations since I might not actually be calling the missing scripts for every character, but if I am it may be a display issue.

The update failure seems to be the result of inadvertently setting scriptMRULength to zero. That did not cause the GUI to refresh and so the list appeared not to change. I'll think about that as I make the preference GUI visible.

I confirmed duplicate entries actually in the preference so answer ting why is of interest.

I am still investigating "missing scripts" but am inclined towards thinking that is operator error.
 
Top