Feature - Implemented Bake 'prefref' command into mafia

Cool12309

Member
Prefref is a great alias and it would be awesome if this could be baked into mafia itself, as I see people in /hardcore all the time asking if there's a way to do this or that and the answer is sometimes to change a preference, and allowing them to find the preference would make this easier.

It would be cool if the command could also list user-defined variables (e.g. "set foobar12345 = hello") somehow.
 

Bale

Minion
If this was added to mafia, then it could have the additional functionality of referencing custom preferences that aren't in defaults.
 

PeKaJe

Member
As a person who recently discovered the prefref alias, I would so very much like to see something like this built into mafia.
So much so, in fact, that I took a stab at adding it, see attached patch.

It has an optional parameter "regex", which makes it treat the searchText as a regular expression.
There is also a "user" or "global" parameter, to only search the preferences in the user or global scope (it defaults to both).
If a parameter is not defined in defaults.txt, it shows "N/A" in the "Default" column.

The output is in a table, which I understand is still going to be broken for at least a couple of months.
I personally use the workaround patch I posted here: http://kolmafia.us/showthread.php?15428-Tables-in-the-gCLI-mutliplying&p=116765#post116765
It's also possible to manually "fix" the output by opening Preferences->Chat Options, and clicking the font size selection.
 

Attachments

  • prefref.patch
    6.5 KB · Views: 33

lostcalpolydude

Developer
Staff member
That patch looks pretty good. I've made a few changes (excluded non-user editable settings, skip loading maps that won't be used), and I'm going to poke at it a little more before probably adding it.
 

Winterbay

Active member
What happens if you have a prefref-command aliased already? I guess it will conflict and you need to unalias it before it start working.
 

Theraze

Active member
Light conflict. Your personal prefref will convert the CLI command to... whatever you have... and you'll never see the actual mafia CLI command's output.
 

bugmenot2

New member
Thanks a lot for this!!! <3

But ... I deleted my custom alias, now the built in prefref works
it outputs everything in a table, which is great
but I get the contents thrice, three tables, it looks pretty bungled :-(

CONTENTTABLE
CONTENTTABLE CONTENTTABLE

sourriunded by a border ... (do I have to upload a screenshot?)
 

bugmenot2

New member
Ah, ok, thanks1!
(but it also means there's nothing I can do about it, except maybe going back to Java 7?!?!)
Anyway, mafia works fantastic in every other aspect, so ... nevermind!!
 

Bale

Minion
Ah, ok, thanks1!
(but it also means there's nothing I can do about it, except maybe going back to Java 7?!?!)
Anyway, mafia works fantastic in every other aspect, so ... nevermind!!

Yes. Specifically java 7_55.

Java claims they will be implementing the bug fix in java versions 7_80 and 8_40, when those are released. Current indications point to this later this month?
 

Theraze

Active member
The one thing that prefref does which this doesn't is allow for fuzzy preference setting. If you match exactly one preference, you can set that one without necessarily typing the whole name, which is good when you just want to match m21 or some similar quest.

Ah well. Just means that the alias still has a reason to live.
 

lostcalpolydude

Developer
Staff member
The one thing that prefref does which this doesn't is allow for fuzzy preference setting. If you match exactly one preference, you can set that one without necessarily typing the whole name, which is good when you just want to match m21 or some similar quest.

Ah well. Just means that the alias still has a reason to live.

I'm pretty sure the alias that most people were using didn't do that. I know Bale posted a version for that, but the version on the wiki (which is where I linked people when it came up, and that should probably be removed from the Alias page now) didn't do that.
 

Bale

Minion
I should probably rename my old alias as prefset!

I'm removing prefref from the alias page on the wiki for the reason lost states.
 

Theraze

Active member
Top