Sploop Console

As you already know, in sploop.io the console is no longer working, or rather, the output to the console. Perhaps you would like to continue using it? If yes, then use this script.

目前为 2022-05-07 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/444624/1048062/Sploop%20Console.js

  1. // ==UserScript==
  2. // @name Sploop Console
  3. // @namespace Nudo
  4. // @version 1
  5. // @description As you already know, in sploop.io the console is no longer working, or rather, the output to the console. Perhaps you would like to continue using it? If yes, then use this script.
  6. // @author Nudo#3310
  7. // @match *://sploop.io/*
  8. // @require http://code.jquery.com/jquery-3.3.1.min.js
  9. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  10. // @license MIT
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. let consoleCode = `
  15. <div class="console-holder">
  16. <div class="console-wrapper">
  17. <div class="console-title">
  18. <ul class="console-navbar">
  19. <li id="output" style="border-bottom: 2px solid #6e6e6e;"><span>Output</span></li>
  20. <li id="input"><span>Input</span></li>
  21. </ul>
  22. </div>
  23. <div class="console-output" style="display: block;">
  24. <div class="console-output-toolbar">
  25. </div>
  26. <div class="console-panel-output"></div>
  27. </div>
  28. <div class="console-input" style="display: none;">
  29. <div class="coming-soon">
  30. Coming soon
  31. </div>
  32. <div class="console-panel-input">
  33. </div>
  34. <div class="console-user-input">
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <style>
  40. .coming-soon {
  41. width: 100%;
  42. height: 100%;
  43. display: flex;
  44. align-items: center;
  45. justify-content: center;
  46. cursor: default;
  47. font-family: Consolas, Lucida Console, monospace;
  48. color: #6e6e6e;
  49. font-size: 23px;
  50. }
  51. .console-panel-input {
  52. padding: 10px;
  53. cursor: default;
  54. height: calc(100% - 30px);
  55. display: flex;
  56. flex-direction: column;
  57. overflow-x: hidden;
  58. overflow-y: scroll;
  59. }
  60. .console-panel-output {
  61. padding: 10px;
  62. cursor: default;
  63. height: calc(100% - 50px);
  64. display: flex;
  65. flex-direction: column;
  66. overflow-x: hidden;
  67. overflow-y: scroll;
  68. }
  69. .console-output-toolbar {
  70. cursor: default;
  71. height: 20px;
  72. background: #eee;
  73. border-bottom: 1px solid #dedede;
  74. }
  75. .console-output, .console-input {
  76. cursor: default;
  77. width: 100%;
  78. height: 100%;
  79. }
  80. .console-title ul, .console-title li {
  81. cursor: default;
  82. margin: 0;
  83. padding: 0;
  84. list-style: none;
  85. text-decoration: none;
  86. }
  87. .console-navbar li span {
  88. cursor: default;
  89. font-family: Consolas, Lucida Console, monospace;
  90. color: #6e6e6e;
  91. font-size: 15px;
  92. }
  93. .console-navbar li:hover {
  94. background: #dedede;
  95. }
  96. .console-navbar li {
  97. box-sizing: border-box;
  98. cursor: default;
  99. height: 100%;
  100. padding: 5px;
  101. }
  102. .console-navbar {
  103. box-sizing: border-box;
  104. cursor: default;
  105. padding-left: 5px;
  106. display: flex;
  107. align-items: center;
  108. }
  109. .console-title {
  110. cursor: default;
  111. width: 100%;
  112. height: 30px;
  113. background: #eee;
  114. border-bottom: 1px solid #dedede;
  115. }
  116. .console-wrapper {
  117. cursor: default;
  118. width: 600px;
  119. height: 100%;
  120. background: #ffffff;
  121. pointer-events: all;
  122. box-sizing: border-box;
  123. }
  124. .console-holder {
  125. cursor: default;
  126. font-family: Consolas, Lucida Console, monospace;
  127. display: none;
  128. position: absolute;
  129. top: 0;
  130. pointer-events: none;
  131. width: 100%;
  132. height: 100%;
  133. z-index: 9999999;
  134. }
  135. .output-box {
  136. cursor: default;
  137. font-family: Consolas, Lucida Console, monospace;
  138. display: flex;
  139. margin: 5px;
  140. border-left: 2px solid #6e6e6e;
  141. padding-left: 5px;
  142. }
  143. .output-content {
  144. cursor: default;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: center;
  148. }
  149. .content-title {
  150. color: black;
  151. font-size: 16px;
  152. cursor: default;
  153. }
  154. .content-desc {
  155. color: #6e6e6e;
  156. font-size: 14px;
  157. cursor: default;
  158. }
  159. .output-content div {
  160. font-family: Consolas, Lucida Console, monospace;
  161. margin: 3px;
  162. cursor: default;
  163. }
  164. </style>
  165. `
  166.  
  167. function addConsoleMenu() {
  168. $("body").append(consoleCode)
  169. }
  170.  
  171. addConsoleMenu()
  172.  
  173. let consoleHolder = document.querySelector(".console-holder")
  174.  
  175. function openConsole() {
  176. if (consoleHolder.style.display === "none") {
  177. consoleHolder.style.display = "block"
  178. return null
  179. }
  180. consoleHolder.style.display = "none"
  181. }
  182.  
  183. window.openConsole = openConsole
  184.  
  185. document.addEventListener("keydown", (event) => {
  186. if (event.code === "F9") {
  187. openConsole()
  188. }
  189. })
  190.  
  191. let Console = new class {
  192. constructor() {
  193. this.output = document.querySelector(".console-output")
  194. this.input = document.querySelector(".console-input")
  195. this.btnOutput = document.getElementById("output")
  196. this.btnInput = document.getElementById("input")
  197. this.panelOutput = document.querySelector(".console-panel-output")
  198. this.panelOInput = document.querySelector(".console-panel-input")
  199. }
  200. closePanel(type) {
  201. document.querySelector(`.console-${type}`).style.display = "none"
  202. }
  203. openPanel(type) {
  204. document.querySelector(`.console-${type}`).style.display = "block"
  205. }
  206. nav() {
  207. this.btnOutput.addEventListener("click", () => {
  208. this.btnOutput.style.borderBottom = "2px solid #6e6e6e"
  209. this.btnInput.style.borderBottom = "none"
  210. this.openPanel("output")
  211. this.closePanel("input")
  212. })
  213. this.btnInput.addEventListener("click", () => {
  214. this.btnOutput.style.borderBottom = "none"
  215. this.btnInput.style.borderBottom = "2px solid #6e6e6e"
  216. this.openPanel("input")
  217. this.closePanel("output")
  218. })
  219. }
  220. addToConsole(title, desc, color) {
  221. let getAllDesc = () => {
  222. let allDesc = ""
  223. if (Array.isArray(desc)) {
  224. for (let i = 0; i < desc.length; i++) {
  225. allDesc += `<div class="content-desc" style="color: ${color || ""};"> > ${desc[i] || ""}</div>`
  226. }
  227. return allDesc
  228. }
  229. if (desc instanceof Object) {
  230. for (let i in desc) {
  231. allDesc += `<div class="content-desc" style="color: ${color || ""};"> > ${i + ": " + desc[i] || ""}</div>`
  232. }
  233. return allDesc
  234. }
  235. return `<div class="content-desc" style="color: ${color || ""};"> > ${desc || ""}</div>`
  236. }
  237. this.panelOutput.innerHTML += `
  238. <div class="output-box">
  239. <div class="output-content">
  240. ${ title ? `<div class="content-title">${title || ""}</div>` : ""}
  241. ${ desc ? getAllDesc() : ""}
  242. </div>
  243. </div>
  244. `
  245. }
  246. convertConsole() {
  247. console.log = function(e) {
  248. Console.addToConsole(...arguments)
  249. }
  250. console.error = function(e) {
  251. Console.addToConsole(arguments[0], arguments[1], "red")
  252. }
  253.  
  254. }
  255. }
  256. Console.nav()
  257. Console.convertConsole()
  258.  
  259. let AutoHeal = {
  260. speed: 10,
  261. multi: 2,
  262. hat: 7,
  263. chat: "AutoHeal 100%"
  264. }
  265.  
  266. // Adding text to the console
  267. console.log("Console by Nudo#3310", "Hello, console user! Enjoy coding!")
  268. //console.log("AutoHeal", ["Speed: 100", "Enemy not defined"])
  269. //console.log("AutoHeal Params", AutoHeal)
  270. //console.error("Console by Nudo#3310", "Hello, console user! Enjoy coding!")

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址