scratch extesion: timer by rssaromeo

none

目前为 2025-03-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name scratch extesion: timer by rssaromeo
  3. // @version 3
  4. // @description none
  5. // @run-at document-start
  6. // @author rssaromeo
  7. // @license GPLv3
  8. // @tag lib
  9. // @match *://*/*
  10. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAA9QTFRFAAAAA6ruC6rmAWGH////xP85DwAAAAV0Uk5TAP////8c0CZSAAABtUlEQVR4nL2V0XGEMAxErVSAO8jQf01MKohJAyFY0kprMDf3FX/cYPuxK3OyJCWGLPF47LkaT7XQkO8bQO8PGjLfTwKAGXx8lvL7ZSttACq2+3CkEaAG2AdhJhICK0ewhYRAIN8PDZUQF7D9GtJKNAe6wMpHbW7SUUkB+hQgmgIuMHyqZianhAFdAP4RxwbAHFSgyXLs9mQS7QTcoepqB3QlJMQd+mIPadHIbeKAOVQ/lAI+Uw8xB38HgyTEHOqQZpAYgVY1Pv05T+Meh2gIOmdA39AgOqAhnGsM6Er3MKBG/iweinkYoCHEOmKtHsR7gBmOgK69CfghZsAZpQPHj+141vSp/DvAfyU+BAOcDNNTvAT4Q12A+3/BIUz/rGfAE4YdAuCM8s1bRkVOBlALAfBI+czq8vJeaNoPVxMf3acA/HLf7qbdLCoP19ttlxcValIfusMeBQR1hZ68PrDEUKNQgiZV0ATUgcrgtU5mlYtKPFRadwBwq9Woo1Grx25QohJHtb8SqOXZL8aGEd2AOg5rZMPhnpXElrGi6+GEK7Yf+iYNJFi05jrff+rdmX/Z/VmDLuIfxL1QJnNOkwEAAAAASUVORK5CYII=
  11. // @grant none
  12. // @namespace https://greasyfork.org/users/1184528
  13. // ==/UserScript==
  14. ;(async () => {
  15. await loadlib("libloader").waitforlib("scratchextesnsionmanager")
  16. const {
  17. newext,
  18. newmenu,
  19. newblock,
  20. bt,
  21. inp,
  22. gettarget,
  23. totype,
  24. scratch_math,
  25. projectid,
  26. canvas,
  27. scratchvar,
  28. scratchlist,
  29. } = loadlib("scratchextesnsionmanager")
  30. var vm
  31. loadlib("libloader")
  32. .waitforlib("scratch")
  33. .then(() => (vm = loadlib("scratch").vm))
  34.  
  35. newext(
  36. "timer",
  37. "rssaromeo",
  38. class {
  39. pausetimer() {
  40. vm.runtime.ioDevices.clock.pause()
  41. }
  42. resumetimer() {
  43. vm.runtime.ioDevices.clock.resume()
  44. }
  45. },
  46. [
  47. newblock(bt.cmd, "pausetimer", "pause timer"),
  48. newblock(bt.cmd, "resumetimer", "resume timer"),
  49. ],
  50. "03aaee",
  51. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAA9QTFRFAAAAA6ruC6rmAWGH////xP85DwAAAAV0Uk5TAP////8c0CZSAAABtUlEQVR4nL2V0XGEMAxErVSAO8jQf01MKohJAyFY0kprMDf3FX/cYPuxK3OyJCWGLPF47LkaT7XQkO8bQO8PGjLfTwKAGXx8lvL7ZSttACq2+3CkEaAG2AdhJhICK0ewhYRAIN8PDZUQF7D9GtJKNAe6wMpHbW7SUUkB+hQgmgIuMHyqZianhAFdAP4RxwbAHFSgyXLs9mQS7QTcoepqB3QlJMQd+mIPadHIbeKAOVQ/lAI+Uw8xB38HgyTEHOqQZpAYgVY1Pv05T+Meh2gIOmdA39AgOqAhnGsM6Er3MKBG/iweinkYoCHEOmKtHsR7gBmOgK69CfghZsAZpQPHj+141vSp/DvAfyU+BAOcDNNTvAT4Q12A+3/BIUz/rGfAE4YdAuCM8s1bRkVOBlALAfBI+czq8vJeaNoPVxMf3acA/HLf7qbdLCoP19ttlxcValIfusMeBQR1hZ68PrDEUKNQgiZV0ATUgcrgtU5mlYtKPFRadwBwq9Woo1Grx25QohJHtb8SqOXZL8aGEd2AOg5rZMPhnpXElrGi6+GEK7Yf+iYNJFi05jrff+rdmX/Z/VmDLuIfxL1QJnNOkwEAAAAASUVORK5CYII="
  52. )
  53. })()