AlbinoRhino
Active member
I think the following changes will fit the criteria (changes in bold):
Code:
[B]boolean addRestoreLinks = (get_property("relayAddsRestoreLinks") == "true") ? true:false;[/B]
void addHP() {
[B]int hpseverity = severity(my_hp(), my_maxhp(), to_float(get_property("hpAutoRecovery")));[/B]
result.append('<tr>');
result.append('<td class="label">HP</td>');
[B]if (addRestoreLinks && hpseverity > 1) {[/B]
result.append('<td class="info"><a title="Restore HP" href="/KoLmafia/sideCommand?cmd=restore+hp&pwd=' + my_hash() + '">' + my_hp() + ' / ' + my_maxhp() + '</a></td>');
} else {
result.append('<td class="info">' + my_hp() + ' / ' + my_maxhp() + '</td>');
}
if(showBars) {
[B]if (addRestoreLinks && hpseverity > 1) {[/B]
result.append('<td class="progress"><a href="/KoLmafia/sideCommand?cmd=restore+hp&pwd=' + my_hash() + '">'
+ progressCustom(my_hp(), my_maxhp(), "Restore your HP", severity(my_hp(), my_maxhp(), to_float(get_property("hpAutoRecovery"))), false) + '</a></td>');
} else {
result.append('<td class="progress">'
+ progressCustom(my_hp(), my_maxhp(), "auto", severity(my_hp(), my_maxhp(), to_float(get_property("hpAutoRecovery"))), false) + '</td>');
}
}
result.append('</tr>');
}
void addMP() {
[B] int mpseverity = severity(my_mp(), my_maxmp(), to_float(get_property("mpAutoRecovery")));[/B]
result.append('<tr>');
if(my_path() == "10" || my_path() == "Zombie Slayer") {
string HordeLink = get_property("baleUr_ZombieAuto") == ""? '<a href="skills.php" target="mainpane" title="Use Horde Skills">'
// If using Universal_recoverym, add link to recover Horde
: '<a href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=' + my_hash() + '" title="Restore Horde">';
#<img src=http://images.kingdomofloathing.com/otherimages/zombies/horde_15.gif width=167 height=100 alt="Horde (23 zombie(s))" title="Horde (23 zombie(s))"><br>Horde: 23<center>
if(vars["chit.kol.coolimages"].to_boolean()) {
matcher horde = create_matcher("(zombies/.*?\\.gif).*?Horde:\\s*(\\d+)", health);
if(find(horde)) {
# image: 167 x 100 pixels
result.append('<td colspan="'+ (showBars? 3: 2) +'"><center><img src=images/otherimages/' + horde.group(1) + ' width=167 height=100 border=0></center></td></tr>');
result.append('<tr><td class="label" colspan="'+ (showBars? 3: 2) +'"><center>'+HordeLink+'Horde: ' + horde.group(2) + '</a></center></td></tr>');
return;
}
}
result.append('<td class="label">'+HordeLink+'Horde</a></td>');
result.append('<td class="info">'+HordeLink + my_mp() + '</a></td>');
if(showBars) result.append('<td class="progress"></td>');
result.append('</tr>');
return;
}
result.append('<td class="label">MP</td>');
[B]if (addRestoreLinks && mpseverity > 1) {[/B]
result.append('<td class="info"><a title="Restore MP" href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=' + my_hash() + '">' + my_mp() + ' / ' + my_maxmp() + '</a></td>');
} else {
result.append('<td class="info">' + my_mp() + ' / ' + my_maxmp() + '</td>');
}
if (showBars) {
[B]if (addRestoreLinks && mpseverity > 1) {[/B]
result.append('<td class="progress"><a href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=' + my_hash() + '">'
+ progressCustom(my_mp(), my_maxmp(), "Restore your MP", severity(my_mp(), my_maxmp(), to_float(get_property("mpAutoRecovery"))), false) + '</a></td>');
} else {
result.append('<td class="progress">'
+ progressCustom(my_mp(), my_maxmp(), "auto", severity(my_mp(), my_maxmp(), to_float(get_property("mpAutoRecovery"))), false) + '</td>');
}
}
result.append('</tr>');
}
Last edited by a moderator: