How I mine for consult script?

xKiv

Active member
So I decided to write a script to automate skid row (wolf minigame in grimstone mask content) because playing that thing nominally well is a mindnumbing timewasting grind. I think I have the gym figured out (setting NC choices, combats in between them), but I can't get the other part to work.
When I visit_url('place.php?whichplace=ioty2014_wolf&action=wolf_houserun'), a fight starts, but currentRound is 0 and mafia will ignore any visit_url requests to fight.php.

When I adventure(1, $location[unleash your inner wolf]), mafia at least recognizes that the fight starts, and gets as far detecting initiative loss, but doesn't even call my consult script.
What I did there was setting my ccs to
Code:
[ default ]
consult unleashInnerWolf
and I verified that the script is valid
Code:
> verify unleashInnerWolf

void doskill( int skn )

Script verification complete.
Requests complete.

The script sits in scripts/consult, where all my other consult scripts (WHAM, ...) sit (and they worked the last time I checked).

I tried both boolean main(int initround, monster foe, string pg) and void main(int initround, monster foe, string pg). It's not even called.
What's happening? How do I make this work?
 

lostcalpolydude

Developer
Staff member
It isn't actually fight.php, so mafia thinks you aren't in a fight. That's about as far as I got before I stopped looking at it before.
 

ckb

Minion
Staff member
This fight works unlike other things in the game (its not really a combat), so mafia does not really know how to handle it normally. Luckily, you can do it with lots of visit_url() calls and some basic logic in a script... but not a consult script or ccs.

See my post and huffpuff script here: http://kolmafia.us/showthread.php?15200-Wolf-huff-and-puff

Edit: that script is old, so bonus points if you update it and the logic so it works with the current blocking nerf.
 
Last edited:

xKiv

Active member
This fight works unlike other things in the game (its not really a combat), so mafia does not really know how to handle it normally. Luckily, you can do it with lots of visit_url() calls and some basic logic in a script...

That's the first thing I tried, but the actions are forms posted to fight.php, and mafia nixed those because it was in round 0 ...

.. looking at your script, it does pretty much exactly what I tried, except you call visit_url("fight.php?...", false), and I tried visit_url("fight.php?...", true).
RuntimeLibrary.visit_url() has this:
Code:
		if ( relayRequest == null &&
		     request.getPath().equals( "fight.php" ) &&
		     FightRequest.getCurrentRound() == 0 )
		{
			return returnValue;
		}
which makes it return empty string without doing any request ...
... let's see what happens if I do an extra fight.php request at the start ...



Also - what's "huff the brick" for?
 

xKiv

Active member
OK, so it appears that the two most important things I needed to do to make it work were
1) use visit_url(..., false)
2) use visit_url('fight.php#next') # (or really anything that isn't exactly 'fight.php')

The third most important thing was to switch selection of offense and defense in the noncombat (I accidentally had it increase the higher of the two, when it should be increasing the lower).

I think I am satisfied with its current performance (~150 score, 2 appetite hormones).

Attaching scipt for overview.

It's not meant for completely unattended processing, but should only need you to setup your outfit + recovery settings + gym combat automation and to use a mask between each attempt.
What I use:
outfit - parasitic headgnawer (or nasty rat mask), HOA regulation book, red badge, space trip safety headphones, groovy prism necklace [the headgnawer and necklace only work sometimes, but still do significant damage; everything else is -ML to reduce houses' HP]
recovery settings - I think you just need to setup means of recovery (enable enough to be able to realiably and cheaply restore 100%) - recover_hp(my_maxhp()) should request 100% restore always
gym automation - I put on a mimic and a mimicfarming /autoattack macro in kol
+ you also want to day-banish escalatormaster (kind of important) and the legstrong thing (less important, but still important - rabbits are a waste, they may get you a house or four in one run, but more offense/defense/lung will get you some houses in all runs, and I am doing 4 runs)

I also encountered something with unsupported automation for choice adventure 834, even though I was setting choiceAdventure834 to a value - hopefully that was because I was setting it to an unsupported value (why does that choice have supported values 2 and 3, but not 1?).
This disappeared after I set the value in CLI once (so I don't know if I fixed it by setting the initial value in CLI or by changing something in my script).
 

Attachments

  • wolf.ash
    7 KB · Views: 50

ckb

Minion
Staff member
OK, so it appears that the two most important things I needed to do to make it work were
1) use visit_url(..., false)

This was the #1 key for me too. Once I got that, automating the fight was not so tricky.
Also, I did not automate the prep, just the fight, and only for one cycle per. If you start the fight manually (through the browser), then you can run the huffpuff script to let it finish the fight(s).
 

Darzil

Developer
A clannie wanted to run this repeatedly, including using Grimstone mask.

This script takes xKiv's file and modifies it to ask for a number of runs through, buy masks if necessary, and use them prior to doing the wolf run.

View attachment wolf_repeat.ash

Only works with r14146 and above, which allows redirect to a zone from an item without aborting.
 

xKiv

Active member
Here's a potentially interesting thing I haven't seen mentioned anywhere yet: it seems that choosing improved howling has a cumulative effect, even over ascensions - I am already doing about twice the damage I would have been doing in the beginning with the same offense.
This means that you might want to fiddle with the numbers inside all the time - both the numbers that determine which boost you take, and the "numbers" which determine how many times you "go to town".
 
Top