Trick-Or-Treating script

guyy

Member
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:

Bale

Minion
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.
 

guyy

Member
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:

Bale

Minion
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.
 

guyy

Member
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.
 

Winterbay

Active member
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 ""...
 

guyy

Member
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.
 

Croft

Member
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:

slyz

Developer
I added the following at the beginning of the script:
PHP:
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:

Veracity

Developer
Staff member
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.
 

slyz

Developer
I didn't think to try before modifying the script. I could have simply gone ahead then, no need for the wineglass!
 
I have a suggestion: after the line:

cli_execute("mood execute");
cli_execute("burn extra");


That way if you do stocking mimic, you can do all the mana burning stuff.

Cheers!
 

guyy

Member
I've never done much mimic farming, but "burn extra" seems to do nothing without being set up to do something, so I stuck it in there. :p

Also, holy crap, this thing already has more users than dreaddrunk, and that's not even counting the people using Bale's script. Though I guess that isn't surprising since the new trick-or-treat has about 300% more clicking.
 

Kamui

New member
So a friend of mine pointed out an idea that could be useful here. You already have "trick" and "treat" outfit checkers, would it be possible/practical to also have it equip an outfit that maximizes mp regen when going to a new block?
 

guyy

Member
So a friend of mine pointed out an idea that could be useful here. You already have "trick" and "treat" outfit checkers, would it be possible/practical to also have it equip an outfit that maximizes mp regen when going to a new block?

Just added this (outfit name is "newblock"), along with an outfit-listing command (see first post).
 

EdFox

Member
Personally I'd prefer something like:

cli_execute("mood execute");
cli_execute("call " + get_property("betweenBattleScript"));

If you're a BBB user who has it swap out familiars to farm their item, I highly recommend making this change (in the svn directory version then "svn sync"). It makes BBB's switching work during Trick or Treating.
 

guyy

Member
I forgot to mention it, but I did add the "call [betweenbattle]" thing. At least, I think I did (I don't actually use a BBS, so hopefully it works).
 

rlbond86

Member
I'm getting an error:

You need a costume to trick-or-treat!

My outfit "treat" is Animelf Apparel...

Edit: doh, "trick" needs to be a different outfit.
 
Last edited:
Top