ereinion icon

FreeFights

ereinion | PRO | 09/08/18 07:54:15 PM UTC | 0 ⭐ | 218 👁️ | Never ⏰ | []
JavaScript |

7.69 KB

|

None

|

0 👍

/

0 👎

boolean fold(item doodad) {
    if(available_amount(doodad) > 0) return true;
    foreach other in get_related(doodad, "fold")
        if(available_amount(other) > 0)
            return cli_execute("fold "+doodad);
    return false;
}
 
boolean equip_stuff() {
    equip($slot[hat], $item[training helmet]);
    equip($slot[weapon], $item[bottle-rocket crossbow]);
    equip($slot[off-hand], $item[kol con 13 snowglobe]);
    equip($slot[back], $item[buddy bjorn]);
    if (fold($item[makeshift garbage shirt])) {
        equip($slot[shirt], $item[makeshift garbage shirt]);
    } else {
        print_html("<font color=008000>No suitable shirt creatable</font>");
    }
    equip($slot[pants], $item[pantsgiving]);
    equip($slot[acc1], $item[mr. cheeng's spectacles]); // '
    equip($slot[acc2], $item[time-twitching toolbelt]);
    equip($slot[acc3], $item[mafia thumb ring]);
    use_familiar($familiar[Ms. Puck Man]);
    equip($slot[familiar], $item[mayflower bouquet]);
    return true;
}
 
familiar select_bjorn_familiar() {
    string[familiar] property_of_familiar;
    int[familiar] no_of_drops_familiar;
    
    property_of_familiar[$familiar[garbage fire]] = "_garbageFireDropsCrown";
    property_of_familiar[$familiar[grim brother]] = "_grimFairyTaleDropsCrown";
    property_of_familiar[$familiar[grimstone golem]] = "_grimstoneMaskDropsCrown";
    property_of_familiar[$familiar[trick-or-treating tot]] = "_hoardedCandyDropsCrown";
    property_of_familiar[$familiar[optimistic candle]] = "_optimisticCandleDropsCrown";
    property_of_familiar[$familiar[adventurous spelunker]] = "_oreDropsCrown";
    property_of_familiar[$familiar[twitching space critter]] = "_spaceFurDropsCrown";
    property_of_familiar[$familiar[machine elf]] = "_abstractionDropsCrown";
    
    no_of_drops_familiar[$familiar[garbage fire]] = 3;
    no_of_drops_familiar[$familiar[grim brother]] = 2;
    no_of_drops_familiar[$familiar[grimstone golem]] = 1;
    no_of_drops_familiar[$familiar[trick-or-treating tot]] = 3;
    no_of_drops_familiar[$familiar[optimistic candle]] = 3;
    no_of_drops_familiar[$familiar[adventurous spelunker]] = 6;
    no_of_drops_familiar[$familiar[twitching space critter]] = 1;
    no_of_drops_familiar[$familiar[machine elf]] = 25;
    
    foreach fam in property_of_familiar {
        if (to_int(get_property(property_of_familiar[fam])) < no_of_drops_familiar[fam]) {
            return fam;
        }
    }
    
    return $familiar[none];
}
 
void equip_in_bjorn() {
    familiar fam;
    fam = select_bjorn_familiar();
    
    if (fam == $familiar[none]) {
        equip($slot[back], $item[protonic accelerator pack]);
    } else {
        if (my_bjorned_familiar() != fam) {
            bjornify_familiar(fam);
        }
    }
}
 
boolean god_lobster_fights(int fights_to_run) {
    # check which values to put in run_choice
    familiar fam = my_familiar();
    int i = 0;
    
    if (use_familiar($familiar[god lobster])) {
        while (to_int(get_property("_godLobsterFights")) < 3 && i < fights_to_run) {
            visit_url("main.php?fightgodlobster=1");
            if (available_amount($item[god lobster's crown]) <= 0) { // '
                run_choice(0);
            } else {
                run_choice(1);
            }
            i = i + 1;
        }
        use_familiar(fam);
    }
    return to_boolean(i != 0);
}
 
boolean adventure_at_location(int fights_to_run) {
    int i = 0;
    
    // Snojo
    while (to_int(get_property("_snojoFreeFights")) < 10 && i < fights_to_run) {
        adv1($location[The X-32-F Combat Training Snowman],-1,"");
        i = i + 1;
    }
    // The Neverending Party
    # Figure out how to deal with the noncombats
    while (to_int(get_property("_neverendingPartyFreeTurns")) < 10 && i < fights_to_run) {
        adv1($location[The Neverending Party],-1,"");
        i = i + 1;
    }
    return to_boolean(i != 0);
}
 
boolean adventure_in_tunnels(int fights_to_run) {
    int i = 0;
    familiar fam = my_familiar();
    
    cli_execute("checkpoint");
    equip($slot[back], $item[protonic accelerator pack]);
    equip($slot[acc2], $item[mr. screege's spectacles]); // '
    equip($slot[familiar], $item[mayflower bouquet]);
    if (available_amount($item[pantogram pants]) > 0) {
        equip($slot[pants], $item[pantogram pants]);
    } else {
        equip($slot[pants], $item[greatest american pants]);
    }
    if (use_familiar($familiar[machine elf])) {
        while (to_int(get_property("_machineTunnelsAdv")) < 5 && i < fights_to_run) {
            adv1($location[The Deep Machine Tunnels],-1,"");
            i = i + 1;
        }
        use_familiar(fam);
        cli_execute("outfit checkpoint");
    }
    return to_boolean(i != 0);
}
 
boolean eldritch_tentacles(int fights_to_run) {
    int i = 0;
    if (!to_boolean(get_property("_eldritchHorrorEvoked")) && i < fights_to_run) {
        use_skill(1, $skill[evoke eldritch horror]);
        i = i + 1;
    }
    if (!to_boolean(get_property("_eldritchTentacleFought")) && i < fights_to_run) {
        visit_url("place.php?whichplace=forestvillage&action=fv_scientist");
        run_choice(1);
        i = i + 1;
    }
    return to_boolean(i != 0);
}
 
boolean love_tunnel() {
    if (!to_boolean(get_property("_loveTunnelUsed")) && to_boolean(get_property("loveTunnelAvailable"))) {
        visit_url("place.php?whichplace=town_wrong&action=townwrong_tunnel");
        run_choice(1);
        run_choice(1);
        visit_url("choice.php");
        // 1 = Eardigan, 2 = Epaulettes, 3 = Earring
        run_choice(3);
        run_choice(1);
        visit_url("choice.php");
        // 1 = Lovebotamy, 2 = Open Heart Surgery, 3 = Wandering Eye Surgery
        run_choice(2);
        run_choice(1);
        // 1 = Enamorang, 2 = Emotionizer, 3 = Extraterrestrial Chocolate, 4 = Echinacea Bouquet, 5 = Elephant, 6 = 2 pieces of toast
        run_choice(1);
    }
    return true;
}
 
boolean witchess_fights(int fights_to_run) {
    int i = 0;
    int choice_adv;
    
    if(to_int(get_property("_witchessFights")) < 5 && i < fights_to_run) {
        // Witchess Knight or Ox?
        choice_adv = to_int(get_property("_witchessFights")) != 4 ? 1936 : 1937;
        if (choice_adv == 1937) {
            use_skill(1, $skill[Frigidalmatian]);
            if (my_primestat() == $stat[muscle]) {
                equip($slot[weapon], $item[stainless steel shillelagh]);
            }
        }
        visit_url("campground.php?action=witchess");
        run_choice(1);
        visit_url("choice.php?option=1&pwd=" + my_hash() + "&whichchoice=1182&piece=" + to_string(choice_adv), false);
        run_combat();
        i = i + 1;
        if (have_effect($effect[frigidalmatian]) > 0) {
            cli_execute("shrug frigidalmatian");
            equip($slot[weapon], $item[bottle-rocket crossbow]);
        }
    }
    return to_boolean(i != 0);
}
 
boolean infernal_seals(int fights_to_run) {
    item item_to_use = $item[depleted uranium seal figurine];
    int i = 0;
    int max_summons = 5 + to_int(item_amount($item[claw of the infernal seal]) > 0)*5;
    item prev_weapon = equipped_item($slot[weapon]);
    
    if(to_int(get_property("_sealsSummoned")) < max_summons && i < fights_to_run && my_class() == $class[seal clubber]) {
        if (item_amount($item[imbued seal-blubber candle]) == 0) {
            if (available_amount($item[powdered sealbone]) == 0) {
                if (item_amount($item[figurine of an ancient seal]) == 0) {
                    hermit(1, $item[figurine of an ancient seal]);
                }
                item_to_use =  $item[figurine of an ancient seal];
                retrieve_item(3, $item[seal-blubber candle]);
            } else {
                retrieve_item(1, $item[imbued seal-blubber candle]);
            }
        }
        if (item_type(equipped_item($slot[weapon])) != "club") {
            equip($slot[weapon], $item[stainless steel shillelagh]);
        }
        use(1, item_to_use);
        equip($slot[weapon], prev_weapon);
        i = i + 1;
    }
    return to_boolean(i != 0);
}
 
void burn_free_fights() {
    equip_stuff();
    equip_in_bjorn();
    #while (god_lobster_fights(1)) { equip_in_bjorn(); }
    if (love_tunnel()) { equip_in_bjorn(); }
    while (adventure_at_location(1)) { equip_in_bjorn(); }
    while (eldritch_tentacles(1)) { equip_in_bjorn(); }
    while (witchess_fights(1)) { equip_in_bjorn(); }
    while (infernal_seals(1)) { equip_in_bjorn(); }
    if (adventure_in_tunnels(6)) {}
}
 
void main() {
    burn_free_fights(); 
}

Comments