A Discussion on Pilcrows

GIR

New member
Hello Mafia Forum! This thread is simply going to be some information sharing for those who use the CLI (like me) who have questions with regard to generating .txt files for automation purposes. To be more specific, using item ID numbers to manipulate your goods.

Short story: updating CLI txts, came across my first comma-infused name: "Ouija Board, Ouija Board." Did some forum searching, discovered my scripts were horribly written (by server hit measurements), and I should use commands and commas in a single line. The Mafia Wiki CLI Resource section said an alternative was to use a pilcrow before the item's ID number if you have items with commas in the name. I said something along the lines of "hot damn," and spent the next day and a half re-writing and modernizing my commands.

However, I write my commands first in LibreOffice, and then transfer them to Notepad when I'm done. In LibreOffice, using the pilcrow is a cakewalk. And I was extremely pleased to see the pilcrow copy over to Notepad. And then I ran the script. Long story short - after watching the red text go by in a parade of failure, I tried a bunch of things until replacing the pilcrow with worked when I called the script in the Mafia interface.

Examples of change - went from:
try ; closet put * something
try ; closet put * something else

to:
try ; closet put * ¶####, * ¶####

and worked out writing:
try ; closet put * ¶####, * ¶####

And now is the time when all my readers give me flak for using Notepad. I know that the pilcrow is supported in the gCLI, and now know that Notepad only shows the pilcrow without directly supporting it. So, what would you use that could save the pilcrow, and be a file readable by Mafia's script call? If nothing, awesome, and I hope I've helped somebody in the future.
 

lostcalpolydude

Developer
Staff member
I use Notepad++. I don't actually use pilcrows (if I write a script it's done in ASH, where that isn't needed), but I would be surprised if it doesn't support them well.
 

GIR

New member
Good evening lostcalpolydude!

I'm guessing the "it" in your response was in reference to Notepad++? Judging by what they wanted to describe on their website, it doesn't look like they do.

I've been reading up on UTF-8 and all of its variations. Considering Notepad does save in Unicode, UTF-8, and Unicode Big Endian, this is something I'll have to try out. I'll post more once I've tested it after today's run.

As for ASH scripts, well, you're one of the greats (all you 'greats' know who you are), and I would be considered something along the line of "unwashed mass."




my previous posts' cryptic statement is invisible
 

xKiv

Active member
Can't you just escape the commas with backslashes, or does that only work in $item[...]? (for items, I mean)

like so:

try ; closet put * something, * something else \, which has a comma in its name
 

Bale

Minion
That's just an ash feature. A quick test reveals that it won't work in CLI:

Code:
[COLOR="#808000"]> mallbuy Ouija Board\, Ouija Board[/COLOR]

[COLOR="#FF0000"][Ouija Board\] has no matches.[/COLOR]
 

GIR

New member
Alrighty, to all those concerned, it looks like KoLMafia gCLI doesn't accept .txt in Unicode, Unicode Big Endian, or UTF-8. I also tried to save my command list as an .xml, and .rtf, and a "text encoded" .txt file. I tried to save it with the character sets "Western Europe (ISO-8859-15/EURO)," "Western Europe (Windows-1252/WinLatin 1)," and - just in case - "Unicode (UTF-7)."

Thank you, xKiv, for your suggestion. Bale ninja'd me to the punch; I tried something different, I tried to replace the comma with the backslash, and got a couple of "no matches" as well. Examples: "Ouija Board\Ouija Board," and "Ouija Board \ Ouija Board."

So what it looks like is that if someone wants to go with command-line commands read from a .txt file, and use the item ID number, one will have to replace pilcrows with . Which isn't really a bother; find-and-replace for the win!

Back to my Electric Melon....ade. Melonade.
Mmmmmmmmmmm....melons.





you're innocent when you dream!
 

Theraze

Active member
Try Notepad++.

The Windows Notepad has TERRIBLE support for anything... there's a long series of chatting about it both in the CanAdv thread along with the thread where Veracity actually made mafia load files consistently. But even if you tell Notepad to use UTF-8, it usually doesn't. And it will damage files that are properly saved in UTF-8 before you tried to use Notepad.
 

GIR

New member
GENTLEMEN! And possibly LADIES!

I do believe we can call this subject solved. At first impression it looked like Notepad++ wouldn't do the trick, but after seeing that there was an installer that didn't require registry alteration, I decided to download it and give it a try. Well, lo and behold, it does support pilcrows. I copied my text from LibreOffice over to a new NP++ page, saved it, and after my run, tried it out. Worked perfectly.

I've got a little bit of work to do, but I'm quite happy. I can't spend much more time chatting, for I have to unplug my computer, pour myself some Belvedere, and watch the lightning storm that's raging above my house.




six deep feet below the street the sky came crashing down
 

Winterbay

Active member
Yeah that "light" installation mode is great. I wouldn't have been able to install it at work otherwise.
 

GIR

New member
No kidding, right Winterbay? Any software written that doesn't install itself in your computer's most secret places has been created by real professional coders. I think Open Source has spoiled me forever. Anyway, I'd like to thank you all for contributing to this little thread. Happy Loathing!



alive, but without permission
 
Top