Page 1 of 7 1 2 3 ... LastLast
Results 1 to 10 of 70

Thread: Trick-Or-Treating script

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Posts
    131

    Default Trick-Or-Treating script

    Trick-or-treating is now a thing that is less trivial than "visit this URL repeatedly," so here's the lazy solution.

    Install command:
    Code:
    svn checkout https://svn.code.sf.net/p/guyymafia/code/tricktreat
    CLI: tricktreat [#]

    • Visits every house in [#] blocks, taking candy and beating up monsters and whatnot. (Individual houses don't take an adventure; each block has 12 houses and takes 5 adv, but the first block is free.)
    • Aborts if it sees Steve (the boss) or a monster that isn't a mall-cop, hooligan, or old geezer.
    • If you have outfits called "trick" and "treat", it will use "trick" for the combats and "treat" for the noncombats, which is helpful to maximize item drops (or whatever) while still getting the candy you want. Both of them must include costumes!
    • If you have an outfit called "newblock" it will wear that when scoping out new blocks (this is the only part that consumes adventures, so MP regen may be helpful).


    Alternate command: "tricktreat outfits" lists the values of candy produced by outfits you own (leaving out min-priced ones). Data comes from this page, which is new, so some outfits may not show up yet.
    Last edited by guyy; 10-28-2013 at 02:21 AM.

  2. #2
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    That checkout command doesn't work. I believe that https://svn.code.sf.net/p/guyymafia/code/tricktreat/ would work better.

    A few criticisms:
    • You don't maintain health and mana. Restoration is necessary because otherwise you can slowly be killed by monsters. Unfortunately mafia won't restore if it doesn't recognize it as a valid adventuring location.
    • mood maintenance would also be nice. Because item buffs count.
    • It would be nice if the script printed the name of the monster attacker. (Feel free to copy my code for that.)



    Once you do that, my script will be outdated and unnecessary.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  3. #3
    Senior Member
    Join Date
    Apr 2012
    Posts
    131

    Default

    Yeah, figures the checkout command wouldn't work the one time I don't test it. Seems to work now. Thanks for the comments; I'll see about adding some/all of those things.

    Edit: Should now do moods and restoration and stuff. Mafia already prints the monster name, so that seems redundant.
    Last edited by guyy; 10-25-2013 at 10:29 AM.

  4. #4
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    I don't see the monster name in my gCLI. Since it isn't an adventure.php location, mafia doesn't parse monsters. Are you seeing something different?

    Code:
    > tricktreat 1
    
    Trick-or-treating on block 1 of 1.
    Countdown: 3 seconds...
    Countdown: 2 seconds...
    Countdown: 1 second...
    Waiting completed.
    Mood swing complete.
    House #1 has already been looted.
    Round 0: mauling wins initiative!
    Battle! House #2 contains some jerk trying to beat you up.
    Nope, no monster name on my mafia.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  5. #5
    Senior Member
    Join Date
    Apr 2012
    Posts
    131

    Default

    Odd...mine does have it, but I guess the settings are different or something?

    Code:
    Encounter: Trick or Treat!
    Encounter: Doug Blurt, Neighborhood Cop
    Round 0: sky canopy domain wins initiative!
    Battle! House #9 contains some jerk trying to beat you up.
    In any case, I could go ahead and stick the monster names in there; and the candy names, which are probably more important anyway.

  6. #6
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default

    Yeah mine didn't get it either, which meant that I had to set up a special combat-action since WHAM couldn't handle a monster name of ""...
    My scripts:
    Best sushi for Profit
    Winterbay's Helpful Automatic Monsterbasher (WHAM)

    Scripts maintained by me:
    Autobasement
    Smashlib

    A small programmer joke:
    Wife: Honey, please go to the market and buy 1 bottle of milk. If they have eggs, bring 6.
    The man came back with 6 bottles of milk.
    Wife: Why did you buy 6 bottles of milk.
    Man: Because they had eggs...

    The 6 Stages of Debugging: 1 )That can't happen. 2) That shouldn't happen. 3) Hmmm, weird. 4) Why does that happen? 5) Oh, I see. 6 )How did that ever work?

    All programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn’t work. /Bob Fitch, Blizzard

  7. #7
    Senior Member
    Join Date
    Apr 2012
    Posts
    131

    Default

    The image names reveal whether the house is a combat or not, so I added a thing to switch outfits for combats/noncombats if you have a "trick" combat outfit and "treat" noncombat outfit. They still both have to have a costume in them somewhere, but this way you can use bounty-hunting or hobo gear to get item drops without having to collect unwanted candy.

  8. #8

    Default

    I have problems running this script:

    > tricktreat 2

    Saving outfit: Backup
    Outfit saved
    Putting on outfit: treat
    Equipment changed.
    Starting trick-or-treating, outfit-switching enabled.
    Mood swing complete.
    Restoring HP! Currently at 245 of 403 HP, 278 of 897 MP, current meat: 15863682 ... Target HP = 403.
    Casting Cannelloni Cocoon 1 times...
    You gain 158 hit points
    Cannelloni Cocoon was successfully cast.
    Trick-or-treating on block 1 of 2.
    Countdown: 3 seconds...
    Countdown: 2 seconds...
    Countdown: 1 second...
    Waiting completed.
    Putting on outfit: trick
    Equipment changed.
    Mood swing complete.
    Round 0: croft wins initiative!
    Battle! House #6 contains a kid who is too old to be Trick-or-Treating.
    Bad monster value: ""
    Bad monster value: ""
    You're on your own, partner.
    Click here to continue in the relay browser.

    Build 12962.

    Edit: Ok, the problem is not this script but the CCS which consulted WHAM.ash.
    Last edited by Croft; 10-25-2013 at 03:16 PM.

  9. #9
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,511

    Default

    I added the following at the beginning of the script:
    PHP Code:
    string TRICK_OUTFIT "trick";
    string TREAT_OUTFIT "treat";

    if ( 
    my_inebriety() > inebriety_limit() )
    {
        
    TRICK_OUTFIT += "_drunk";
        
    TREAT_OUTFIT += "_drunk";

    and replaced "trick" and "treat" with TRICK_OUTFIT and TREAT_OUTFIT in the rest of the script.

    This way I can specify "trick_drunk" and "treat_drunk" outfits with Drunkula's Wineglass and a costume that doesn't require an off-hand.

    EDIT: Forget I posted. It's a useless change since we can still ToT when drunk.
    Last edited by slyz; 10-25-2013 at 09:50 PM.
    Try the Nemesis Quest Script or the FamiliarFeeder interface.
    *shakes KoLMafia tech support magic 8-ball* Update mafia to the latest daily .JAR!
    NEW Dad ASCENSION STARTED 20120730
    ------------------------------
    Welcome to Parenthood, Noob

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

    Default

    The old trick-or-Treating let you adventure while drunk. I have just confirmed that the new one still does: you can spend 5 adventures to scope out new blocks while over drunk and also visit the 12 houses in a block with no problem.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Similar Threads

  1. 12991: Item drop rates for Trick or Treating
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 10-29-2013, 06:13 PM
  2. Replies: 0
    Last Post: 10-26-2013, 12:50 PM
  3. Replies: 0
    Last Post: 10-25-2013, 04:13 PM
  4. Replies: 0
    Last Post: 10-25-2013, 11:52 AM
  5. Bug haunted house postion effects not working in mood when trick-or-treating
    By maximillian the red in forum Bug Reports
    Replies: 7
    Last Post: 12-24-2011, 08:11 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
  •