Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var marudnymod = battleMsg;
- battleMsg = function(c, t) {
- var ret = marudnymod(c, t);
- if(c.indexOf("winner=") >= 0 && hero.hp < hero.maxhp && !g.dead) {
- lecz();
- }
- return ret;
- }
- if(localStorage.getItem('Baka_leczenie') == null) localStorage.setItem('Baka_leczenie', 'on')
- function lecz() {
- if(localStorage.getItem('Baka_leczenie') == 'on') {
- if(hero.hp == hero.maxhp) return false;
- for(var i in g.item) {
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'Corncob') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'White Beans') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'Dill') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'Cumin') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'Large Bottle of Nightwatch Blood') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'Anise') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }
- var item = g.item[i];
- var wymaganylvl = parseInt(item.stat.substr(item.stat.indexOf('lvl') + 4));
- if(item.tip.search('Gotowy do użycia za')>-1)continue;
- if(item.stat.indexOf('lvl') > -1) {
- if((g.item[i].stat.indexOf('fullheal') > -1 || g.item[i].name == 'Peas') && wymaganylvl <= hero.lvl) {
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- _g("moveitem&st=1&id=" + item.id);
- break;
- }
- }else {
- if(g.item[i].stat.indexOf('fullheal') > -1) {
- _g("moveitem&st=1&id=" + item.id);
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono ' + Math.abs(hero.maxhp - hero.hp) + 'hp');
- break;
- }
- if(hero.maxhp - hero.hp >= 16000 && item.name == 'Czarna perła życia') {
- _g("moveitem&st=1&id=" + item.id);
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono 16k hp');
- break;
- }
- if(hero.maxhp - hero.hp >= 3000 && item.name == 'Vial of Daywatch Blood') {
- _g("moveitem&st=1&id=" + item.id);
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono 3k hp');
- break;
- }
- if(hero.maxhp - hero.hp >= 16000 && item.name == 'Mix') {
- _g("moveitem&st=1&id=" + item.id);
- log('Uleczono mixem o nazwie ' + item.name + '. Przywrócono 16k hp');
- break;
- }
- }
- }
- }
- }
- var ikonka = localStorage.getItem('Baka_leczenie') == 'on' ? 'http://i.imgur.com/pWp54Tx.gif' : 'http://i.imgur.com/LQu3DaK.gif'
- $("<div id=Baka_leczenie tip='<center><b>Autoheal " + localStorage.getItem('Baka_leczenie') + "</b></center>' style='position: absolute; top: 1px; right: 1px; background: url(" + ikonka + "); width:33px; height:33px'>").click(function() {
- if(localStorage.getItem('Baka_leczenie') == 'on') {
- localStorage.setItem('Baka_leczenie', 'off')
- $("#Baka_leczenie").css({
- background: 'url(http://i.imgur.com/LQu3DaK.gif)'
- });
- document.getElementById("Baka_leczenie").setAttribute("tip", "<b>Autoheal off</b>");
- } else {
- localStorage.setItem('Baka_leczenie', 'on')
- $("#Baka_leczenie").css({
- background: 'url(http://i.imgur.com/pWp54Tx.gif)'
- });
- document.getElementById("Baka_leczenie").setAttribute("tip", "<b>Autoheal on</b>");
- }
- }).appendTo('#panel')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement