Kiko Pop Fix

Makes Kiko Pop Playable without Flash

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Kiko Pop Fix
// @license      GNU GPLv3
// @namespace    https://lel.wtf
// @version      1.07
// @description  Makes Kiko Pop Playable without Flash
// @author       Lamp
// @match        https://www.neopets.com/worlds/kiko/kpop/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=neopets.com
// @grant        none

// ==/UserScript==

(function() {
    if (document.getElementById("difficultyForm")) {
        document.getElementById("difficultyForm").remove();
    }

    function kikoplay() {
        if (document.querySelector("#kikopop")) {
            document.querySelector("#kikopop").play()
        }
    }


    var kikofix = document.createElement("div");
    kikofix.id = "diffbuttons";
    kikofix.innerHTML = `<center>
  <div class="buttonfix" onclick="setDifficulty(1); prizebutton(1)" style="padding-top: 10px; margin: 0px auto 10px;">
    <b>EASY</b>
  </div>
  <div class="buttonfix" onclick="setDifficulty(2); prizebutton(2)" style="padding-top: 10px; margin: 0px auto 10px;">
    <b>MEDIUM</b>
  </div>
  <div class="buttonfix" onclick="setDifficulty(3); prizebutton(3)" style="padding-top: 10px; margin: 0px auto 10px;">
    <b>HARD</b>
  </div>
</center>

`;

    document.querySelector("#pageDesc").appendChild(kikofix);

    var script = document.createElement("script");

    script.type = "text/javascript";
    script.text = `
 function prizebutton(dif){
 document.getElementById('diffbuttons').remove();
                var kikofix = document.createElement('div');
                kikofix.id = "kikofix";
                kikofix.innerHTML = '<br><br><br><center><div class="buttonfix prizebutton" onclick="getResultfix('+dif+', true)" style="padding-top: 10px; margin: 0px auto 10px;"><b>GET PRIZE</b></div></center>';
                document.querySelector("#pageDesc").appendChild(kikofix);

    }

 function getResultfix(difficulty, hit) {
  document.getElementsByClassName('buttonfix')[0].remove();
		$.ajax({
				url: 'ajax/prize.php',
				data: { difficulty: difficulty },
				success: function(data) {
					if (data.success) {
						prize = data.prize;
						avatar = data.avatar;
						$('#prizeButton').show('fast');
					}
                    else{
                    alert("Sorry, you didn't win anything this time. :(");
                    }
				}
			});
}
`;

    document.head.appendChild(script);

    var style = document.createElement("style");
    style.type = "text/css";
    style.innerHTML = `

.buttonfix {

    width: 190px;
    height: 30px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 9pt;
;
    background: url(https://images.neopets.com/games/dart/buttons/bg.png) -560px 0 no-repeat;
    cursor: pointer;
}

.prizebutton{
position:relative;
  top: 300px;
     left:500px;

}

     #kikofix{

     position: relative;
     z-index: 9;
     width: 190px;
     height: 39px;

}

     #diffbuttons{
  top: 300px;
     left:500px;
     position: relative;
     z-index: 9;
     width: 190px;
     height: 39px;

}

     #kikofix b, #diffbuttons b{

     color: black !important;

}

`;

    document.getElementsByTagName("html")[0].appendChild(style);

    setTimeout(kikoplay, 1500);
})();