crimbo script

taltamir

Member
I have been working on a crimbo automation script. Have been updating it every day as more content comes out.
check the dropdown menu at top right of the relay browser and select crimbo. configure the options, then run the script. either from dropdown menu of scripts (be prompted to type in number of adv to spend) or via gCLI using

crimbo21 [adv]
replace [adv] with integer of number of adv you want to spend.

 
FYI: With r26070 I had autoscend installed and ran the svn update command prior to installing this script. When I ran "crimbo" from the drop down menu in the relay browser I got this:

Function 'buffMaintain( effect )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (crimbo21.ash, line 217, char 3 to char 15)

I then ran
svn delete autoscend
and got this
Starting Checkout...
Validating repo...
The requested repo (/Loathing-Associates-Scripting-Society/autoscend/branches/master/RELEASE) failed validation.
Done.

Uninstalling the crimbo21 script and reinstalling without autoscend installed, worked as crimbo21 installed autoscend as a dependency.
A little puzzling but the script now runs. I'll check it out and thank you.

Edit: It works as "described on the label". No issues at all once I got it running.

Looking forward to it being updated for future Crimbos.
 
Last edited:
Uninstalling the crimbo21 script and reinstalling without autoscend installed, worked as crimbo21 installed autoscend as a dependency.
A little puzzling but the script now runs. I'll check it out and thank you.
huh. that is pretty odd.
I think maybe I should remove autoscend as a dependency and just make a note on the site to install autoscend seperately first?
Edit: It works as "described on the label". No issues at all once I got it running.

Looking forward to it being updated for future Crimbos.
Glad to hear it.
 
I added the ability to (must manually opt in) spend your gooified matter in the gift shop automatically.
Check the GUI if you are interested.
 
Just as a data point in case anyone else has this particular problem, I was receiving the following when running the relay script:

Function 'buffMaintain( effect )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (crimbo21.ash, line 234, char 3 to char 15)

It did not go away when updating mafia, but after deleting and reinstalling autoscend it appears to be working fine now.
 
If anyone feels like debugging what is going on that might lead to a fix or at least an instruction to scripters.

My hypothesis is that buffMaintain(effect) is in a newer version of autoascend than the version installed on the user's machine. The dependency checking probably does not recognize a newer version of the dependency is available. Hypothesis is also that users who auto update all installed scripts on login do not see this problem.
 
Hypothesis is also that users who auto update all installed scripts on login do not see this problem.
Unfortunately this part is not the case (as I do have it set to update on login), which I believe may be part of the nebulous issue I've seen mentioned elsewhere with the svn update process not always properly updating a given script.
 
Mafia uses svn to access to git repositories instead of using git natively.
Ever since autoscend renamed its main branch from beta to master github developed an unfixable (no user exposed method to touch it) fault that is messing up the ability of mafia to keep it up to date. necessitating regular uninstalls and reinstalls by the user to manually keep it up to date.
This has to do with a faulty svn-git bridge on github combined with the fact that mafia does not natively support git and instead uses svn to access all git repos.

As far as I can tell. mafia has issues updating scripts from git repos who use a specific branch address other than trunk. And trunk has been unreliable since the rename so we moved on to using a specific branch address. Edit: non trunk names seem to work on a mirror setup specifically for that purpose. so the break seems to be localized to the LASS/autoscend repo

people who do have "update all scripts on login" will see this error as well as their autoscend is likely outdated.
I have removed autoscend from dependency list of crimbo and instead included an actual version check for autoscend on script startup that will abort with a message instructing the user to manually update autoscend. reinstalling it if need be. or install it if version is 0.

As for fixing the issue. some people are talking about native git implementation in mafia which would solve this. Or github might one day suddenly decide to fix the problem with the svn bridge on their side.

One of the ways autoscend has been handling it is by making a fork that automatically pulls all changes and having people install it instead
 
Last edited:
As for fixing the issue. some people are talking about native git implementation in mafia which would solve this. Or github might one day suddenly decide to fix the problem with the svn bridge on their side.
The internet finds people reporting that bug to GitHub in 2012, and getting an acknowledgment. It was along the lines of "the maintainers at CollabNet say this field is mandatory, but the GitHub bridge doesn't included it on subdirectories."

I have proof of concept code in my BadHorseMonkey fork on a branch. I don't think I've worked on in months, but the basic "check out with JGIT" works.

I am stuck on how much to do to replicate the existing model that SVN follows (including the flat filename space, which was a design trade-off that has does not scale well for large script projects) vs. allowing more flexibility in script locations by using relative paths.

And if I do provide a way to modernize, how do I make sure it all still works with scripts that stay in SVN, are abandoned but still useful, etc.

I will revive my efforts in 2022, break it up into chunks that are not daunting to me, and invite collaboration. It is doable, just not done. That's on me.
 
Last edited:
Ever the curmudgeon I might suggest divorcing repository access from local scripting and file system in terms of "upgrades". I think the linkage is why neither of us have accomplished much in that area.
 
The internet finds people reporting that bug to GitHub in 2012, and getting an acknowledgment. It was along the lines of "the maintainers at CollabNet say this field is mandatory, but the GitHub bridge doesn't included it on subdirectories."

I have proof of concept code in my BadHorseMonkey fork on a branch. I don't think I've worked on in months, but the basic "check out with JGIT" works.

I am stuck on how much to do to replicate the existing model that SVN follows (including the flat filename space, which was a design trade-off that has does not scale well for large script projects) vs. allowing more flexibility in script locations by using relative paths.

And if I do provide a way to modernize, how do I make sure it all still works with scripts that stay in SVN, are abandoned but still useful, etc.

I will revive my efforts in 2022, break it up into chunks that are not daunting to me, and invite collaboration. It is doable, just not done. That's on me.
is it plausible to have both git and svn in mafia together?
svn checkout svnscript
git checkout gitscript

That way you do not have to worry about making sure it still works with svn scripts, since those will be handled by the existing svn code
svn scripts already instruct the user to install them via svn checkout. so only git scripts will need to change their install instructions to now tell users to use git checkout
 
is it plausible to have both git and svn in mafia together?
svn checkout svnscript
git checkout gitscript

That way you do not have to worry about making sure it still works with svn scripts, since those will be handled by the existing svn code
svn scripts already instruct the user to install them via svn checkout. so only git scripts will need to change their install instructions to now tell users to use git checkout

Absolutely. Someone just has to decide that they have the time, interest and expertise to integrate a git library into KoLmafia. The interest is there but this is big enough that it is not on the top of any current dev's "to do" list. Ideally there would be some discussion of the user experience first, but...
 
is it plausible to have both git and svn in mafia together?
svn checkout svnscript
git checkout gitscript

That way you do not have to worry about making sure it still works with svn scripts, since those will be handled by the existing svn code
svn scripts already instruct the user to install them via svn checkout. so only git scripts will need to change their install instructions to now tell users to use git checkout
yes, and it would need to be that way, because some still-useful scripts have been abandoned and will never move to GIT.

But, the svn command uses some specific SVN features to tell if any file has been changed in order to know to add/remove/update it from the SVN staging directory to the scripts directory, so that has to be handled.

And the current behavior of SVN is "search for the script by name anywhere in the SVN locations and update the script in that location", which is also code that needs to be either re-used between the two methods or replaced.

I'm not fond of that model model, because two scripts can't both have a sub-script (for instance) called "recover.ash" in two different subdirectories, and a script would have no idea if a later install had replaced the expected "recover.ash" with a differently functioning "recover.ash". It made sense before large, multi-file scripts were developed, but we could change it and remove a hard-to-diagnose catastrophic failure mode.

So duplicating behavior I want to replace on a project I'm not being paid to code for is a challenge. I'm working on re-building a MVP project that I can get out the door, but it hasn't happened yet. I have plans, but no actions. Or, more specifically, I've kvetched about my failure to get it done here...
 
two scripts can't both have a sub-script (for instance) called "recover.ash" in two different subdirectorie

I'd question that or perhaps ask you to elaborate. I worked with one of the JS folks and my recollection is that after my commit, two scripts can have the same names for supplemental files as long as the subdirectory structure is different. My recollection is that install, update and delete worked. I found what I think was a reference to to the work in June 2021 but have not found the discussion.
 
I'd question that or perhaps ask you to elaborate. I worked with one of the JS folks and my recollection is that after my commit, two scripts can have the same names for supplemental files as long as the subdirectory structure is different. My recollection is that install, update and delete worked. I found what I think was a reference to to the work in June 2021 but have not found the discussion.
If that's changed, I'm pleased. And in that case, I need to refresh my branch to get to that codebase, since it's been longer than that...

And Blame tells me you did indeed change getRebase() on 5/27/2021, so I may have outwitted my disgruntlement and should look at the project again. For which, thank you!

Java:
private static File getRebase(String relpath) {
...
    if (matches.size() == 1) {
      // findScriptFile matches on filename, regardless of directory and
      // regardless of the file type.  In this particular instance what is
      // needed is whether a file already exists - same directory and same
      // name - because upstream code is prepared to overwrite the match, which
      // can be the wrong thing.  This only returns a match if it is same file
      // in the filesystem.

}
 
Back
Top