[SOLVED, use alias] Custom daily deed not working - issue with commas that get piped

Myrella

New member
Hello!
I have been trying to set up some custom dailies and I keep having issues. I have a command that works great in GCLI

Code:
ashq if(can_interact()) buy(1, $item[bowling ball], 310); else buy_using_storage(1, $item[bowling ball], 310);

but if I try to put it into a simple deed, it saves, it adds it to the current deeds list, but it shows up errors (that I am not actually sure what they meant - not a proper number of parameters? I added two params - a name and a command) - see screenshot nr. 1 - and it is not actually functional, as no clickable button appears in daily deed list - see screenshot nr.2.

Can someone teach me the wisdom of the elders and tell me what am I doing wrong, please? :(



1691129850928.png
1691129883656.png
 
It looks like it's inserting a `|` character after each comma in your command. I'm not familiar with setting up daily deeds, but I think you might be able to go into the file where these are saved, and delete the `|` characters that don't belong?
 

AlbinoRhino

Active member
Well pipes & commas can't be used as normal text because they have special meaning in the custom deeds syntax. The easiest way to do this would probably be to assign your ash code to an alias and then use the alias as the command for your custom deed.
 

MCroft

Developer
Staff member
The docs are here: https://wiki.kolmafia.us/index.php/Daily_Deeds

You might want to see if this advice applies. It's for the $TEXT type, but it might solve your problem.


Code:
If you want to use a comma in your text, immediately follow the comma with a pipe character so it will not be parsed as the end of the Text deed.
 

Myrella

New member
Well pipes & commas can't be used as normal text because they have special meaning in the custom deeds syntax. The easiest way to do this would probably be to assign your ash code to an alias and then use the alias as the command for your custom deed.
This seems to be the best answer, it is pretty simple and it works like a charm <3 Ingenious, thank you!
(if anybody sees this thread in future, just type into GCLI alias [alias_name] => [actual_command] and use the alias in a daily as a command)

The docs are here: https://wiki.kolmafia.us/index.php/Daily_Deeds

You might want to see if this advice applies. It's for the $TEXT type, but it might solve your problem.


Code:
If you want to use a comma in your text, immediately follow the comma with a pipe character so it will not be parsed as the end of the Text deed.
Nope, I tried that piping anything in the command line does not do a lick :(
I poured through that page on wiki several times, it sadly does not mention anything related to this issue. It also might be outdated, because it documents combo type, which is not even an option when making a new daily :/
 

AlbinoRhino

Active member
Glad it worked for you. The pipe after comma thing is only valid with $text deeds, I believe. The combo type is still valid it just is not covered by the deeds builder tool provided on the preferences panel. You can alter the dailyDeedsOptions preference directly to add a combo type, if you like. When you look at the dailyDeedsOptions pref you will see that each part of a deed is separated by a pipe and the deeds themselves are separated by commas....which was the conflict you were experiencing.
 

MCroft

Developer
Staff member
Glad it worked for you. The pipe after comma thing is only valid with $text deeds, I believe. The combo type is still valid it just is not covered by the deeds builder tool provided on the preferences panel. You can alter the dailyDeedsOptions preference directly to add a combo type, if you like. When you look at the dailyDeedsOptions pref you will see that each part of a deed is separated by a pipe and the deeds themselves are separated by commas....which was the conflict you were experiencing.
Hmm. I like either running a script or an alias, but would it be useful to have escapes in there?
 

AlbinoRhino

Active member
I suppose it could help for someone not familiar with how the dailyDeedsOptions pref gets parsed. I am long used to it. My deeds panel was constructed programatically even before the builder tool existed and this is the first post I remember seeing where someone ran into that conflict. A lot of ash commands will work fine because they don't include any commas. It feels like adding the parsing of escaped characters might be more work than it's worth. (Unless there are a lot of people running into the issue who don't speak up about it.) If you wanted to add some more parsing for the deeds prop I'm sure no one would stop you but it's been the way it is for a long time without any noticeable volume of problems being reported.
 
Top