From dc44c7455db1928ab00e34588148c18b258089eb Mon Sep 17 00:00:00 2001 From: mariocraft <154646419+mariocraft987@users.noreply.github.com> Date: Mon, 11 Mar 2024 09:49:27 -0700 Subject: [PATCH 1/4] Create randomlyBlocks.js --- .../extensions/randomly/randomlyBlocks.js | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 src/lib/libraries/extensions/randomly/randomlyBlocks.js diff --git a/src/lib/libraries/extensions/randomly/randomlyBlocks.js b/src/lib/libraries/extensions/randomly/randomlyBlocks.js new file mode 100644 index 00000000000..eede752fdff --- /dev/null +++ b/src/lib/libraries/extensions/randomly/randomlyBlocks.js @@ -0,0 +1,246 @@ +/* +@Under MIT LICENSE (C) +@Version 1.7 +@Created by Mariocraft987 +*/ + +(function (Scratch) { + "use strict"; + class RandomlyBlocks { + getInfo() { + return { + id: 'randomlyblockscool', + name: 'Randomly Blocks', + color1: '#07f290', + color2: '#1ee894', + blocks: [ + { + opcode: 'alertname', + blockType: Scratch.BlockType.COMMAND, + text: 'Alert [STR]', + disableMonitor: true, + arguments: { + STR: { + type: Scratch.ArgumentType.STRING, + defaultValue: "Hello world!" + }, + } + }, + { + opcode: 'changeTitle', + blockType: Scratch.BlockType.COMMAND, + text: 'Change website title to [STR]', + disableMonitor: true, + arguments: { + STR: { + type: Scratch.ArgumentType.STRING, + defaultValue: "Randomly blocks" + }, + } + }, + { + opcode: 'consoleAdd', + blockType: Scratch.BlockType.COMMAND, + text: 'Add [STR] to console log', + disableMonitor: true, + arguments: { + STR: { + type: Scratch.ArgumentType.STRING, + defaultValue: "Penguin" + }, + } + }, + { + opcode: 'consoleError', + blockType: Scratch.BlockType.COMMAND, + text: 'Add [STR] to console error', + disableMonitor: true, + arguments: { + STR: { + type: Scratch.ArgumentType.STRING, + defaultValue: "banana" + }, + } + }, + "---", + { + opcode: 'amExist', + blockType: Scratch.BlockType.BOOLEAN, + text: 'True?', + disableMonitor: true, + }, + { + opcode: 'notExist', + blockType: Scratch.BlockType.BOOLEAN, + text: 'Do Dinosaurs exist?', + disableMonitor: true, + }, + { + opcode: 'YesNoAlert', + blockType: Scratch.BlockType.BOOLEAN, + text: '"Ok" button pressed on alert [STR]?', + disableMonitor: true, + arguments: { + STR: { + type: Scratch.ArgumentType.STRING, + defaultValue: "Popup" + }, + } + }, + { + opcode: 'inputAlert', + blockType: Scratch.BlockType.REPORTER, + text: 'Input of [STR] with default of [default]', + disableMonitor: true, + arguments: { + STR: { + type: Scratch.ArgumentType.STRING, + defaultValue: "What's your username?" + }, + default: { + type: Scratch.ArgumentType.STRING, + defaultValue: "mariocraft987" + }, + } + }, + { + opcode: 'getDate', + blockType: Scratch.BlockType.REPORTER, + text: 'get Date', + disableMonitor: true, + }, + { + opcode: 'getMilisecs', + blockType: Scratch.BlockType.REPORTER, + text: 'get Miliseconds', + disableMonitor: true, + }, + { + opcode: 'getTime1970', + blockType: Scratch.BlockType.REPORTER, + text: 'get Miliseconds since 1970', + disableMonitor: true, + }, + { + opcode: 'currentHolliday', + blockType: Scratch.BlockType.REPORTER, + text: 'current holliday', + disableMonitor: true, + }, + + ], + }; + } + alertname(args) { + alert(args.STR) + } + // Old Block Test + YNalert(args) { + return("hello!") + } + + changeTitle(args) { + document.title = args.STR + } + + consoleAdd(args) { + console.log(args.STR) + } + + consoleError(args) { + window.console.error(args.STR) + } + + amExist(args) { + return "Imposter Reporter as a Boolean!!" + } + + notExist(args) { + return false + } + + getDate(args) { + let date = Date() + return date + } + + getMilisecs(args) { + let date = new Date() + return date.getMilliseconds(); + } + + getTime1970(args) { + let date = new Date() + return date.getTime(); + } + + YesNoAlert(args) { + let jtext = args.STR + var pressLog + if (confirm(jtext) == true) { + pressLog = true + } else { + pressLog = false + } + return pressLog + } + + inputAlert(args) { + let question = args.STR + let normal = args.default + let answer = prompt(question, normal); + if (answer != null) { + return answer + } + } + + currentHolliday(args) { + let date = new Date(); + let month = date.getMonth() + let day = date.getDate() + if (month == 0) { + if (day == 1) {return "new year"} + if (day == 15) {return "martin luther king"} + }else + if (month == 1) { + if (day == 2) {return "groundhogs day"} + if (day == 19) {return "presidents day"} + }else + if (month == 2) { + if (day == 31) {return "easter"} + }else + if (month == 3) { + if (day == 15) {return "tax day"} + }else + if (month == 4) { + if (day == 12) {return "mothers day"} + }else + if (month == 5) { + if (day == 16) {return "fathers day"} + }else + if (month == 6) { + if (day == 4) {return "independence day"} + if (day == 28) {return "parents day"} + }else + if (month == 7) { + /* Nothing much */ + }else + if (month == 8) { + if (day == 2) {return "labor day"} + }else + if (month == 9) { + if (day == 31) {return "halloween"} + }else + if (month == 10) { + if (day == 28) {return "thanksgiving"} + }else + if (month == 11) { + if (day == 25) {return "christmas"} + if (day == 31) {return "new years eve"} + } + return "No Importent Hollidays Today!" + } + } + + Scratch.extensions.register(new RandomlyBlocks()) +})(Scratch); From 46c8adf1523d7b1d0d0ef65a72bc745e77ed55b3 Mon Sep 17 00:00:00 2001 From: mariocraft <154646419+mariocraft987@users.noreply.github.com> Date: Mon, 11 Mar 2024 09:51:22 -0700 Subject: [PATCH 2/4] Update and rename randomlyBlocks.js to randomlyBlocks.svg --- .../extensions/randomly/randomlyBlocks.js | 246 ------------------ .../extensions/randomly/randomlyBlocks.svg | 2 + 2 files changed, 2 insertions(+), 246 deletions(-) delete mode 100644 src/lib/libraries/extensions/randomly/randomlyBlocks.js create mode 100644 src/lib/libraries/extensions/randomly/randomlyBlocks.svg diff --git a/src/lib/libraries/extensions/randomly/randomlyBlocks.js b/src/lib/libraries/extensions/randomly/randomlyBlocks.js deleted file mode 100644 index eede752fdff..00000000000 --- a/src/lib/libraries/extensions/randomly/randomlyBlocks.js +++ /dev/null @@ -1,246 +0,0 @@ -/* -@Under MIT LICENSE (C) -@Version 1.7 -@Created by Mariocraft987 -*/ - -(function (Scratch) { - "use strict"; - class RandomlyBlocks { - getInfo() { - return { - id: 'randomlyblockscool', - name: 'Randomly Blocks', - color1: '#07f290', - color2: '#1ee894', - blocks: [ - { - opcode: 'alertname', - blockType: Scratch.BlockType.COMMAND, - text: 'Alert [STR]', - disableMonitor: true, - arguments: { - STR: { - type: Scratch.ArgumentType.STRING, - defaultValue: "Hello world!" - }, - } - }, - { - opcode: 'changeTitle', - blockType: Scratch.BlockType.COMMAND, - text: 'Change website title to [STR]', - disableMonitor: true, - arguments: { - STR: { - type: Scratch.ArgumentType.STRING, - defaultValue: "Randomly blocks" - }, - } - }, - { - opcode: 'consoleAdd', - blockType: Scratch.BlockType.COMMAND, - text: 'Add [STR] to console log', - disableMonitor: true, - arguments: { - STR: { - type: Scratch.ArgumentType.STRING, - defaultValue: "Penguin" - }, - } - }, - { - opcode: 'consoleError', - blockType: Scratch.BlockType.COMMAND, - text: 'Add [STR] to console error', - disableMonitor: true, - arguments: { - STR: { - type: Scratch.ArgumentType.STRING, - defaultValue: "banana" - }, - } - }, - "---", - { - opcode: 'amExist', - blockType: Scratch.BlockType.BOOLEAN, - text: 'True?', - disableMonitor: true, - }, - { - opcode: 'notExist', - blockType: Scratch.BlockType.BOOLEAN, - text: 'Do Dinosaurs exist?', - disableMonitor: true, - }, - { - opcode: 'YesNoAlert', - blockType: Scratch.BlockType.BOOLEAN, - text: '"Ok" button pressed on alert [STR]?', - disableMonitor: true, - arguments: { - STR: { - type: Scratch.ArgumentType.STRING, - defaultValue: "Popup" - }, - } - }, - { - opcode: 'inputAlert', - blockType: Scratch.BlockType.REPORTER, - text: 'Input of [STR] with default of [default]', - disableMonitor: true, - arguments: { - STR: { - type: Scratch.ArgumentType.STRING, - defaultValue: "What's your username?" - }, - default: { - type: Scratch.ArgumentType.STRING, - defaultValue: "mariocraft987" - }, - } - }, - { - opcode: 'getDate', - blockType: Scratch.BlockType.REPORTER, - text: 'get Date', - disableMonitor: true, - }, - { - opcode: 'getMilisecs', - blockType: Scratch.BlockType.REPORTER, - text: 'get Miliseconds', - disableMonitor: true, - }, - { - opcode: 'getTime1970', - blockType: Scratch.BlockType.REPORTER, - text: 'get Miliseconds since 1970', - disableMonitor: true, - }, - { - opcode: 'currentHolliday', - blockType: Scratch.BlockType.REPORTER, - text: 'current holliday', - disableMonitor: true, - }, - - ], - }; - } - alertname(args) { - alert(args.STR) - } - // Old Block Test - YNalert(args) { - return("hello!") - } - - changeTitle(args) { - document.title = args.STR - } - - consoleAdd(args) { - console.log(args.STR) - } - - consoleError(args) { - window.console.error(args.STR) - } - - amExist(args) { - return "Imposter Reporter as a Boolean!!" - } - - notExist(args) { - return false - } - - getDate(args) { - let date = Date() - return date - } - - getMilisecs(args) { - let date = new Date() - return date.getMilliseconds(); - } - - getTime1970(args) { - let date = new Date() - return date.getTime(); - } - - YesNoAlert(args) { - let jtext = args.STR - var pressLog - if (confirm(jtext) == true) { - pressLog = true - } else { - pressLog = false - } - return pressLog - } - - inputAlert(args) { - let question = args.STR - let normal = args.default - let answer = prompt(question, normal); - if (answer != null) { - return answer - } - } - - currentHolliday(args) { - let date = new Date(); - let month = date.getMonth() - let day = date.getDate() - if (month == 0) { - if (day == 1) {return "new year"} - if (day == 15) {return "martin luther king"} - }else - if (month == 1) { - if (day == 2) {return "groundhogs day"} - if (day == 19) {return "presidents day"} - }else - if (month == 2) { - if (day == 31) {return "easter"} - }else - if (month == 3) { - if (day == 15) {return "tax day"} - }else - if (month == 4) { - if (day == 12) {return "mothers day"} - }else - if (month == 5) { - if (day == 16) {return "fathers day"} - }else - if (month == 6) { - if (day == 4) {return "independence day"} - if (day == 28) {return "parents day"} - }else - if (month == 7) { - /* Nothing much */ - }else - if (month == 8) { - if (day == 2) {return "labor day"} - }else - if (month == 9) { - if (day == 31) {return "halloween"} - }else - if (month == 10) { - if (day == 28) {return "thanksgiving"} - }else - if (month == 11) { - if (day == 25) {return "christmas"} - if (day == 31) {return "new years eve"} - } - return "No Importent Hollidays Today!" - } - } - - Scratch.extensions.register(new RandomlyBlocks()) -})(Scratch); diff --git a/src/lib/libraries/extensions/randomly/randomlyBlocks.svg b/src/lib/libraries/extensions/randomly/randomlyBlocks.svg new file mode 100644 index 00000000000..8f0fba8f801 --- /dev/null +++ b/src/lib/libraries/extensions/randomly/randomlyBlocks.svg @@ -0,0 +1,2 @@ + +AlertHello World!AddPenguintoconsolelogGetmillisecondssince1970 From 7b2fe2faf371aef4c3cef0ab86c742e539c291bf Mon Sep 17 00:00:00 2001 From: mariocraft <154646419+mariocraft987@users.noreply.github.com> Date: Mon, 11 Mar 2024 09:57:01 -0700 Subject: [PATCH 3/4] wandomy bwoks --- src/lib/libraries/extensions/index.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/libraries/extensions/index.jsx b/src/lib/libraries/extensions/index.jsx index 4eb0cd9e2d2..7048fa55042 100644 --- a/src/lib/libraries/extensions/index.jsx +++ b/src/lib/libraries/extensions/index.jsx @@ -84,6 +84,8 @@ import jwProtoExtensionIcon from './penguinmod/extensions/proto.png'; import jwStructsExtensionIcon from './penguinmod/extensions/ooplogo.png'; +import randomlyBlocksIcon from '.randomly/randomlyBlocks.svg'; + // cl waw // import cloudlinkThumb from './penguinmod/extensions/cloudlinkThumb.png'; import cloudlinkIcon from './penguinmod/extensions/cloudlinkIcon.svg'; @@ -447,6 +449,15 @@ const menuItems = [ description: 'Interact with your Roku tv via the GM2Helper software!', featured: true }, + { + name: 'Randomly Blocks', + extensionId: 'https://raw.githubusercontent.com/mariocraft987/RandomlyBlocks/main/version-1.7', + collaborator: 'mariocraft987', + iconURL: randomlyBlocksIcon, + tags: ['other_mods'], + description: 'Utilitys to have your project feel like a website', + featured: true + }, // { // name: 'NES Emulator', // extensionId: 'nesemulator', From 74ec4f51e30a5ce3da10b1c010b18cf72aacb6ac Mon Sep 17 00:00:00 2001 From: mariocraft <154646419+mariocraft987@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:26:14 -0700 Subject: [PATCH 4/4] added "/" --- src/lib/libraries/extensions/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/libraries/extensions/index.jsx b/src/lib/libraries/extensions/index.jsx index 7048fa55042..b4225d73129 100644 --- a/src/lib/libraries/extensions/index.jsx +++ b/src/lib/libraries/extensions/index.jsx @@ -84,7 +84,7 @@ import jwProtoExtensionIcon from './penguinmod/extensions/proto.png'; import jwStructsExtensionIcon from './penguinmod/extensions/ooplogo.png'; -import randomlyBlocksIcon from '.randomly/randomlyBlocks.svg'; +import randomlyBlocksIcon from './randomly/randomlyBlocks.svg'; // cl waw // import cloudlinkThumb from './penguinmod/extensions/cloudlinkThumb.png';