Page 7 of 14 FirstFirst ... 5 6 7 8 9 ... LastLast
Results 61 to 70 of 135

Thread: Daily Deeds support

  1. #61

    Default

    Oh, very nice, I was trying to figure out how my make a text deed display the value of _gapBuffs instead of simply the text _gapBuffs. So .. silly time on the forums not matching my time, your above post happening a few minutes ago? so this r9659 should be on the daily builds page in about 30 minutes?

  2. #62
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    Oh, very nice, I was trying to figure out how my make a text deed display the value of _gapBuffs instead of simply the text _gapBuffs.
    Originally Posted by fianor View Post
    If you're hand-coding it, you just enclose the preference in pipes. If you're using the builder, you add the text you want to display before, then just the preference (no spaces), then any text afterwards.

    So .. silly time on the forums not matching my time, your above post happening a few minutes ago? so this r9659 should be on the daily builds page in about 30 minutes?
    It takes a while for changes on sourceforge to matriculate down to builds.kolmafia.us. If you were building from source, you could have it already

  3. #63
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    I'm going to have some free time this weekend so I'm thinking of doing some work on daily deeds. This post mostly to organize my projects:

    -Hatter built-in deed, dynamically populated with available hatter buffs
    -See if I can improve drag-and-drop scrolling
    -Minor typo fixes
    -Fix preview of preferences text deeds when users manually pass pipe characters
    -Document everything, update wiki

    Anyone have any bugs/requests/critiques while I'm at it? Are custom deeds usable? How are people using them? What do you wish you could do that you can't?

  4. #64
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,267

    Default

    I sleep better at night knowing you have done this. Thank you.

    Many of my daily activities involve pulling an item from my DC and using it. This dates back to a time when just pulling the item would not trigger a refresh of the DD panel. If I knew what conditions triggered a refresh/rebuild of the panel then I would certainly drop or modify my existing procedures and use yours.

    Items I am using include:

    ball-in-a-cup
    cheap toaster
    Chester's bag of candy
    Clan V.I.P. lounge key
    handmade hobby horse
    jingle bell
    Oscus's neverending soda
    set of jacks
    The Legendary Beat
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  5. #65
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    I'll try to answer real quick before I lose phone access for the next few days ( camping). The deeds panel itself is only rebuilt when the dailyDeedsOptions pref changes. Individual items are updated when the pref, item, and/ or skill that they are attached to changes.

    For most of those it looks like an item deed will work for you.( as long as you "use" it) Dummy preferences, aliases, and some other kludges can be used to fine- tune behavior. Unfortunately out of time now but if you can provide one specific exams you're trying to implement we'll work on that.

  6. #66
    Junior Member Aldous's Avatar
    Join Date
    Jun 2009
    Posts
    6

    Default

    Alas, I need some help with Custom Deeds.

    I have no issue getting them to run, but I can't figure out how to disable once-a-day things after I hit the button once.

    Items like the Stabonic Scroll, Handmade Hobby Horse, etc.

  7. #67
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    No worries, I don't think you're alone in having that problem. I'll tell you how I do it (there are multiple ways, really), but first a little info so you understand what's going on. That way you (and anyone else with this problem) can apply the knowledge to other kinds of deeds.

    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:

    Code:
    /*
    	Increments a preference.
    */
    
    script "inc.ash";
    
    void main( string pref )
    {
    	string value = get_property( pref );
    	int intValue = to_int( value );
    
    	set_property( pref, intValue + 1 );
    }
    called inc.ash in your /scripts folder. Now you can easily increment preferences by putting "; inc <whatever preference>" in the command section of your deed. But I'm getting ahead of myself. There are essentially 2 ways to implement your deed, and I'll go through both (using stabonic scroll as an example). I'll assume you're using the custom deed builder too. You can just hand-edit the dailyDeedsOptions preference, but that's a bit more advanced. I'll talk about that at the end.

    Command deed:

    The most basic deed. The button will always be shown, regardless of whether you have the item you're using.
    displayText: stabonic scroll
    preference: _stabby
    command: use stabonic scroll; inc _stabby

    That's it. Notice that the inc.ash script increments your _stabby preference in order to disable the button.

    Combo deed:

    This is the advanced one. There is no GUI for building this, but you can collapse all of the use-this-item-once-a-day buttons into one combobox. I've talked about the syntax for this on previous pages, but this is essentially how it would look for you:

    $CUSTOM|Combo|Daily Items|false|$ITEM|stabonic scroll|_stabby|use stabonic scroll; inc _stabby|$ITEM|Hobby Horse|...

    If you have a lot of daily items, this is a superior method than cluttering up the interface with buttons. You'll have to hand-edit the above into your dailyDeedsOptions preference once it's constructed.

  8. #68
    Junior Member Aldous's Avatar
    Join Date
    Jun 2009
    Posts
    6

    Default

    Thank you. That's the boost I need at the moment. It's been decades (literally) since I coded last, so I'm very low on the uptake, but coding is getting easier (and GUIs are easier, but not better), and syntax is still eluding me, which you have nicely cleared up.

  9. #69
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    No problem. One thing I didn't really mention: feel free to change around the names of things; if you don't want to call the preference _stabby, call it whatever you'd like. However, make sure to start it with an underscore - preferences that start with an underscore are automatically reset by mafia on rollover. If you leave off that underscore, the button will remained grayed out forever!

  10. #70
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    I've gone over the wiki documentation and updated that significantly, so people should check that out if they're having issues/struggling to figure out what these "custom deed" thingies are.

    -------------

    Frono, I just went back and read your question now that I'm not reading it on a 2" display. Reading comprehension is working a bit better now. So basically you are pulling stuff from your DC, using it, and then putting it back. Hm. Well, there's a couple ways of doing it.

    Item deeds cannot be used to pull things for you, nor for storing things. They won't even be displayed if you don't have the item in your inventory (they'll appear once you pull the item). So one clunky implementation might be to have a "pull all" command button, Item deeds for all the individual items, and then "DC all" button to put them away. Clunky, but only two buttons showing when you don't have things pulled.

    A fancier implementation might be to make one combo deed. The combobox would always be enabled, and you would disable the individual elements as you used them. Each element would pull the item, use it, put it away, and finally increment a preference to disable that element. Something like:

    $CUSTOM|Combo|Daily Items|false|$ITEM|stabonic scroll|_ballInACupDaily|display take ball-in-a-cup; use ball-in-a-cup; display put ball-in-a-cup; inc _ballInACupDaily|$ITEM|Cheap Toaster|...

    (uses inc.ash that I just posted above)

    I don't know exactly how you want it to behave; there's a couple of other methods that are somewhere in between these two.

Similar Threads

  1. Feature - Implemented Add Daily Summons to Daily Deeds
    By foxmoriarty in forum Bug Reports
    Replies: 14
    Last Post: 07-17-2011, 08:56 PM
  2. Feature - Rejected Daily Deeds: Daily Dungeon
    By RoyalTonberry in forum Bug Reports
    Replies: 6
    Last Post: 07-17-2011, 12:04 AM
  3. Replies: 0
    Last Post: 04-16-2011, 08:17 PM
  4. Replies: 5
    Last Post: 01-07-2011, 01:03 PM
  5. Daily deeds?
    By Spiny in forum Community Support
    Replies: 2
    Last Post: 08-08-2009, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •