Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 33

Thread: BeachComber - fast and efficient beach combing

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

    Cool BeachComber - fast and efficient beach combing

    I have published BeachComber.ash to SVN. Use it like this:

    BeachComber 0

    Use all of your remaining free walks to go to random sections of beach to comb the "best" thing it finds there

    BeachComber 10

    Use up free walks, as above, and then spend 10 turns going to 10 more random sections of beach and combing

    It uses the properties that KoLmafia automatically sets for you when you visit a section of beach - _beachMinutes and _beachLayout

    Code:
    > set VBC.PickStrategy=random
    
    VBC.PickStrategy => random
    
    > BeachComber 4
    
    Encounter: Comb the Beach
    Submitting option 5 for choice 1388
    Combed 0 patches of beach using no turns.
    Encounter: Comb the Beach
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (1229 minutes down the beach)
    2 squares in beach 1229 contain combed sand
    88 squares in beach 1229 contain rough sand
    Combing the square at coordinates 8,12283 which contains rough sand
    Encounter: Comb the Beach
    You acquire an item: beach glass bead
    You acquire grain of sand (3)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (9497 minutes down the beach)
    1 squares in beach 9497 contain combed sand
    89 squares in beach 9497 contain rough sand
    Combing the square at coordinates 7,94962 which contains rough sand
    Encounter: Comb the Beach
    You acquire an item: bunch of sea grapes
    You acquire grain of sand (3)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (4160 minutes down the beach)
    2 squares in beach 4160 contain combed sand
    88 squares in beach 4160 contain rough sand
    Combing the square at coordinates 3,41598 which contains rough sand
    Encounter: Comb the Beach
    You acquire an item: kelp
    You acquire grain of sand (4)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (9623 minutes down the beach)
    90 squares in beach 9623 contain rough sand
    Combing the square at coordinates 7,96225 which contains rough sand
    Encounter: Comb the Beach
    You acquire an item: bunch of sea grapes
    You acquire grain of sand (4)
    Submitting option 5 for choice 1388
    Combed 4 patches of beach using turns.
    Edit 1:

    I changed the name to BeachComber and released it via svn:

    Code:
    svn checkout https://svn.code.sf.net/p/veracity0/code/beach
    It has two configurable properties:

    VBC.Priorities is a list of square types in priority order:

    W - a beached whale
    ? - unknown
    C - a sand castle
    r - rough sand
    c - combed sand
    H - a beach head

    Default:

    set VBC.Priorities=W,?,C,r,c

    VBC.PickStrategy specifies the strategy use to pick a square on the random beach:

    first - pick the leftmost square closest to the sea with the highest available type
    random - pick a random square that contains the hight available type

    Default:

    set VBC.PickStrategy=first
    Last edited by Veracity; 07-14-2019 at 03:39 PM.

  2. #2
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,094

    Default

    It worked well. Thank you. The only thing I can think of to change would be adding an aggregate tally of everything found after however many beachcombing actions were specified.

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

    Default

    Renamed it to BeachComber, changed the initial comment, and published to SVN.

    Made the square priority order configurable and added a "strategy" configurtion which will allow you to either go to the first (leftmost, closest to sea) or random square of the highest priority.

    I suppose I now need to check the configuration to validate the strategy name and to comb somewhere, at least, if you only prioritize squares which are not present. There will always be rough sand - except for the super degenerate case where somebody has combed it all...

    And a cumulative item tally would be nice, as Magus_Prime suggested.

    Now that one of my multis bought one of these, I can continue experimenting with this even while my main is chaining runs to finish TCRS, accumulate enough swagger, and finish up the Standard SC ascensions for the year.
    Last edited by Veracity; 07-13-2019 at 08:14 PM.

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

    Default

    Revision 186 tallies all found items at end of run.

  5. #5
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,685

    Default

    Fantastic, thanks Veracity!
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  6. #6
    Senior Member
    Join Date
    Jan 2009
    Posts
    230

    Default

    I'm finding this stops if it's set to random and only finds one of its highest priority:
    Code:
    Encounter: Comb the Beach (3080 minutes down the beach)
    1 squares in beach 3080 contain a sand castle
    1 squares in beach 3080 contain combed sand
    98 squares in beach 3080 contain rough sand
    Random range must be at least 2 (beachcomber.ash, line 209)
      at pick_random_coords_to_comb (beachcomber.ash:209)
      at pick_coords_to_comb (beachcomber.ash:251)
      at comb_random_beach (beachcomber.ash:286)
      at beach_comb_turns (beachcomber.ash:316)
      at beach_comb_turns_only (beachcomber.ash:337)
      at main (beachcomber.ash:358)

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

    Default

    Thanks, Yendor.

    Revision 187:

    Changed the configuration options from "VCB.*" to "VBC.*" Sorry.
    Validate configuration options.
    If you do not specify 'r' or 'c' in VBC.Priorities, you get them anyway at end.
    Options in VBC.Priorities are now separated with ',', not '|'. Default is now "W,?,C,r,c".
    And when using "random", only call random() if there is more than one square with the requested square type.

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

    Default

    Revision 188 now tallies the number of times you comb a type of beach square and prints it at the end.

    Code:
    Combed 229 patches of beach using turns.
    
    Combed a sand castle 5 times.
    Combed rough sand 224 times.
    
    Items combed:
    seal tooth (1)
    taco shell (12)
    coconut shell (1)
    dull fish scale (5)
    rough fish scale (1)
    sea salt crystal (1)
    sea carrot (14)
    sea cucumber (8)
    sea avocado (14)
    sand dollar (4)
    sea grease (1)
    sea jelly (1)
    grain of sand (639)
    magenta seashell (25)
    cyan seashell (21)
    gray seashell (24)
    green seashell (23)
    yellow seashell (22)
    bunch of sea grapes (18)
    kelp (32)
    waders (1)

  9. #9

    Default

    I'm getting this seemingly at random when using the default BeachComber 0 functionality. The first time I tried it, it used 7 of my 10 free walks before crashing:
    Code:
    > BeachComber 0
    
    Validating configuration.
    All is well!
    Encounter: Comb the Beach
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (5925 minutes down the beach)
    Combing the square at coordinates 2,59245 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: driftwood pants
    You acquire grain of sand (2)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (1618 minutes down the beach)
    Combing the square at coordinates 7,16171 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: bunch of sea grapes
    You acquire grain of sand (2)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (9821 minutes down the beach)
    Combing the square at coordinates 2,98210 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: bunch of sea grapes
    You acquire grain of sand (3)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (823 minutes down the beach)
    Combing the square at coordinates 2,8221 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: sea cucumber
    You acquire grain of sand (3)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (5765 minutes down the beach)
    Combing the square at coordinates 6,57647 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: taco shell
    You acquire grain of sand (2)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (4119 minutes down the beach)
    Combing the square at coordinates 2,41190 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: kelp
    You acquire grain of sand (3)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (9581 minutes down the beach)
    Combing the square at coordinates 2,95810 which contains a sand castle
    Encounter: Comb the Beach
    You acquire an item: driftwood hat
    You acquire grain of sand (4)
    Submitting option 2 for choice 1388
    Encounter: Comb the Beach (3196 minutes down the beach)
    
    Combed a sand castle 7 times.
    
    Items combed:
    taco shell (1)
    sea cucumber (1)
    grain of sand (19)
    bunch of sea grapes (2)
    kelp (1)
    driftwood hat (1)
    driftwood pants (1)
    Offset 0 out of bounds (BeachComber.ash, line 223)
      at square_at (BeachComber.ash:223)
      at comb_random_beach (BeachComber.ash:352)
      at beach_comb_free (BeachComber.ash:373)
      at beach_comb_free_only (BeachComber.ash:396)
      at main (BeachComber.ash:425)
    You have the latest use_for_items.txt. Will not check again today.
    Last edited by coandco; 07-16-2019 at 02:42 AM.

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

    Default

    You need to update KoLmafia. "Combed a sand castle 7 times" seems impossible. A sand castle is a "C" - but "combed sand" used to be "C", although it is now "c". I made that change in 19381 and forgot to update the "since" in this script. So, with the old version, it was looking only for combed sand - and when you got a beach which didn't have any, it crashed.

    Revision 190 of this script does this:

    Requires KoLmafia r19381
    Removes "sand castle" from default squares we will comb. Nothing special in them. Leave them for people to smash when they are manually combing the beach.
    Looks for messages in bottles (per forum rumor) and finds one, save the page HTML in file in your "data" directory.

    YOUR_NAME_bottle_message_20190716113431308.txt

    It'll log this at the end. If you get one, upload it here, please, so we can look at it and figure out how to parse out the message. Thanks.

Posting Permissions

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