DigDig.IO X-Ray

Let's you see more in digdig.io

目前为 2022-01-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DigDig.IO X-Ray
  3. // @namespace https://tampermonkey.net/
  4. // @version 0.0.97
  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 = new URLSearchParams( window.location.search ).get( 'showAd' ) !== 'false';
  109.  
  110. const el = document.createElement( 'div' );
  111.  
  112. el.innerHTML = `<style>
  113.  
  114. .dialog {
  115. position: absolute;
  116. left: 50%;
  117. top: 50%;
  118. padding: 25px;
  119. background: #784400;
  120. border: 6px solid rgba(0, 0, 0, 0.2);
  121. color: #fff;
  122. transform: translate(-50%, -50%);
  123. text-align: center;
  124. z-index: 999999;
  125. font-family: Ubuntu;
  126. box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.5);
  127. text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000, 1px 1px #000, -1px -1px #000;
  128. }
  129.  
  130. .dialog * {
  131. color: #fff;
  132. }
  133.  
  134. .close {
  135. position: absolute;
  136. right: 5px;
  137. top: 5px;
  138. width: 20px;
  139. height: 20px;
  140. opacity: 0.5;
  141. cursor: pointer;
  142. }
  143.  
  144. .close:before, .close:after {
  145. content: ' ';
  146. position: absolute;
  147. left: 50%;
  148. top: 50%;
  149. width: 100%;
  150. height: 20%;
  151. transform: translate(-50%, -50%) rotate(-45deg);
  152. background: #fff;
  153. }
  154.  
  155. .close:after {
  156. transform: translate(-50%, -50%) rotate(45deg);
  157. }
  158.  
  159. .close:hover {
  160. opacity: 1;
  161. }
  162.  
  163. .btn {
  164. cursor: pointer;
  165. padding: 0.4em;
  166. background: #30a199;
  167. border: 5px solid rgba(0, 0, 0, 0.2);
  168. margin-bottom: 5px;
  169. border-radius: 6px;
  170. }
  171.  
  172. .btn:active {
  173. transform: scale(0.8);
  174. }
  175.  
  176. </style>
  177. <div class="dialog">${shouldShowAd ? `<big>Loading ad...</big>` : `<div class="close" onclick="this.parentNode.style.display='none';"></div>
  178. <big>DigDig.IO X-Ray</big>
  179. <br>
  180. <br>
  181. By Zertalious
  182. <br>
  183. <br>
  184. <div class="btn" onclick="window.open('https://discord.gg/K24Zxy88VM')">Discord</div>
  185. <div class="btn" style="background: #c73420;" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>
  186. <div class="btn" style="background: #32a430;" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>
  187. <div class="btn" style="background: #bfa417;" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>
  188. </div>
  189. ` }
  190. </div>`;
  191.  
  192. while ( el.children.length > 0 ) {
  193.  
  194. document.body.appendChild( el.children[ 0 ] );
  195.  
  196. }
  197.  
  198. if ( shouldShowAd ) {
  199.  
  200. const url = new URL( window.location.href );
  201.  
  202. url.searchParams.set( 'showAd', 'false' );
  203.  
  204. window.location.href = 'https://zertalious.xyz?redirect_to=random&ref=' + new TextEncoder().encode( url.href ).toString();
  205.  
  206. }