NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name HaremHeroes Automatic Koban Pachinko // @namespace 3jameo3 // @version 0.2 // @description Not gonna be updated futher this was just showing the parts of the script to intergrate it into Eileen's script. Complete support for Eileen12's HaremHeroes Automatic Script. // @author 3jameo3 // @match http*://nutaku.haremheroes.com/* // @match http*://*.hentaiheroes.com/* // @updateURL https://openuserjs.org/meta/3jameo3/HaremHeroes_Automatic_Koban_Pachinko.meta.js // @require https://cdn.jsdelivr.net/js-cookie/2.2.0/js.cookie.js // @grant GM_addStyle // @license MIT // ==/UserScript== GM_addStyle('/* The switch - the box around the slider */ .switch { position: relative; display: inline-block; width: 60px; height: 34px; } /* Hide default HTML checkbox */ .switch input {display:none;} /* The slider */ .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s; } .slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; -webkit-transition: .4s; transition: .4s; } input:checked + .slider { background-color: #2196F3; } input:focus + .slider { box-shadow: 0 0 1px #2196F3; } input:checked + .slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px); } /* Rounded sliders */ .slider.round { border-radius: 34px; } .slider.round:before { border-radius: 50%; }'); function getHero() { if(unsafeWindow.Hero === undefined) { setTimeout(autoLoop, Number(sessionStorage.autoLoopTimeMili)); //console.log(window.wrappedJSObject) } return unsafeWindow.Hero; } function getPage() { try{ var ob = document.getElementById("hh_nutaku"); if(ob===undefined || ob === null) { ob = document.getElementById("hh_hentai"); } return ob.className.match(/.*page-(.*) .*/i)[1]; } catch(err) { return ""; } } // Retruns true if on correct page. function gotoPage(page) { if(getPage() === page) { return true; } else { console.log("Navigating to page: "+page); var togoto; // get page path switch(page) { case "pachinko": togoto = $("nav div[rel='content'] a:has(.pachinko)").attr("href"); break; default: console.log("Unknown goto page request. No page \'"+page+"\' defined."); } if(togoto !== undefined) { sessionStorage.autoLoop = "false"; window.location = window.location.origin + togoto; } else console.log("Couldn't find page path. Page was undefined..."); return false; } } var updateData = function () { sessionStorage.autoKobanPachinko = document.getElementById("autoKobanPachinko").checked; }; var getKobanPachinko = function(){ var hardCurrency = getHero().infos.hard_currency; try { if(!gotoPage("pachinko")) { // Not at Pachinko screen then goto the Pachinko screen. console.log("Navigating to Pachinko window."); return; } if (hardCurrency >= 90) { var button = $("#pachinko #pachinko_right button[class='orange_text_button right_pck1']"); console.log('Spending 90 kobals for chance to get a girl'); button.click(); return; } else if (hardCurrency <= 89) { console.log('Need ' + (90 - hardCurrency) + ' more kobals to use this function'); return; } } catch (ex) { console.log("Could not collect koban pachinko... " + ex); } }; var autoLoop = function () { var hardCurrency = getHero().infos.hard_currency; if(sessionStorage.autoKobanPachinko === "true" && busy === false){ // Navigate to pachinko if (hardCurrency >= 90) { console.log("Time to play Koban Pachinko."); getKobanPachinko(); busy = true; } } }; var setDefaults = function () { console.log("Setting Defaults."); sessionStorage.autoKobanPachinko = "false"; sessionStorage.autoLoop = "true"; sessionStorage.userLink = "none"; sessionStorage.autoLoopTimeMili = "200"; sessionStorage.freshStart = "no"; }; var start = function () { var UIcontainer = $("#contains_all nav div[rel='content']"); UIcontainer.html('<div style="position: absolute;right: 18.66%; padding: 10px;width: inherit;text-align: center;display:flex;flex-direction:column;">' +'<span>AutoPachinko(Koban)</span><div><label class=\"switch\"><input id=\"autoKobanPachinko\" type=\"checkbox\"><span class=\"slider round\"></span></label></div>' ); document.getElementById("autoKobanPachinko").checked = sessionStorage.autoKobanPachinko === "true"; sessionStorage.autoLoop = "true"; if (typeof sessionStorage.freshStart == "undefined" || isNaN(Number(sessionStorage.autoLoopTimeMili))) { setDefaults(); } autoLoop(); }; $("document").ready(start);