Automating god lobster fights

ereinion

Member
I have this small script, which is supposed to run my god lobster fights for me:

Code:
boolean god_lobster_fights(int fights_to_run) {
    familiar fam = my_familiar();
    int i = 0;
    
    if (use_familiar($familiar[god lobster])) {
        while (to_int(get_property("_godLobsterFights")) < 3 && i < fights_to_run) {

            if (length(visit_url("main.php?fightgodlobster=1")) > 0) {}

            if (available_amount($item[god lobster's crown]) <= 0) {
                run_choice(1);
            } else {
                run_choice(2);
            }
            i = i + 1;
        }
        use_familiar(fam);
    }
    return to_boolean(i != 0);
}

I'm pretty sure it used to work, but lately it has aborted on the first fight like this:

FmQzK8ELQP6tBC7IZ8gY7Q.png

As you can see, trying to submit choice 2 for the choice-adv again finishes the choice, and it only aborts on the first fight.

Can someone tell me where I am going wrong here?
 
Last edited:
I have no idea how or why your code would stop working, but I can show what I use:

Code:
		while(get_property("_godLobsterFights").to_int() < 3 ) {
			int selected = SelectGodLobster();
			if ( equipped_item($slot[familiar]) != lobster_priority[selected].famequip )
				equip($slot[familiar],lobster_priority[selected].famequip);
			string page = visit_url("main.php?fightgodlobster=1");
			run_combat();
			if ( choice_follows_fight() ) {
				visit_url("choice.php");
				run_choice(lobster_priority[selected].choice);
			}
			else abort("No Choice after a god lobster fight? That doesn't make any sense.");
		}

Notably, I specifically visit choice.php before trying to run the choice, this seems to be the easiest way to actually follow the end-of-fight link and enable mafia to realize exactly what choice you are in.
 

Crowther

Active member
I compared your script, mine, and the dictator's and I believe you need to add a run_combat() after visit_url() and before run_choice().

EDIT:
My script:
Code:
void main()
{
    use_familiar($familiar[god lobster]);
    equip($item[god lobster's crown]);
    visit_url("main.php?fightgodlobster=1");
    run_combat();
    run_choice(2);
    item dish = $item[Dish of Clarified Butter];
    put_shop((mall_price(dish)*.95).to_int(), 0, item_amount(dish), dish);
}
 

Veracity

Developer
Staff member
I probably need to look into this for my VMF script, which handles all the other daily Free Fights that I know about. :)
 

Veracity

Developer
Staff member
We can discuss that over on the script's thread, since I'm not sure I understand your point.
But challenging the God Lobster for three free fights per day seems like a good idea which is orthogonal to that suggestion.
 
Top