Results 1 to 4 of 4

Thread: 19545: Add method-chaining friendly versions of eat, eatsilent, drink, drinksilent, c

  1. #1
    Feed Reader RSS Bot's Avatar
    Join Date
    Jul 2009
    Posts
    12,068

    RSS 19545: Add method-chaining friendly versions of eat, eatsilent, drink, drinksilent, c

    Add method-chaining friendly versions of eat, eatsilent, drink, drinksilent, chew, use and create. For example, you can now do $item[lime].eat() or $item[martini].drink(3)

    by innerdreams on 2019-09-17 08:49:23

    M /src/net/sourceforge/kolmafia/textui/RuntimeLibrary.java (view) (diff)
    Last edited by gausie; 09-17-2019 at 09:27 AM. Reason: Some formatting was missing from the commit
    Download the latest KolMafia build here.
    Every new revision posted within the hour.
    New EXE builds every Monday.

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

    Default

    "No method found for built-in function: overdrink"

    I'll see if there is an easy fix.

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

    Default

    r19546 restores overdrink.

    I just found what I believed was the missing code and restored it to a place that made sense. I did not test any of the "new" chaining or try very hard to observe some kind of ordering in the code.

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,183

    Default

    I like this. Comments:

    Formatting - braces on functions.
    "create" should not care about UseItemRequest.lastUpdate
    This could easily be extended for "buy" and "retrieve_item" and a number of others.

    Working on a follow up submit...
    Last edited by Veracity; 09-17-2019 at 08:07 PM.

Posting Permissions

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