-
Notifications
You must be signed in to change notification settings - Fork 0
/
woah.js
48 lines (44 loc) · 1.03 KB
/
woah.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// this doesn't work anymore
function randomBlockType() {
const random = Math.floor(Math.random() * 3)
if (random == 0) {
return Scratch.BlockType.COMMAND
}
else if (random == 1) {
return Scratch.BlockType.REPORTER
}
else {
return Scratch.BlockType.BOOLEAN
}
}
(function(Scratch) {
'use strict';
const vm = Scratch.vm
class woah {
getInfo() {
return {
id: 'fm',
name: 'cool ass block',
blocks: [
{
opcode: 'woah',
blockType: randomBlockType(),
text: 'woah!'
},
{
opcode: 'refresh',
blockType: Scratch.BlockType.COMMAND,
text: 'new blocktype'
}
]
};
}
woah() {
return 0;
}
refresh() {
vm.extensionManager.removeExtension(woah);
vm.extensionManager.loadExtension("https://bludisanlemon.github.io/Useless-things/woah.js")
}
}
Scratch.extensions.register(new woah());})(Scratch);