Sleazy Fork is available in English.

Harem Heroes++

Adding things here and there in Harem Heroes game.

< Valutazione su Harem Heroes++

Recensione: Bene - lo script funziona

§
Pubblicato: 15/03/2018

Hollo's 3/14 fixes

I noticed a few things breaking in HH++, so I tried fixing them. I can't alter the original, naturally, but I'll share the changes here in case others are adventurous enough to edit the script themselves.

1: Undefined "Hero" when viewing the Harem page. Apparently that data structure isn't provided for that page(?). Possibly others as well. So, at the beginning of FightATroll():

// Some pages don't carry the Hero data - skip the menu in this case
if (typeof Hero == 'undefined') {
    return;
}

2: Undefined "substr" in the Harem page in certain cases. I'm still not exactly sure why, but some things don't have an href attribute to add to ScenesLink. So I check for that. Replace the line that starts with "ScenesLink +=" with the following:

var attrHref = $(this).parent().attr('href');
if (typeof attrHref != 'undefined') {
    ScenesLink += attrHref.substr(7);
}

3: Lots of "mixed HTTP requests" reported. This was simply because a lot of the links in HH++ are HTTP instead of HTTPS . Simple fix: update all of them to HTTPS . (I'm guessing HH wasn't always as secure in the past, and only recently started respecting HTTPS requests.)

4: Hourly harem income report was much too low. Apparently the data structure now reports salary with commas, e.g. "4000" is now "4,000/h" and the parser was stopping at "4". So I just removed the commas. Replace the line that updates IncHourly with the following:

var salaryStr = $(this).find('.salary').text().replace(/,/g,"");
IncHourly += parseInt(salaryStr, 10);
§
Pubblicato: 15/03/2018

Hey, I have some problems with the script. Can you help me? it shows that there are 4 syntax errors in the script. 2 of them are "__" is already defined. the other 2 are "__" is out of scope.

Here's the parts with the problems.

            marketGiftTxt = lsMarket.buyable.gift.Nb + ' gift' + (lsMarket.buyable.gift.Nb > 1 ? 's' : '') + ' (' + NbCommas(lsMarket.buyable.gift.Xp) + ' Aff)',RestockInfo = '- ' + marketBookTxt + ' for ' + NbCommas(lsMarket.buyable.potion.Value) + ' <img src="http://i.harem-battle.club/images/2017/01/07/0Gsvn.png">'+ '<br />- ' + marketGiftTxt + ' for ' + NbCommas(lsMarket.buyable.gift.Value) + ' <img src="http://i.harem-battle.club/images/2017/01/07/0Gsvn.png">'+ '<br /><font style="color:gray;">Restock: ' + d.toLocaleString() + ' (or level ' + (Hero.infos.level+1) + ')</font>';
    }

    // my stocks
    var myArmorTxt = NbCommas(lsMarket.stocks.armor.Nb) + (lsMarket.stocks.armor.Nb > 99 ? '+ ' : ' ') + 'equipment' + (lsMarket.stocks.armor.Nb > 1 ? 's' : ''),       myBoosterTxt = NbCommas(lsMarket.stocks.booster.Nb) + ' booster' + (lsMarket.stocks.booster.Nb > 1 ? 's' : ''),     myBookTxt = NbCommas(lsMarket.stocks.potion.Nb) + ' book' + (lsMarket.stocks.potion.Nb > 1 ? 's' : '') + ' (' + NbCommas(lsMarket.stocks.potion.Xp) + ' Xp)',       myGiftTxt = NbCommas(lsMarket.stocks.gift.Nb) + ' gift' + (lsMarket.stocks.gift.Nb > 1 ? 's' : '') + ' (' + NbCommas(lsMarket.stocks.gift.Xp) + ' Aff)',            MarketStocks = '- ' + myArmorTxt + ', ' + myBoosterTxt+ '<br />- ' + myBookTxt + '<br />- ' + myGiftTxt + '<span class="subTitle">Currently Buyable Stocks:</span>'+ RestockInfo;
} catch(e) {
    var MarketStocks = (lsAvailable == 'yes') ? '> Visit the <a href="../shop.html">Market</a> first.' : '> Your webbrowser is not compatible.';
}

var StatsString = '<div class="StatsContent"><span class="Title">Harem Stats:</span>'           + '<span class="subTitle" style="margin-top:-10px;">' + i + ' haremettes:</span>'               + '- ' + Specialty[0] + ' Hardcore, ' + Specialty[1] + ' Charm, ' + Specialty[2] + ' Know-how'              + '<br />- ' + UnlockedSc + '/' + AvailableSc + ' unlocked scenes'              + '<span class="subTitle">Money incomes:</span>'                + '~' + NbCommas(IncHourly) + ' <img src="http://i.harem-battle.club/images/2017/01/07/0Gsvn.png"> per hour'                + '<br />' + NbCommas(IncCollect) + ' <img src="http://i.harem-battle.club/images/2017/01/07/0Gsvn.png"> when all collectable'              + '<span class="subTitle">Required to unlock all locked scenes:</span>'             + '- ' + NbCommas(Saffection) + ' affection'                + '<br />- ' + NbCommas(Smoney) + ' <img src="http://i.harem-battle.club/images/2017/01/07/0Gsvn.png">'+ ' or ' + NbCommas(Skobans) + ' <img src="http://i.harem-battle.club/images/2016/08/30/gNUo3XdY.png">'              + '<span class="subTitle">My Stocks:</span>'                + MarketStocks                  + '</div>';

Note: I edited the script as it was having a lot of Misleading line break errors. Like this:

                SceneLink = '<a href="/quest/' + hh_scenes[i] + '?hh_scenes='
                    + hh_scenesParams + '">scene</a>';
§
Pubblicato: 16/03/2018

Despite looking at the code you posted, and my copy of it in the original script, I can't tell why you're getting an error about "____" being already defined or out of scope.

My best suggestion is to use the developer tools that come with Chrome and / or Firefox to find the cause of the problem. Hopefully you have enough Javascript experience to know how they work.

Meanwhile, I would suggest leaving the code indentation as it was. That might even be what caused your problem (which doesn't occur in my copy).

§
Pubblicato: 19/03/2018
Modificato: 19/03/2018

When I leave it as it is, it doesn't work at all, like it doesn't even show up in the nutaku.net website when i pull down the Tampermonkey to see the scripts running.
I downgraded the script already and it still doesn't show up.

May I have a copy of your script so that I may test it, and so that my problem may be fixed.

Also, I don't know much in using the developer tools in Chrome, so I can't really find the cause of the problem.

Note: I find that scripts can work in the website when I tested HaremHeroes Automatic, so the problem is not in the website.

Update: I kind of fixed it but, everything is kind of messed up. Here's a picture: https://imgur.com/a/RhHxC

Pubblica risposta

Accedi per pubblicare una risposta.