Kirka.IO Enhanced

Wallhack, adblock and more for Kirka.IO.

当前为 2022-11-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Kirka.IO Enhanced
  3. // @namespace -
  4. // @version 1.0.0
  5. // @description Wallhack, adblock and more for Kirka.IO.
  6. // @author NotYou
  7. // @match *://kirka.io/*
  8. // @run-at document-end
  9. // @license GPL-3.0-or-later
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. let wallhackEnabled = false
  15.  
  16. // Styling
  17.  
  18. let css = `
  19. .notification {
  20. position: absolute;
  21. background: var(--secondary-5);
  22. border: 4px solid rgb(62, 77, 124);
  23. border-bottom: solid 4px var(--secondary-6);
  24. border-top: 4px solid rgb(77, 92, 139);
  25. width: 250px;
  26. height: 100px;
  27. right: 15px;
  28. bottom: 15px;
  29. z-index: 100;
  30. color: rgb(255, 255, 255);
  31. transition: .3s;
  32. opacity: 0.85;
  33. pointer-events: none;
  34. }
  35.  
  36. .notification-title {
  37. font-size: x-large;
  38. text-align: center;
  39. margin: 2px;
  40. }
  41.  
  42. .notification-body {
  43. margin: 3px;
  44. font-size: medium;
  45. }
  46.  
  47. .highlight-disabled::after {
  48. content: 'disabled';
  49. color: rgb(210, 50, 50);
  50. }
  51.  
  52. .highlight-enabled::after {
  53. content: 'enabled';
  54. color: rgb(50, 210, 50);
  55. }`
  56.  
  57. // Ad Block
  58.  
  59. let adBlockCss = '.ad-left, .ad-bottom, #ad-left, #ad-bottom { display: none !important }'
  60.  
  61. window.show_rewarded = _
  62. window.show_preroll = _
  63.  
  64. // No Logs
  65.  
  66. console.log2 = console.log
  67. console.log = _
  68. console.info = _
  69. console.warn = _
  70. console.error = _
  71.  
  72.  
  73. window.addEventListener('keydown', e => {
  74. let chat = document.querySelector('.chat')
  75.  
  76. // Hide chat
  77.  
  78. if(chat && e.code === 'KeyV') {
  79. chat.style.transition = '.3s opacity'
  80. toggleVisibility(chat)
  81. }
  82.  
  83. // Wallhack
  84.  
  85. if(e.code === 'KeyF') {
  86. wallhackEnabled = !wallhackEnabled
  87.  
  88. notify('Wallhack', 'Wallhack is ', wallhackEnabled)
  89. }
  90. })
  91.  
  92. function getWeapon(query) {
  93. return Array.from(document.querySelectorAll('.gun-name')).find(e => e.textContent.toLowerCase() === query.toLowerCase())
  94. }
  95.  
  96. // Wallhack (Actual)
  97.  
  98. (function() {
  99. Object.defineProperty(Object.prototype, 'material', {
  100. set(value) {
  101. this._material = value
  102.  
  103. if (this._material && this._material.name && this._material.name.indexOf('player') !== -1 && wallhackEnabled) {
  104. value.alphaTest = 0.99
  105. value.fog = false
  106. value.depthTest = false
  107. }
  108. },
  109.  
  110. get() {
  111. return this._material
  112. }
  113. })
  114. })()
  115.  
  116. let styleNode = document.createElement('style')
  117. styleNode.appendChild(document.createTextNode(css + adBlockCss))
  118. document.querySelector('head').appendChild(styleNode)
  119.  
  120. function notify(title, body, highlight) {
  121. let notifClass = 'notification'
  122. let notif = document.createElement('div')
  123. let notifTitle = document.createElement('h3')
  124. let notifBody = document.createElement('p')
  125.  
  126. notifTitle.className = notifClass + '-title'
  127. notifBody.className = notifClass + '-body'
  128. notif.className = notifClass
  129.  
  130. notifTitle.textContent = title ?? 'Kirka.IO Enchanced'
  131. notifBody.innerHTML = (body ?? '') + (`<span class="highlight-${highlight === true ? 'enabled' : highlight === false ? 'disabled' : ''}"></span>`)
  132.  
  133. notif.style.right = '100vw'
  134.  
  135. notif.appendChild(notifTitle)
  136. notif.appendChild(notifBody)
  137. document.body.appendChild(notif)
  138.  
  139. setTimeout(() => {
  140. notif.style.right = ''
  141. }, 300)
  142.  
  143. setTimeout(() => {
  144. notif.style.right = '100vw'
  145.  
  146. setTimeout(() => {
  147. notif.remove()
  148. }, 300)
  149. }, 1600)
  150. }
  151.  
  152. function toggleVisibility(el) {
  153. if(el.style.opacity === '0') {
  154. el.style.opacity = '1'
  155. el.style.pointerEvents = 'none'
  156. } else {
  157. el.style.opacity = '0'
  158. el.style.pointerEvents = 'auto'
  159. }
  160. }
  161.  
  162. function _() {}
  163. })()