DigDig.IO X-Ray

Let's you see more in digdig.io

当前为 2021-12-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DigDig.IO X-Ray
  3. // @namespace https://tampermonkey.net/
  4. // @version 0.0.92
  5. // @description Let's you see more in digdig.io
  6. // @author Zertalious (Zert)
  7. // @match *://digdig.io/*
  8. // @icon https://www.google.com/s2/favicons?domain=digdig.io
  9. // @require https://cdn.jsdelivr.net/gh/Qwokka/WAIL@9ed21abc43045e19f9b3756de109a6e361fb9292/wail.js
  10. // @antifeature ads
  11. // ==/UserScript==
  12.  
  13. // Only works when fow is done client side
  14. // Should or shouldn't work depending on the current live build
  15. // Created on build: 41e6c4662ebb8e04b62e5ac95c03eb1d8f5427d1
  16.  
  17. const _instantiateStreaming = WebAssembly.instantiateStreaming;
  18.  
  19. WebAssembly.instantiateStreaming = function () {
  20.  
  21. return _instantiateStreaming( new Response() );
  22.  
  23. }
  24.  
  25. const _instantiate = WebAssembly.instantiate;
  26.  
  27. WebAssembly.instantiate = function ( buffer, imports ) {
  28.  
  29. const array = new Uint8Array( buffer );
  30.  
  31. find( array, [
  32. OP_END,
  33. OP_I32_LOAD8_U, - 1, - 1,
  34. OP_I32_CONST, 1,
  35. OP_I32_SUB,
  36. OP_BR_TABLE
  37. ], function ( i, end ) {
  38.  
  39. console.log( 'here!!' );
  40.  
  41. i ++;
  42.  
  43. array[ i ++ ] = OP_BR;
  44. array[ i ++ ] = 1;
  45. array[ i ++ ] = OP_NOP;
  46.  
  47. i ++;
  48.  
  49. array[ i ] = OP_NOP;
  50.  
  51. } );
  52.  
  53. find( array, [
  54. OP_F32_CONST, ...Float32ToArray( 2 ),
  55. OP_SET_LOCAL, - 1
  56. ], function ( start, end ) {
  57.  
  58. array.set( Float32ToArray( - 1 ), start + 1 );
  59.  
  60. } );
  61.  
  62. // changes the shape of the fog to a rectangle
  63.  
  64. find( array, [
  65. OP_F64_CONST, ...Float64ToArray( 1.4142135623730951 )
  66. ], function ( start, end ) {
  67.  
  68. array.set( Float64ToArray( 1 ), start + 1 );
  69.  
  70. } );
  71.  
  72. return _instantiate( buffer, imports );
  73.  
  74. }
  75.  
  76. function find( array, search, callback ) {
  77.  
  78. main: for ( let i = 0; i < array.length; i ++ ) {
  79.  
  80. for ( let j = 0; j < search.length; j ++ ) {
  81.  
  82. if ( search[ j ] !== - 1 && array[ i + j ] !== search[ j ] ) {
  83.  
  84. continue main;
  85.  
  86. }
  87.  
  88. }
  89.  
  90. callback( i, i + search.length - 1 );
  91.  
  92. }
  93.  
  94. }
  95.  
  96. function Float32ToArray( x ) {
  97.  
  98. return new Uint8Array( new Float32Array( [ x ] ).buffer );
  99.  
  100. }
  101.  
  102. function Float64ToArray( x ) {
  103.  
  104. return new Uint8Array( new Float64Array( [ x ] ).buffer );
  105.  
  106. }
  107.  
  108. const shouldShowAd = window.localStorage.showAd !== false && new URLSearchParams( window.location.search ).get( 'showAd' ) !== 'false';
  109.  
  110. const el = document.createElement( 'div' );
  111.  
  112. el.innerHTML = `<style>
  113. .dialog {
  114. position: absolute;
  115. left: 50%;
  116. top: 50%;
  117. padding: 25px;
  118. background: #784400;
  119. border: 6px solid rgba(0, 0, 0, 0.2);
  120. color: #fff;
  121. transform: translate(-50%, -50%);
  122. text-align: center;
  123. z-index: 999999;
  124. font-family: Ubuntu;
  125. box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.5);
  126. text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000, 1px 1px #000, -1px -1px #000;
  127. }
  128. .dialog * {
  129. color: #fff;
  130. }
  131. .close {
  132. position: absolute;
  133. right: 5px;
  134. top: 5px;
  135. width: 20px;
  136. height: 20px;
  137. opacity: 0.5;
  138. cursor: pointer;
  139. }
  140. .close:before, .close:after {
  141. content: ' ';
  142. position: absolute;
  143. left: 50%;
  144. top: 50%;
  145. width: 100%;
  146. height: 20%;
  147. transform: translate(-50%, -50%) rotate(-45deg);
  148. background: #fff;
  149. }
  150. .close:after {
  151. transform: translate(-50%, -50%) rotate(45deg);
  152. }
  153. .close:hover {
  154. opacity: 1;
  155. }
  156. .btn {
  157. cursor: pointer;
  158. padding: 0.4em;
  159. background: #30a199;
  160. border: 5px solid rgba(0, 0, 0, 0.2);
  161. margin-bottom: 5px;
  162. border-radius: 6px;
  163. }
  164. .btn:active {
  165. transform: scale(0.8);
  166. }
  167. </style>
  168. <div class="dialog">${shouldShowAd ? `<big>Loading ad...</big>` : `<div class="close" onclick="this.parentNode.style.display='none';"></div>
  169. <big>DigDig.IO X-Ray</big>
  170. <br>
  171. <br>
  172. By Zertalious
  173. <br>
  174. <br>
  175. <div class="btn" onclick="window.open('https://discord.gg/K24Zxy88VM')">Discord</div>
  176. <div class="btn" style="background: #bfa417;" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>` }
  177. </div>`;
  178. while ( el.children.length > 0 ) {
  179. document.body.appendChild( el.children[ 0 ] );
  180. }
  181.  
  182. if ( shouldShowAd ) {
  183. const url = new URL( window.location.href );
  184. url.searchParams.set( 'showAd', 'false' );
  185. window.location.href = 'https://adf.ly/10891457/' + url.href;
  186. }