//Level 4
case $location[Bat Hole Entryway]:
if(been_there(address)) return tough_test(13);
else if(my_level()>=4 && tough_test(13)){ //Am I high enough level AND tough enough?
council(); unlock_area(address); return true;} break;
case $location[Guano Junction]: //Need to have Guano Junction open AND stech protection
if(elemental_resistance($element[stench])>=10 && location_available("Bat Hole Entryway"))
return tough_test(13); break;
case $location[Batrat and Ratbat Burrow]:
case $location[Beanbat Chamber]:
case $location[Boss Bat's Lair]:
if(address==$location[Boss Bat's Lair] && quest_check("LV4council")) return false;
else if(been_there(address)) return tough_test(13);
else if(tough_test(13)){ //Why check if I can't go in?
int batse=to_int(excise(visit_url("bathole.php"),"bathole_",".gif"));
if(batse==1){
batse+=to_int(use(1,$item[sonar-in-a-biscuit]));}
if(batse==2){
unlock_area($location[Batrat and Ratbat Burrow]);
batse+=to_int(use(1,$item[sonar-in-a-biscuit]));}
if(batse==3){
unlock_area($location[Batrat and Ratbat Burrow]);
unlock_area($location[Beanbat Chamber]);
batse+=to_int(use(1,$item[sonar-in-a-biscuit]));}
if(batse>=4){
unlock_area($location[Batrat and Ratbat Burrow]);
unlock_area($location[Beanbat Chamber]);
unlock_area($location[Boss Bat's Lair]); }
if(address==$location[Boss Bat's Lair] && quest_check("LV4council")) return false;
else return been_there(address);} break;
if (my_hp() / my_maxhp() < get_property(hpAutoRecovery))
restore_hp((my_maxhp() * get_property(hpAutoRecoveryTarget)) - my_hp());
if (my_hp() / my_maxhp() < get_property(hpAutoRecovery))
restore_hp(my_maxhp() * get_property(hpAutoRecoveryTarget));
if (my_hp() / my_maxhp() < get_property(hpAutoRecovery))
restore_hp();
Function 'restore_hp( )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (level 2.ash, line 6)
if (my_hp() / my_maxhp() < to_int(get_property("hpAutoRecovery")))
restore_hp(0);
Works in gCLI, doesn't work in ASH.
I'm just surprised because usually, when someone suggests a function, it works as they suggest, no modification needed.Why are you surprised? If a function in ash requires a parameter it will never work without that parameter. All functions work that way in ash, although some are defined with varying number of possible parameters.
Actually it does not work in the gCLI. If you tell it restore hp it will attempt to restore to your current hp plus 1. that ensures that it will restore even if the restoration threshold is less than your current HP. Then mafia or UR will bump that up to your restoration target if the target is larger than requested HP.
That's why I use ashq restore_hp(0) in the gCLI. I have an alias for that.
if ( parameters.equalsIgnoreCase( "hp" ) || parameters.equalsIgnoreCase( "health" ) || parameters.equalsIgnoreCase( "both" ) )
{
target = (int) ( Preferences.getFloat( "hpAutoRecoveryTarget" ) * KoLCharacter.getMaximumHP() );
RecoveryManager.recoverHP( Math.max( target, KoLCharacter.getCurrentHP() + 1 ) );
}
if ( parameters.equalsIgnoreCase( "mp" ) || parameters.equalsIgnoreCase( "mana" ) || parameters.equalsIgnoreCase( "both" ) )
{
target = (int) ( Preferences.getFloat( "mpAutoRecoveryTarget" ) * KoLCharacter.getMaximumMP() );
RecoveryManager.recoverMP( Math.max( target, KoLCharacter.getCurrentMP() + 1 ) );
}
Or am I misunderstanding that?
For that matter, an ashq restore_hp(my_maxhp()) wouldn't be a bad one for running the shadow and other such edge cases where you just need a bit of extra attention.
alias rhp => ashq restore_hp(%%)
alias rmp => ashq restore_mp(%%)
Actually it does not work in the gCLI. If you tell it restore hp it will attempt to restore to your current hp plus 1. that ensures that it will restore even if the restoration threshold is less than your current HP.
Then mafia or UR will bump that up to your restoration target if the target is larger than requested HP.