Results 1 to 6 of 6

Thread: Automating god lobster fights

  1. #1
    Senior Member
    Join Date
    Dec 2008
    Posts
    571

    Default Automating god lobster fights

    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 by ereinion; 11-20-2018 at 11:25 PM.

  2. #2
    Senior Member
    Join Date
    Jun 2016
    Posts
    261

    Default

    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.

  3. #3
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,417

    Default

    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);
    }

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

    Default

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

  5. #5
    Senior Member
    Join Date
    Jan 2012
    Location
    Texas
    Posts
    424

    Default

    Your script needs to do the Neverending party with the god lobster

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

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •