Request for help scripting combat in batfellow

ungawa

Member
I'm working on a script to at least partially automate batfellow, but I'm not sure how to deal with combat. I'm better at repurposing existing code than writing my own, but I haven't seen any batfellow scripts to rip things off from.
Any suggestions how to get mafia to use a kickball when I am in combat?

I tried a mafia ccs (both "skill kickball" and "skill 7261"), but those just seem to twiddle my thumbs.
Going to account.php, I was able to pick "kickball" from the Auto Attack dropdown, but it doesn't fire, even with the checkbox to fire auto attack vs bosses and special monsters.
Viewing the frame source while in a fight, I don't see any obvious visit_urls. I saw fight.php in the source so I tried visit_url("fight.php?action=macro&macrotext=" + url_encode("skill kickball")) and some variations on that based on some cc_ascend fight.php calls, but that just twiddled my thumbs.
 

heeheehee

Developer
Staff member
iirc, visit_url doesn't let you visit fight.php if Mafia doesn't think you're in a fight; the same issue cropped up in scripting Skid Row combat.
 

ungawa

Member
While not elegant, thanks to /clan, I now have the following:
Code:
chat_macro("/goto fight.php?action=skill&whichskill=7261");

Edit: spoke too soon. That macro works in chat, but putting that line in my ash script just results in the cli just saying "Loading "fight.php?action=skill&whichskill=7261"." and not actually doing anything. Same if I change chat_macro to cli_execute.

Double edit: ok, visit_url is working now.
Code:
visit_url("fight.php?action=skill&whichskill=7261");

Looks like it's up and running.
 
Last edited:

Veracity

Developer
Staff member
I don't understand why normal combat scripts wouldn't just work. I've been putting off playing Batfellow games for a while, but I can't see any obvious reasons they would be like any other fight; you adventure in an adventure.php location and get send into fight.php. From a session log at the end of February:

Code:
{4 h. 6 m.} Gotpork Foundry
Encounter: high-level mook
Round 0: Batfellow wins initiative!
Round 1: Batfellow uses KICKBALL!
Round 2: Batfellow wins the fight!
Sure looks like we are treating it like any other fight.

In which case, I don't see why adventure() in a location with your CCS set up as desired wouldn't just fire. Or why you couldn't just use run_combat() to run the fight using your CCS.

Seems like you found a solution, but I don't understand why you should have to explicitly call visit_url on fight.php to submit actions, rather than just use( $item[kickball] ), for example.

I'll investigate, by and by. Probably when I finish this AWOL run and the next - which will be my 15th HC AWOL run - and will leave me time to simply Not Ascend for quite a while, we hope.
 

dapanda

Member
Hi ungawa,

I am still getting the "twiddle your thumbs" response. Would you mind posting your script for the combat?

Thanks!
 

zarqon

Well-known member
BatBrain also correctly uses and tracks all the Batfellow skills, so a BatBrain-powered script would also be an option. You could do something like:

Code:
act(page);
enqueue($skill[kickball]);   // this will do nothing if you don't have a kickball
enqueue($skill[bat-punch]);  // if the kickball successfully enqueued above, BatBrain thinks the combat is over and this will do nothing
enqueue($skill[bat-kick]);   // same here
macro();    // this will submit the macro of everything you've queued up so far

However, there is a lot of strategy regarding item use in Batfellow (mostly regarding jutes, kickballs, and reserving bat-o-mite for bosses) which would be rather tricky to automate, which is one reason I've held off scripting Batfellow combat for SS. The main reason, though, is that there are some important things BatBrain doesn't know:

  • The strength of your punches/kicks. Is this accessible in batmanStats? Probably?
  • The damage the monsters will do to you. I have an outstanding feature request about this.
  • When your next NC is coming (which could affect whether you wish to use a jute). I also have a feature request about this.
All this to say that BatBrain may be a decent framework for you to use, as it has done a lot of the work already, though not all of it.
 

dapanda

Member
I am just trying to burn through the runs to get my weekly comic and beat the bosses for the trophy. When I want the jokester stuff I will play it by hand
 
Top