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

Irrat

Member
Is it possible that this change is the cause of recent lag spikes?

I can do more investigation on my end, but I've noticed that with a
scriptMRULength
of 30, I was getting large freezes. Setting it to 5 has lowered the freezing.

Not sure of the reason why, but a theory is that it's scanning for called scripts or something to insert into the MRU list.

Anyways, my thoughts on the whole situation is that I'd prefer that the scripts dropdown was as it was originally.
 

AlbinoRhino

Active member
With r26570, I was noticing similar lags today. scriptMRULength = 20.

Each time scriptMRUList was updated (I usually play with logPreferenceChange enabled) there was a 1 to 3 second pause after it was printed to the cli, then the cli would resume logging and things would continue as normal until the next time scriptMRUList changed. I was able to play my entire day's turns as normal and no debug logs were provoked.

I didn't notice any other preference changes causing this delay.

It's a minor issue to me but I thought it may be indicative of something to one of you. Thanks!
 

Ryo_Sangnoir

Developer
Staff member
The presence of scripts you think you didn't "call" is expected or, if you prefer a bug that has not bothered people for several years but should be looked at.
This was fixed at some point during hola's PR. It was one of the reasons I liked it. It has since broken, probably while fixing a different bug (/thing people didn't like) with that change.
 

fronobulax

Developer
Staff member
I have always used the scriptMRU and I noticed lag no matter how I ran a script after the fix that synchronized things in the MRU so that a concurrent modification error did not occur. So there is an opportunity to look for a better fix to that issue.

I saw a whole lot of triangles between Load script... and the beginning of the MRU list this morning so there is IMO a problem with rendering bookmarks and the MRU and perhaps with the scrolling.

As the author, and perhaps only long time user, of the scriptMRU I am very disappointed in its current state and would not recommend using it until it is fixed or the issues otherwise resolved. I believe all of the "new" issues are display related but I believe many things that turn out to be wrong. My approach will be to resolve the display issues first and then address things that have crept into scriptMRUList that perhaps should not be there.

In the meantime if you use r26570, set scriptMRULength to zero and scriptCascadingMenus to true you should get the (old) cascading menus and not the script MRU. I would expect lag to disappear and rendering issues to be easier to diagnose.
 

Malibu Stacey

Active member
In the meantime if you use r26570, set scriptMRULength to zero and scriptCascadingMenus to true you should get the (old) cascading menus and not the script MRU. I would expect lag to disappear and rendering issues to be easier to diagnose.
Tried this out on r26571, this is what it looks like

Screenshot 2022-07-16 102957.png
this is on Windows 10 with with Adoptium 17.0.3+7 JRE. The top arrow disappears when you hover over it but that chunk of dividers is still there.

Also with scriptMRULength set to greater than 0, any script in a subdirectory of the scripts directory will no longer run when clicked from the scripts menu e.g.
Screenshot 2022-07-16 103402.png

That file is in \scripts\i_made_this\ and runs fine if I just type "aftercore_daily" on the CLI or find it using the "Load Script" menu option.

This was working pre-r26569
 

Ryo_Sangnoir

Developer
Staff member
For the mess of arrows and dividers, try closing and reopening Mafia. I could only reproduce it when I changed the preferences in the same session (and it caused other issues, like not all scripts appearing on the menu. It's a weird one).
 

fronobulax

Developer
Staff member
Also with scriptMRULength set to greater than 0, any script in a subdirectory of the scripts directory will no longer run when clicked from the scripts menu e.g.

That file is in \scripts\i_made_this\ and runs fine if I just type "aftercore_daily" on the CLI or find it using the "Load Script" menu option.

This was working pre-r26569

The general idea was that a user initiated a script on some way, after which they could run the script by selecting it from the MRU. Over the years there are several issues bugs or feature requests that have not been acted upon.
  • Some, but not all, scripts called from relay scripts show up on the list even though running them directly makes no sense.
  • Scripts that are invoked by "call" in other scripts show up. Many of those can be called directly and so being on the list is by design but a couple are not and could be filtered out.
  • Scripts that are in a subdirectory of scripts/ may or may not be runnable from the MRU because it is not explicit in managing full paths and so it sometimes cannot find something.
  • It was recently observed that scripts with a semi-colon in the file name will "break" the feature.
There are probably a couple more. Some of these I will almost certainly look at if other people are actually continuing to use the MRU. Some of these would better be considered in a larger context such as a reconsideration of the script install/update/run infrastructure.

So you are confirming an instance of an already known behavior, correct?

When you say working pre-26569 are you saying you were using the scriptMRU and this worked, which is contrary to my experience or were using what is now called the cascading script menu which AFAIK never had this undesirable behavior? The distinction is important because the cascading script menu, then and now, and the scriptMRU don't have a lot of code in common.
 

fronobulax

Developer
Staff member
For the mess of arrows and dividers, try closing and reopening Mafia. I could only reproduce it when I changed the preferences in the same session (and it caused other issues, like not all scripts appearing on the menu. It's a weird one).

I started mafia, looked at the scripts menu, as provided by the script MRU, and saw no dividers while my login script was running. But after it stopped I looked at the menu and had dividers. Scrolling past them gave me what I expected to see. It feels like something (bookmarks?) is being prepended to the top of the list and there is no meaningful data to display. I have not seen it with one character who has scriptMRULength at 30 and 30 entries in the preference. But I have seen it with two characters but not consistently and I haven't had time to see what is repeatable. Major point is that scriptMRUList is not changing while mafia is running nor between restarts of mafia.
 

Malibu Stacey

Active member
So you are confirming an instance of an already known behavior, correct?

When you say working pre-26569 are you saying you were using the scriptMRU and this worked, which is contrary to my experience or were using what is now called the cascading script menu which AFAIK never had this undesirable behavior? The distinction is important because the cascading script menu, then and now, and the scriptMRU don't have a lot of code in common.
pre-26569 I had to use the scriptMRU for that menu to do literally anything. It was listing scripts with their directories & when clicked they would run.
Now, it does not. That's undesirable behaviour. Desirable behaviour would be, the script executing. This has nothing to do with the cascading script menu.

Steps to reproduce:
Set your scriptMRULength value to anything greater than 0.
Create a script which does absolutely anything (print something, whatever) and put it in "scripts\some_directory"
Run it either by typing it out in the cli or using the load script option in the scripts menu.
Run it by clicking on it in the Scripts menu now it's been added to the MRU.
Watch it just fail to do anything because it's trying to find it in "scripts\" rather than "scripts\some_directory"
 
Top