Kour Contraband crate script

Unlimited legendary crates

当前为 2025-05-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Kour Contraband crate script
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Unlimited legendary crates
  6. // @author Jhonny-The
  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. const _fetch = window.fetch;
  15. window.fetch = function () {
  16. if (arguments[0].includes('/api/track')) {
  17. return Promise.reject();
  18. }
  19. return _fetch.apply(this, arguments);
  20. }
  21.  
  22. function fixDailyRewards() {
  23. try {
  24. if (!window.firebase.auth()?.currentUser) return;
  25.  
  26. let shouldSet = false;
  27. const rewardObj = { lastDailyReward: '24' };
  28. const refKey = 'users/' + window.firebase.auth().currentUser.uid;
  29.  
  30. window.firebase.database().ref(refKey).once('value', e => {
  31. const obj = e.val();
  32.  
  33. Object.keys(obj).forEach(key => {
  34. if (key.startsWith('dailyReward_')) {
  35. rewardObj[key] = null;
  36. shouldSet = true;
  37. }
  38.  
  39. if (key === 'lastDailyReward' && obj[key] !== '24') {
  40. shouldSet = true;
  41. }
  42. });
  43.  
  44. if (shouldSet) {
  45. window.firebase.database().ref(refKey).update(rewardObj);
  46. window.showUserDetails('', window.firebase.auth().currentUser);
  47. }
  48. });
  49.  
  50. } catch { }
  51. }
  52.  
  53. function fakeSetDataNew(a) {
  54. window.unityInstance.SendMessage('FirebasePlayerPrefs2023', 'OnSetData', '{"err":null}&' + [...a].pop());
  55. }
  56.  
  57. Object.defineProperty(window, 'unityInstance', {
  58. get() {
  59. return this._unityInstance;
  60. },
  61. set(v) {
  62. const _setDataNew = window.setDataNew;
  63. window.setDataNew = function () {
  64. if (arguments[1] === 'banned') {
  65. fakeSetDataNew(arguments);
  66. return;
  67. }
  68.  
  69. if (arguments[1].includes("dailyReward_")) {
  70. fakeSetDataNew(arguments);
  71. window.showUserDetails('', window.firebase.auth().currentUser);
  72. return;
  73. }
  74.  
  75. if (arguments[1] === 'lastDailyReward') {
  76. arguments[2] = '24';
  77. }
  78.  
  79. return _setDataNew.apply(this, arguments);
  80. }
  81.  
  82. this._unityInstance = v;
  83.  
  84. const _SendMessage = this._unityInstance.SendMessage;
  85. this._unityInstance.SendMessage = function () {
  86. if (arguments[1] === 'OnLoggedInGoogle') fixDailyRewards();
  87. return _SendMessage.apply(this, arguments);
  88. }
  89. },
  90. });