Daily Deeds support

Soriah

New member
Each deed is attached to a preference. This is the thing it checks to see if it should be enabled/disabled. In the case of built-in stuff that mafia tracks, these preferences already exist and properly increment when you do the appropriate action. However, for stuff that mafia doesn't track, you need to do this yourself. The easiest way I've found is just to have a little utility ash script:

This. Thank you.

I feel dense now, but like Aldous it has been a looooong time since I've done much coding, and RingTFM was getting me nowhere. I've added a link to your explanation from the KoLmafia wiki; hope that's kosher.
 

roippi

Developer
Absolutely, that's what the wiki is for. I should probably expand on some things and create an "advanced" section on there.

If you need any specific feedback or help on anything, that's what this thread is for. :)
 

Blabo

New member
I read through the post about custom deeds and incrementing the preference to disable the button when used and had a question.

Why does a user have to write a script to increment a preference, can't it check for a custom deed when a skill/item is used and increment the preference for you?

If it is, then it's not working properly for me and I'm using the daily updater jar file so I keep updated on the latest daily version.

I have Canticle of Carboloading (wish I could add this to my breakfast button, if I can please let me know how), jingle bell, Jackass Plumber home game, all-year sucker, and heart of dark chocolate setup as custom deeds. All of them are 1 use and none of them are disabled after I press the button.
 

slyz

Developer
Why does a user have to write a script to increment a preference, can't it check for a custom deed when a skill/item is used and increment the preference for you?

You need to increment yourself preferences that you create. Mafia handles all the built-in ones. Reading what "Daily Deed preferences" you have created and incrementing them automatically when you press the corresponding button could be possible, but that's not always what the user might want. I think there's a bit of discussion about that in the thread.

I have Canticle of Carboloading (wish I could add this to my breakfast button, if I can please let me know how)

You can specify commands that Mafia can run for you when you log in or log out in Preferences -> Breakfast. For example, you can add "cast 1 Canticle of Carboloading".

jingle bell, Jackass Plumber home game, all-year sucker, and heart of dark chocolate setup as custom deeds. All of them are 1 use and none of them are disabled after I press the button.
Jingle bell?

I have a custom daily deed with the All-Year Sucker:
Code:
$CUSTOM|Item|All Year Sucker|_allYearSucker|all-year sucker
and it is correctly disabled after I press the button (_allYearSucker is a built-in Mafia preference).
 
Last edited:

Blabo

New member
Jingle Bell is from Crimbo 2010, from defeating Mr. Mination.

I did use _allYearSucker for my all year sucker button and it does work correctly, but the other buttons for jingle bell, jackass plumber, and heart of dark chocolate do not. So mafia has to have a build-in preference for it to work correctly?

Are there built in preferences for the items I've listed and if so then what are they?

I saw the On Login script thing for breakfast, but didn't feel like looking into it. Is there a reason I have to setup canticle in a login script, but something like summon crimbo candy is a checkbox in the breakfast setup?
 

Blabo

New member
I'm not trying to be difficult here, I understand that you can increment it yourself in a script, but why do I have to do that?

I can't see any reason if I setup a custom deed to use an item (or a skill) that has max uses per day, why I would not want to increment the preference every time I click the button. And why that is the default mafia behavior unless you use the built-in preference name for that item, is confusing and frustrating.
 

Grotfang

Developer
I can't see any reason if I setup a custom deed to use an item (or a skill) that has max uses per day, why I would not want to increment the preference every time I click the button.

I can. What if the condition for incrementing the counter wasn't met when you clicked the button?
 

fronobulax

Developer
Staff member
I'm not trying to be difficult here, I understand that you can increment it yourself in a script, but why do I have to do that?

I can't see any reason if I setup a custom deed to use an item (or a skill) that has max uses per day, why I would not want to increment the preference every time I click the button. And why that is the default mafia behavior unless you use the built-in preference name for that item, is confusing and frustrating.

I think the short answer is that mafia does not have code to track every preference that might be relavent to Daily Deeds so you have to do something yourself. A feature request for specific preferences might get acted upon and you can always write a patch and see if anyone cares to submit it for you.
 

Blabo

New member
Wouldn't mafia know if you failed using the item or skill and then not increment the preference if that was the case?

To me not incrementing the preference almost makes the custom daily item and skill deeds useless, was their a reason they were implemented this way?

And a feature request for specific preferences seems counter-intuitive to the custom daily deeds. Weren't they created just so they wouldn't have to add specific preferences to mafia each time a new item/skill came out.
Maybe a feature request for an option when setting up the custom daily deed to automatically increment the preference on a successful use (although I still can't see a reason why anyone would not want this behavior)?
 

lostcalpolydude

Developer
Staff member
And a feature request for specific preferences seems counter-intuitive to the custom daily deeds. Weren't they created just so they wouldn't have to add specific preferences to mafia each time a new item/skill came out.

No, that was not the purpose. The purpose was to let people have different things in their Daily Deeds, since some people said it was too crowded and other people said it was missing important stuff, and clearly those two complaints can't be addressed simultaneously with stuff hardcoded.
 

Blabo

New member
No, that was not the purpose. The purpose was to let people have different things in their Daily Deeds, since some people said it was too crowded and other people said it was missing important stuff, and clearly those two complaints can't be addressed simultaneously with stuff hardcoded.

Which is great, I love the ability to customize daily deeds by adding/deleting built-in deeds and by adding custom deeds.

I still don't understand why custom deeds don't increment the preference when the skill/item is used.
I haven't used mafia as long as probably most everyone else that posts here, my point in posting this was to see if maybe I was missing something or if this was a problem to everyone.

Should I submit a feature request to increment the preference on successful use of a custom daily deed?
 

Theraze

Active member
Because some people may want it to and some don't, and some people may want a more complicated success/failure check. And so you can use scripts to increment it if you want to, skip scripts if you don't want it to, and basically do whatever you want.

Your feature request is asking for an 'feature' that's already available, you just don't want to do it.
 

Veracity

Developer
Staff member
Should I submit a feature request to increment the preference on successful use of a custom daily deed?
Define "successful" for using an item that doesn't have a built-in preference to track it. For example, you mentioned the heart of dark chocolate. According to the Wiki, if you "use" this item, one of two things will happen:

You squeeze some fudgey blood droplets out of the heart and swallow them. It's as refreshing as it is terrifying to behold.
You gain 40-50 hit points.
is a "successful" usage and

You know what they say: You can't get blood from a stone, and you also can't get fudge blood from a fudge heart you've already squeezed once today. Wait until tomorrow.
is an "unsuccessful" usage.

Without built-in code to deal with this specific item, how can KoLmafia tell if "using" this item was successful?

Now, answer that question for some unknown new item that you can use two times a day. Or something with "zap wand" semantics that you can use a variable number of times per day.

We are happy (modulo a developer spending her own freely offered time to implement something she don't use) to add "built in" preferences to track new items. You can write a "New Content" request to mention such items in the Bug Reports part of these forums - or a "Feature" request, for items that have been around a while without being supported.

But a "Feature" to have Daily Deeds automatically track custom items and custom preferences and such will be rejected.
 

Grotfang

Developer
To me not incrementing the preference almost makes the custom daily item and skill deeds useless, was there a reason they were implemented this way?

Wow. I would have gone with "marginally more time consuming to implement" rather than almost useless. I think you're being a bit mean here. You've already been shown one solution for how you can implement your own incrementing counter. Once that script's in place, implementing it everywhere you want it to occur is as simple as adding two words to your command each time. Is that really that awful?

EDIT: Sorry - responded at the bottom of Page 9 (didn't see the people above me!)
 

roippi

Developer
Because some people may want it to and some don't, and some people may want a more complicated success/failure check.

Indeed. Since there is no programmatic way of checking for success/failure (see veracity's post), the only remaining option is to just always disable the button after you've clicked it. The state of the button is therefore not linked to any meaningful state of the player. For example, I have a "run farming script" button. There are several ways for it to stop execution before exiting successfully. I don't want the button to be disabled if it should stop prematurely.

My honest thoughts are that it is sufficiently easy to handle incrementing non-built-in preferences yourself using information provided in this thread and on the wiki. No, the syntax for doing that is not immediately obvious to the layperson, but I'm afraid that is a necessary evil to meet the design goals.
 

Blabo

New member
Because some people may want it to and some don't, and some people may want a more complicated success/failure check. And so you can use scripts to increment it if you want to, skip scripts if you don't want it to, and basically do whatever you want.

Your feature request is asking for an 'feature' that's already available, you just don't want to do it.

Forcing users to implement and use scripts to do something that should be very simple seems a bit much to me. Scripts should be there to do more complicated stuff that more experienced users want to do.

And I understand the reasoning behind the heart of dark chocolate not knowing if it was a successful use or not, but it doesn't matter. I want the button to gray out when I push it once on my custom daily deed, and I shouldn't have to use a script to do it, it's that simple. It should increment the preference, check it against the maxUses and grey it out if it's hit the maxUses.

Give me a checkbox on the custom deed setup that allows this behavior, would cover 99% of all daily use items/skills. Personally I would default to this behavior and give a checkbox if you didn't want it to behave that way, but that's just me.
 

Grotfang

Developer
I want the button to gray out when I push it once on my custom daily deed, and I shouldn't have to use a script to do it, it's that simple.

Unfortunately I think this is a difference in ethos. You think the preference is a counter for how often you have pressed a button. We think the preference is a counter for how often you have used the item. Since pressing the button tends to correlate nicely with using the item, you are happy saying "let's just assume!". We are not.

You've been shown the snippet to make the counter what you want. I do not think that should be the default. Better for mafia to keep shtum than for it to be wrong.
 

Blabo

New member
Unfortunately I think this is a difference in ethos. You think the preference is a counter for how often you have pressed a button. We think the preference is a counter for how often you have used the item. Since pressing the button tends to correlate nicely with using the item, you are happy saying "let's just assume!". We are not.

You've been shown the snippet to make the counter what you want. I do not think that should be the default. Better for mafia to keep shtum than for it to be wrong.

The only way for mafia to be wrong and not know how many times you've used the item is if you used it outside of mafia, and then why should mafia care, pressing the button would then gray it out and fail using the item. But you already used it that day, so what does it matter?
 

roippi

Developer
The only way for mafia to be wrong and not know how many times you've used the item is if you used it outside of mafia, and then why should mafia care, pressing the button would then gray it out and fail using the item. But you already used it that day, so what does it matter?

Or if the item has a variable number of uses. Or if we're not talking about an item at all, but the successful execution of a script. Or any number of other scenarios where player state is distinct from button state. As I mentioned above and you ignored.

We're running out of ways to say "no," I'm afraid. The status quo is to, at worst, copy/paste my inc.ash script into your /scripts folder and then add "; inc _preference" to each custom daily deed that does not have a built-in preference attached to it. I do not find that unreasonable.
 
Top