Kour KP Script

Unlimited 1500 KP Daily Rewards

  1. // ==UserScript==
  2. // @name Kour KP Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Unlimited 1500 KP Daily Rewards
  6. // @author rexmine2
  7. // @match *://kour.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=kour.io
  9. // @grant none
  10. // @license ISC <3
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. // Observer pour les mutations dans le DOM (inchangé)
  15. new MutationObserver((mutations) => {
  16. for (const mutation of mutations) {
  17. for (const node of mutation.addedNodes) {
  18. if (node.tagName === 'SCRIPT' && !node.src) {
  19. if (String(node.textContent).toLowerCase().includes('userscript')) {
  20. node.textContent = 'console.log(`Nice "anticheat" :D`)';
  21. }
  22. }
  23. }
  24. }
  25. }).observe(document, { childList: true, subtree: true });
  26.  
  27. // Modification de la fonction fetch (inchangée)
  28. const _fetch = window.fetch;
  29. window.fetch = function () {
  30. if (arguments[0].includes('/api/track')) {
  31. return Promise.reject();
  32. }
  33.  
  34. return _fetch.apply(this, arguments);
  35. }
  36.  
  37. // Fonction pour fixer les récompenses quotidiennes
  38. function fixDailyRewards(selectedDay) {
  39. try {
  40. if (!window.firebase.auth()?.currentUser) return;
  41.  
  42. let shouldSet = false;
  43.  
  44. const rewardObj = { lastDailyReward: selectedDay }; // Utilisation du jour modifié
  45. const refKey = 'users/' + window.firebase.auth().currentUser.uid;
  46.  
  47. window.firebase.database().ref(refKey).once('value', e => {
  48. const obj = e.val();
  49.  
  50. Object.keys(obj).forEach(key => {
  51. if (key.startsWith('dailyReward_')) {
  52. rewardObj[key] = null;
  53. shouldSet = true;
  54. }
  55.  
  56. if (key === 'lastDailyReward' && obj[key] !== selectedDay) {
  57. shouldSet = true;
  58. }
  59. });
  60.  
  61. if (shouldSet) {
  62. window.firebase.database().ref(refKey).update(rewardObj);
  63. window.showUserDetails('', window.firebase.auth().currentUser);
  64. }
  65. });
  66.  
  67. } catch { }
  68. }
  69.  
  70. // Fonction pour manipuler les données et envoyer des messages (inchangée)
  71. function fakeSetDataNew(a) {
  72. window.unityInstance.SendMessage('FirebasePlayerPrefs2023', 'OnSetData', '{"err":null}&' + [...a].pop());
  73. }
  74.  
  75. // Définition de la propriété unityInstance (inchangée)
  76. Object.defineProperty(window, 'unityInstance', {
  77. get() {
  78. return this._unityInstance;
  79. },
  80. set(v) {
  81. const _setDataNew = window.setDataNew;
  82. window.setDataNew = function () {
  83. if (arguments[1] === 'banned') {
  84. fakeSetDataNew(arguments);
  85. return;
  86. }
  87.  
  88. if (arguments[1].includes("dailyReward_")) {
  89. fakeSetDataNew(arguments);
  90. window.showUserDetails('', window.firebase.auth().currentUser);
  91. return;
  92. }
  93.  
  94. if (arguments[1] === 'lastDailyReward') {
  95. arguments[2] = '5';
  96. }
  97.  
  98. return _setDataNew.apply(this, arguments);
  99. }
  100.  
  101. this._unityInstance = v;
  102.  
  103. const _SendMessage = this._unityInstance.SendMessage;
  104. this._unityInstance.SendMessage = function () {
  105. if (arguments[1] === 'OnLoggedInGoogle') fixDailyRewards();
  106. return _SendMessage.apply(this, arguments);
  107. }
  108. },
  109. });
  110.  
  111. // Demander à l'utilisateur quel jour il souhaite définir pour la récompense
  112. function promptUserForDay() {
  113. // Demander à l'utilisateur de choisir un jour avec un prompt
  114. const userInput = prompt("Quel jour souhaitez-vous définir pour votre récompense quotidienne ? (ex. 22, 23, 24...)");
  115.  
  116. // Vérifier si la saisie est valide
  117. if (userInput && !isNaN(userInput)) {
  118. let selectedDay = parseInt(userInput.trim()); // Convertir l'entrée en entier
  119. if (selectedDay > 2) {
  120. selectedDay -= 2; // Soustraire 2 au jour choisi
  121. console.log(`Récompense quotidienne changée au jour ${selectedDay}`);
  122. fixDailyRewards(selectedDay); // Appeler la fonction pour modifier la récompense
  123. } else {
  124. alert("Le jour saisi est trop petit. Veuillez saisir un jour supérieur à 2.");
  125. }
  126. } else {
  127. alert("Entrée invalide. Veuillez saisir un jour valide.");
  128. }
  129. }
  130.  
  131. // Ajout de l'écouteur de la touche "K" pour changer le daily reward
  132. document.addEventListener('keydown', (event) => {
  133. // Vérifie si la touche appuyée est "K" (keyCode 75 ou "k")
  134. if (event.key.toLowerCase() === 'k') {
  135. console.log('Touche "K" pressée, changement de la daily reward !');
  136. promptUserForDay(); // Demande à l'utilisateur de choisir un jour
  137. }
  138. });