DigDig.IO X-Ray

Let's you see more in digdig.io

目前為 2021-12-15 提交的版本,檢視 最新版本

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