Jump to content

Community Scripts [Links in OP]


DvDivXXX
 Share

Recommended Posts

Le 21/04/2023 à 00:34, Tom208 a dit :

Since the issue is just a wrong typo of an attribute, we can hope KK fix it next week 🤞

Apparently I made a mistake, so I fix it now:

Since the issue is just a wrong typo of an attribute, we can hope KK fix it next week one day 🤞 (but not today)

  • Haha 6
Link to comment
Share on other sites

On 4/24/2023 at 1:40 AM, zoopokemon said:

Too add some extra clarification. The "Randomize Waifu" button will change out the current selection, while the "Cylce Waifu" button will set it to select a random girl every time you enter the homepage. The random selection will either choose from all girls or just ones favorited, minus the last selected girl, which can be set with the mode button above the cycle button.

Oh and if anyone else doesn't see the Improved Waifu feature even if you have HH++ BDSM v1.34.0, you have to visit the harem page first for it to work.

Even when I choose to hide the waifu, the background stayed blurred (as if the waifu is still shown). I think that's a bug, when the waifu is hidden, the background (cityl should look sharp and not blurred.

 

Link to comment
Share on other sites

On 4/23/2023 at 12:46 PM, 430i said:

Here is the fixed version of the image viewer script. sorry for the archaic delivery method, but I am not putting this stuff on my professional github account and I aint creating a separate one just for that...

// ==UserScript==
// @name         Hentai Heroes image viewer
// @namespace    http://tampermonkey.net/
// @version      1.0.3
// @description  Allows you to display any stage image of any harem girl, owned ones or not. Works also in event display and Places of Power. Includes zoom-in feature to display full-size girl images gallery (lightbox).
// @author       randomfapper34, 430i
// @match        http*://nutaku.haremheroes.com/*
// @match        http*://*.hentaiheroes.com/*
// @match        http*://*.gayharem.com/*
// @match        http*://*.comixharem.com/*
// @require      https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js
// @grant        none
// @license      MIT
// ==/UserScript==

// gayharem image link head:    gh1
// hentaiharem image link head: hh2
// comixharem image link head:  ch

var $ = window.jQuery;
var haremHead = (function() {
    var haremType = ($('body#hh_gay').length > 0) ?
                    'gh1' :
                    ($('body#hh_comix').length > 0) ? 'ch' : 'hh2';
    return 'https://' + haremType;
})();
var wikiLink = (function() {
    var haremType = ($('body#hh_gay').length > 0) ?
                    'harem-battle.club/wiki/Gay-Harem/GH:' :
                    ($('body#hh_comix').length > 0) ? '' : 'harem-battle.club/wiki/Harem-Heroes/HH:';
    return haremType;
})();
var CurrentPage = window.location.pathname;
var sheet = (function() {
    var style = document.createElement('style');
    document.head.appendChild(style);
    return style.sheet;
})();
var imageExt = '-1200x.webp'; //old ext: '.png';
var icoExt = '-300x.webp';

$(document).ready(function() {
    //include lightbox css
    $(document.head).append(
        '<link href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css" rel="stylesheet" type="text/css">'
    );
    //define own css
    defineCss();
});

// current page: Activities (PoP)
if (CurrentPage.indexOf('activities') != -1)
{
    if ($('.pop_list').css('display') != 'none') return;

    setTimeout(async function () {
        var popElement = $('#activities #pop.canvas');
        var popImage = popElement.find('.pop_left_part img');
        var popRewardInfo = popElement.find('.pop_rewards_display.reward_wrap').attr('data-reward-display');
        var popImageIcon = popElement.find('.pop_rewards_display .shards_girl_ico img');
        //if girl is won, there is no shards data in popRewardInfo, and therefore no id. Use regex to get girl id from image link?
        var jsonReward = JSON.parse(popRewardInfo);
        if (!jsonReward.hasOwnProperty('shards')) return;
        var girlInfo = jsonReward.shards[0];
        var girlId = girlInfo.id_girl;
        var girlGrades = girlInfo.graded2.split('<g').length - 1;

        //check for image existance with high grades (always work no matter the webpage display chages)
        if (girlGrades == 0) {
            girlGrades = 5;
            var checkImageLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ava5' + imageExt;
            if (await checkUrlResponse(checkImageLink) === false) girlGrades = 3;
        }

        //create diamonds on the top part
        popElement.find('.diamond-bar').remove();
        var allDiamonds = '';
        for (var i = 0; i <= girlGrades; i++) {
            var diamondToAdd = '<div class="diamond unlocked" grade="' + i + '"></div>';
            allDiamonds += diamondToAdd;
        }
        popImage.before('<div class="diamond-bar-container"><div class="diamond-bar">' + allDiamonds + '</div></div>');

        //connect diamonds to image links
        var allLinks = popElement.find('.diamond');
        var linksArray = [];
        for (i = 0; i <= girlGrades; i++) {
            var imgLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ava' + i + imageExt;
            var icoLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ico' + i + icoExt;
            linksArray.push(imgLink);
            $(allLinks.get(i)).attr("link", imgLink);
            $(allLinks.get(i)).attr("icoLink", icoLink);
        }

        $( ".pop_left_part .diamond-bar .diamond" ).on('mouseenter', function() {
            var girlAvatarLink = $(this).attr('link');
            var girlIconLink = $(this).attr('icoLink');
            popImage.attr('src', girlAvatarLink);
            popImageIcon.attr('src', girlIconLink);
        });

        //create zooming event
        $(popImage).removeData('allImages');
        $(popImage).data('allImages', linksArray);
        $(popImage).on('mouseup', zoomIntoImage);
    }, 50);
}

// current page: Event box
if (CurrentPage.indexOf('event') != -1)
{
    var eventGirlElementSelector = ".nc-event-list-rewards-container .nc-event-list-reward-container"
    var rewardBox = ".nc-event-reward-container.selected ";
    var eventGirlImageSelector = ".canvas " + rewardBox + " .nc-event-reward-preview";
    var eventGirlInfoSelector = ".canvas " + rewardBox + " .nc-event-reward-info";

    setTimeout(function () {
        $(eventGirlElementSelector + ".selected").click();
    }, 50);

    $(eventGirlElementSelector).on('click', function() {
        setTimeout(async function () {
            var girlImageDiv = $(eventGirlImageSelector);
            var girlInfoDiv = $(eventGirlInfoSelector);
            var girlInfo = girlInfoDiv.find('.new_girl_info .girl_tooltip_grade');
            var girlGrades = girlInfo.find('g').length;
            var girlIconImage = $(".nc-event-list-rewards-container > .nc-event-list-reward-container.selected img");
            var girlImage = girlImageDiv.find('img').first();
            girlImageDiv.find('.diamond-bar').remove();

            //find girl id from image src
            var girlImageSrc = girlImage.attr('src');
            var startPosition = girlImageSrc.indexOf('pictures/girls/') + 'pictures/girls/'.length;
            var girlIdStr = girlImageSrc.substring(startPosition, girlImageSrc.lastIndexOf('/ava'));
            if (isNaN(girlIdStr))
                return;
            var girlId = parseInt(girlIdStr);

            //check for image existance with high grades (always work no matter the webpage display chages)
            if (girlGrades == 0) {
                girlGrades = 5;
                var checkImageLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ava' + girlGrades + imageExt;
                if (await checkUrlResponse(checkImageLink) === false) girlGrades = 3;
            }

            //create diamonds on the top part
            var allDiamonds = '';
            for (var i = 0; i <= girlGrades; i++) {
                var diamondToAdd = '<div class="diamond unlocked" grade="' + i + '"></div>';
                allDiamonds += diamondToAdd;
            }
            girlImage.before('<div class="diamond-bar">' + allDiamonds + '</div>');

            //connect diamonds to image links
            var allLinks = girlImageDiv.find('.diamond');
            var linksArray = [];
            for (i = 0; i <= girlGrades; i++) {
                var imgLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ava' + i + imageExt;
                var icoLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ico' + i + icoExt;
                linksArray.push(imgLink);
                $(allLinks.get(i)).attr("link", imgLink);
                $(allLinks.get(i)).attr("icoLink", icoLink);
            }

            $( rewardBox + " .diamond-bar .diamond" ).on('mouseenter', function() {
                var girlAvatarLink = $(this).attr('link');
                var girlIconLink = $(this).attr('icoLink');
                girlImage.attr('src', girlAvatarLink);
                girlIconImage.attr('src', girlIconLink);
            });

            //create zooming event
            $(girlImage).removeData('allImages');
            $(girlImage).data('allImages', linksArray);
            $(girlImage).off('mouseup', zoomIntoImage);
            $(girlImage).on('mouseup', zoomIntoImage);
        }, 10);
    });
}

// current page: Harem
if (CurrentPage.indexOf('harem') != -1)
{
    var callback = function(mutationsList) {
        for (let mutation of mutationsList) {
            if (mutation.type === 'childList') {
                mutation.addedNodes.forEach(node => {
                    if (node.outerHTML) {
                        node.addEventListener('click', onGirlClick, false);
                    }
                });
            }
        }
    };

    const targetNode = document.querySelector('#harem_left div.girls_list');
    const config = { childList: true };
    const observer = new MutationObserver(callback);
    observer.observe(targetNode, config);
    $( ".girls_list div[id_girl]" ).on('click', onGirlClick);

    function onGirlClick(event) {
        var girlId = $(this).children('[girl]').attr('girl');
        var girlGrades = $(this).find('.graded').children().length;
        var girlName = $(this).find('div.right h4')[0].innerText;
        updateInfo(girlId, girlGrades, girlName);
    }

    setTimeout(function () {
        //update view of girl currently selected when loading the harem
        $("#harem_left div.girls_list div[girl].opened").click();
    }, 200);

    function updateInfo(girlId, girlGrades, girlName)
    {
        setTimeout(function () {
            var haremRight = $('#harem_right');
            haremRight.children('[girl]').each( function() {
                if (girlId == 0) girlId = $(this).attr('girl');

                var notOwned = $(this).children('.missing_girl').length > 0;
                var girlIconDiv = $("#harem_left div.girls_list div[girl].opened div.left img");

                if (notOwned) {
                    //create diamonds on the bottom part
                    var allDiamonds = '';
                    for (var i = 0; i <= girlGrades; i++) {
                        var diamondToAdd = '<div class="diamond locked" grade="' + i + '"></div>';
                        allDiamonds += diamondToAdd;
                    }

                    $(this).find('.diamond-bar').remove();

                    $(this).find('.middle_part').css('margin', '0');
                    $(this).find('.dialog-box').after('<h3>' + girlName + '</h3>');
                    $(this).find('img.avatar').wrap('<div class="avatar-box"></div>');
                    $(this).find('.avatar-box').css('margin-top', '23px');
                    $(this).find('.avatar-box').first().after('<div class="diamond-bar">' + allDiamonds + '</div>');
                }

                //update for any girl (owned or not)
                var wikiBase = wikiLink;
                if (wikiBase != '') {
                    $(this).find('h3').wrap('<div class="WikiLink"></div>').wrap('<a href="https://' + wikiBase + girlName + '" target="_blank"></a>');
                }
                var allLinks = $(this).find('.diamond');
                var linksArray = [];
                for (i = 0; i <= girlGrades; i++) {
                    var imgLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ava' + i + imageExt;
                    var icoLink = haremHead + '.hh-content.com/pictures/girls/' + girlId + '/ico' + i + icoExt;
                    linksArray.push(imgLink);
                    $(allLinks.get(i)).attr("link", imgLink);
                    $(allLinks.get(i)).attr("icoLink", icoLink);
                }
                $('.avatar-box img.avatar').removeData('allImages');
                $('.avatar-box img.avatar').data('allImages', linksArray);
                if (notOwned) $('.avatar-box img.avatar').attr('src', linksArray[0]);

                $('.variation_block .big_border').on('click', function() {
                    var girlId = $(this).children('[girl]').attr('girl');
                    var girlGrades = $(this).find('.graded').children().length;
                    setTimeout(function() {
                        updateInfo(girlId, girlGrades, girlName);
                    }, 50);
                });

                $( ".diamond-bar .diamond" ).on('mouseenter', function() {
                    var mainParent = $(this).closest('.middle_part');
                    var girlAvatar = mainParent.find('img.avatar');
                    var girlAvatarLink = $(this).attr('link');
                    var girlIconLink = $(this).attr('icoLink');
                    girlIconDiv.attr('src', girlIconLink);
                    girlAvatar.attr('src', girlAvatarLink);
                });

                $('.avatar-box img.avatar').on('mouseup', zoomIntoImage);
            });
        }, 0);
    }
}

//zoom into image with lightbox, event only on left click
function zoomIntoImage(e)
{
    if (e.which != 1) return;

    var linksArray = $(this).data('allImages');
    var girlAvatarLink = $(this).attr('src');
    var indexOfQuestion = girlAvatarLink.lastIndexOf('?');
    if (indexOfQuestion >= 0) girlAvatarLink = girlAvatarLink.slice(0, indexOfQuestion);
    var indexOfCurrent = linksArray.indexOf(girlAvatarLink);

    var allImages = [];
    for (var i = 0; i < linksArray.length; i++) {
        allImages.push({
            src  : linksArray[i].toString(),
            type : 'image',
            opts : {
                caption : i == 0 ? 'Default' : 'Stage ' + i
            }
        });
    }

    $.fancybox.open(allImages, {
        loop : true,
        keyboard: true,
        transitionEffect: "tube"
    }, indexOfCurrent);
}

//checks for any errors in url (like image 404)
async function checkUrlResponse(url)
{
    let result = false;

    await fetch(url.toString())
    .then(function(response) {
        if (response.status >= 200 && response.status <= 299) {
            return response;
        } else {
            throw Error(response.statusText);
        }
    }).then(function(response) {
        result = true;
    }).catch(function(error) {
    });

    return result;
}

function defineCss()
{
    sheet.insertRule('#harem_left div[girl]>.left>img, #harem_right>div[girl] .middle_part div.avatar-box img.avatar, #shops #girls_list .g1 .girl-ico>img {'
                     + 'image-rendering: initial; }');

    sheet.insertRule('#harem_right .WikiLink a {'
                     + 'text-decoration: none; }');

    sheet.insertRule('#harem_right .diamond-bar {'
                     + 'margin-top: 4px; }');

    sheet.insertRule('.rewards-stats .diamond-bar {'
                     + 'position: static;'
                     + 'justify-content: center;'
                     + 'margin-top: 42px;'
                     + 'margin-bottom: -40px; }');

    sheet.insertRule('.generic-girl-image .diamond-bar, .nc-event-reward-preview .diamond-bar {'
                     + 'justify-content: center;'
                     + 'z-index: 1;'
                     + 'width: 100%; }');

    sheet.insertRule('.rewards-stats .avatars-drawn-bottom-part .diamond-bar {'
                     + 'margin-top: 275px; }');

    sheet.insertRule('.rewards-stats .avatars-drawn-bottom-part img {'
                     + 'margin-top: -275px; }');

    sheet.insertRule('.rewards-stats .diamond-bar .diamond.unlocked, .pop_left_part .diamond-bar .diamond.unlocked, .generic-girl-image .diamond-bar .diamond.unlocked {'
                     + 'cursor: default; }');

    sheet.insertRule('.pop_left_part .diamond-bar-container {'
                     + 'z-index: 5;'
                     + 'position: absolute; }');

    sheet.insertRule('.pop_left_part .diamond-bar {'
                     + 'position: relative;'
                     + 'left: 50%; }');

    sheet.insertRule('#harem_right .diamond-bar .diamond:hover, .rewards-stats .diamond-bar .diamond:hover, .pop_left_part .diamond-bar .diamond:hover, .generic-girl-image .diamond-bar .diamond:hover, .nc-event-reward-preview .diamond-bar .diamond:hover {'
                     + 'border: 2px solid #FE00FE; }');

    sheet.insertRule('.avatar-box img, .event-widget.special-fullscreen-view .widget .rewards-stats .reward img, .generic-girl-image img, .nc-event-reward-preview img {'
                     + 'cursor: zoom-in; }');

    sheet.insertRule('#pop.canvas .pop_left_part img.pop_left_fade_page {'
                     + 'margin-bottom: 10px;'
                     + 'cursor: zoom-in; }');
}

If you encounter any problems just ping me here

  • Thanks 2
Link to comment
Share on other sites

Help! the top links to the season, league and market boosters made by the script have disappeared...

Ok, I managed to update it, thanks 🙏🏻

You can delete this post.

On a second thought - Maybe it's beneficial to put a notice here, for people who don't know what to do - update the script via this link:

https://raw.githubusercontent.com/zoop0kemon/hh-plus-plus/main/dist/hh-plus-plus.user.js

 

Edited by OmerB
  • Thanks 1
Link to comment
Share on other sites

  • Moderator

Yeah!  I was gonna post about my resource bars disappearing, but... well it's been fixed already, after "checking for updates."  So I'll just post this here in case others haven't "checked for updates" yet.

At the start of the MD:

image.thumb.png.a1aacb5fd9e01a9ab16c2e3f46e5e870.png

After "checking for updates":

image.thumb.png.9666d5e1132fa4cc04443ec81e800cc6.png

I'm using the HH++ BDSM 1.34.4.  I figured that Zoo must've added a quick fix as well.

Edited by Ravi-Sama
  • Like 3
Link to comment
Share on other sites

20 minutes ago, Ravi-Sama said:

Yeah!  I was gonna post about my resource bars disappearing, but... well it's been fixed already, after "checking for updates."  So I'll just post this here in case others haven't "checked for updates" yet.

At the start of the MD:

image.thumb.png.a1aacb5fd9e01a9ab16c2e3f46e5e870.png

After "checking for updates":

image.thumb.png.9666d5e1132fa4cc04443ec81e800cc6.png

I'm using the HH++ 1.34.4.  I figured that Zoo must've added a quick fix as well.

Where do you download the HH++ BDSM update from? I try through Check for Script Updates but it doesn't show up for me to have updates. My version of HH++ BDSM is 1.32.5, I would like to finally update.

  • Thanks 1
Link to comment
Share on other sites

  • Moderator
15 minutes ago, 007V said:

Where do you download the HH++ BDSM update from? I try through Check for Script Updates but it doesn't show up for me to have updates. My version of HH++ BDSM is 1.32.5, I would like to finally update.

HH++ BDSM 1.34.4

It's always the same github link, I recommend bookmarking it.

Edited by Ravi-Sama
  • Thanks 1
Link to comment
Share on other sites

  • Moderator

The daily missions are sorted in OCD but not in BDSM, it seems (or is it just me?). I remember Tom's post with the sorting not long after Zoo added the compact missions to BDSM's Style Tweaks and it looked really clean. Then I remembered that since Style Tweaks is no longer a separate thing (for BDSM at least) updates to it are no longer shared between the two versions.

Any chance we could have a sorting of missions by type or duration in BDSM as well? It would be much appreciated.

Link to comment
Share on other sites

  • Moderator

Like DerDinX said: it's a new fork that zoopokemon had to start as he started maintain the script after Numbers quitted the game. So best is to download the new fork from zoopokemon and delete the old version from Numbers.

Link to comment
Share on other sites

On 4/25/2023 at 12:48 AM, Tom208 said:

It's already sorted 😉

 

Hentai_Heroes_-_2023-04-25_00.47.56.png

  

2 hours ago, DvDivXXX said:

The daily missions are sorted in OCD but not in BDSM, it seems (or is it just me?). I remember Tom's post with the sorting not long after Zoo added the compact missions to BDSM's Style Tweaks and it looked really clean. Then I remembered that since Style Tweaks is no longer a separate thing (for BDSM at least) updates to it are no longer shared between the two versions.

Any chance we could have a sorting of missions by type or duration in BDSM as well? It would be much appreciated.

Yeah I was wondering, how he did that myself.

Maybe it was just a coincidence, or he knows how Photoshop works. 😄

One other possibilty might have been, that Tom just changed something in the BDSM Script, cause he would shurely know what to look for.
But then again if it would have been that easy zoo would have done it anyway by now.

And as far as I can tell, there is no Equivalent in OCD to this style.

  • Like 1
Link to comment
Share on other sites

Interesting would be to know, which features did you allow?

I don't see anything that mentions sorting missions in Style Tweak or HH++ Core.

If only OCD is enabled, I can't see the whole Options.

image.png.f93344c53a796bfdbb29a6525bea82e9.png

I'm beginning to think, it might be a Browser Thing?
(I use Firefox 112.0.2, which should be up to date.)

Link to comment
Share on other sites

il y a 32 minutes, Der DinX a dit :

I don't see anything that mentions sorting missions in Style Tweak or HH++ Core.

It's because it's not an option in OCD script. I prefer to keep simple the options menu, so there are some features they are part of the script core. That's the case for the missions sorting. 

il y a 37 minutes, Der DinX a dit :

If only OCD is enabled, I can't see the whole Options.

Your script is not up to date, if you update it, you should see the whole options menu. Here is the link to do that:

https://sleazyfork.org/fr/scripts/415625-hentai-heroes-ocd-season-version

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

On 5/3/2023 at 2:56 PM, zoopokemon said:

It's on the todo list

And it's done, added in v1.35.0

 

On 4/30/2023 at 1:41 AM, OmerB said:

Even when I choose to hide the waifu, the background stayed blurred (as if the waifu is still shown). I think that's a bug, when the waifu is hidden, the background (cityl should look sharp and not blurred.

Opps, never noticed this as I also have the Legacy layout module turned on and that always has the blur disabled. Should be fixed now.

Also,

On 4/24/2023 at 3:54 PM, Der DinX said:

Is there maybe a possibility to integrate a function to save the settings and restore them if needed?

On 4/24/2023 at 6:42 PM, Ravi-Sama said:

Yeah, saving the settings locally would be nice.  Could import them if they are lost.

Use the scroll wheel on a mouse to zoom in or out.  Then, save the changes.

Don't think I'll be adding that, but the key used for it in the localStorage is HHPlusPlusWaifuInfo and you can copy and paste it with dev tools

image.png.02ec5445b6bb2f51150780429f8f5f79.png

 

 

  • Like 1
  • Thanks 3
Link to comment
Share on other sites

  • DvDivXXX changed the title to Community Scripts [Links in OP]
  • Ravi-Sama featured this topic
  • Ravi-Sama pinned this topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...