From 3c12db977748a28b658fc0d3048a5e5ee4c8196e Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 18:44:59 -0700 Subject: [PATCH 01/17] Add switches between change xy + goto xy -> set x, set y, change x, change y --- .../addons/block-switching/userscript.js | 122 +++++++++++++++++- 1 file changed, 121 insertions(+), 1 deletion(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index af244717b1b..3a6316341da 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -37,7 +37,27 @@ export default async function ({ addon, console, msg }) { { opcode: "motion_changebyxy", remapInputName: { X: "DX", Y: "DY" }, - } + }, + { + opcode: "motion_setx", + remapInputName: { X: "X" }, + splitInputs: [ "Y" ] + }, + { + opcode: "motion_changexby", + remapInputName: { X: "DX" }, + splitInputs: [ "Y" ] + }, + { + opcode: "motion_sety", + remapInputName: { Y: "Y" }, + splitInputs: [ "DX" ] + }, + { + opcode: "motion_changeyby", + remapInputName: { Y: "DY" }, + splitInputs: [ "DX" ] + }, ]; blockSwitches["motion_changebyxy"] = [ { @@ -45,8 +65,48 @@ export default async function ({ addon, console, msg }) { remapInputName: { DX: "X", DY: "Y" }, }, noopSwitch, + { + opcode: "motion_setx", + remapInputName: { DX: "X" }, + splitInputs: [ "DY" ] + }, + { + opcode: "motion_changexby", + remapInputName: { DX: "DX" }, + splitInputs: [ "DY" ] + }, + { + opcode: "motion_sety", + remapInputName: { DY: "Y" }, + splitInputs: [ "DX" ] + }, + { + opcode: "motion_changeyby", + remapInputName: { DY: "DY" }, + splitInputs: [ "DX" ] + }, ]; blockSwitches["motion_setx"] = [ + { + opcode: "motion_gotoxy", + remapInputName: { X: "X" }, + createInputs: { + Y: { + shadowType: "math_number", + value: "0", + } + } + }, + { + opcode: "motion_changebyxy", + remapInputName: { X: "DX" }, + createInputs: { + DY: { + shadowType: "math_number", + value: "0", + } + } + }, noopSwitch, { opcode: "motion_changexby", @@ -62,6 +122,26 @@ export default async function ({ addon, console, msg }) { }, ]; blockSwitches["motion_changexby"] = [ + { + opcode: "motion_gotoxy", + remapInputName: { DX: "X" }, + createInputs: { + Y: { + shadowType: "math_number", + value: "0", + } + } + }, + { + opcode: "motion_changebyxy", + remapInputName: { DX: "DX" }, + createInputs: { + DY: { + shadowType: "math_number", + value: "0", + } + } + }, { opcode: "motion_setx", remapInputName: { DX: "X" }, @@ -77,6 +157,26 @@ export default async function ({ addon, console, msg }) { }, ]; blockSwitches["motion_sety"] = [ + { + opcode: "motion_gotoxy", + remapInputName: { Y: "Y" }, + createInputs: { + X: { + shadowType: "math_number", + value: "0", + } + } + }, + { + opcode: "motion_changebyxy", + remapInputName: { Y: "DY" }, + createInputs: { + DX: { + shadowType: "math_number", + value: "0", + } + } + }, { opcode: "motion_setx", remapInputName: { Y: "X" }, @@ -92,6 +192,26 @@ export default async function ({ addon, console, msg }) { }, ]; blockSwitches["motion_changeyby"] = [ + { + opcode: "motion_gotoxy", + remapInputName: { DY: "Y" }, + createInputs: { + X: { + shadowType: "math_number", + value: "0", + } + } + }, + { + opcode: "motion_changebyxy", + remapInputName: { DY: "DY" }, + createInputs: { + DX: { + shadowType: "math_number", + value: "0", + } + } + }, { opcode: "motion_setx", remapInputName: { DY: "X" }, From b892d887b5ee4648d014ab5de7c4e5e89e78b26c Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 18:52:55 -0700 Subject: [PATCH 02/17] Add point in direction onto turn switch set --- .../addons/block-switching/userscript.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 3a6316341da..358a5fa0b34 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -25,12 +25,31 @@ export default async function ({ addon, console, msg }) { { opcode: "motion_turnleft", }, + { + opcode: "motion_pointindirection", + remapInputName: { DEGREES: "DIRECTION" } + } ]; blockSwitches["motion_turnleft"] = [ { opcode: "motion_turnright", }, noopSwitch, + { + opcode: "motion_pointindirection", + remapInputName: { DEGREES: "DIRECTION" } + } + ]; + blockSwitches["motion_pointindirection"] = [ + { + opcode: "motion_turnright", + remapInputName: { DIRECTION: "DEGREES" } + }, + { + opcode: "motion_turnleft", + remapInputName: { DIRECTION: "DEGREES" } + }, + noopSwitch ]; blockSwitches["motion_gotoxy"] = [ noopSwitch, From f28aa2a47f4c31ce31081a87e45ede3660d1500c Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 18:58:49 -0700 Subject: [PATCH 03/17] Stretch block switches --- .../addons/block-switching/userscript.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 358a5fa0b34..272c8a8950a 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -288,6 +288,30 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + blockSwitches["looks_setStretch"] = [ + noopSwitch, + { + opcode: "looks_changeStretch" + } + ]; + blockSwitches["looks_changeStretch"] = [ + { + opcode: "looks_setStretch" + }, + noopSwitch, + ]; + blockSwitches["looks_stretchGetX"] = [ + noopSwitch, + { + opcode: "looks_stretchGetY" + } + ]; + blockSwitches["looks_stretchGetY"] = [ + { + opcode: "looks_stretchGetX" + }, + noopSwitch, + ]; blockSwitches["looks_costumenumbername"] = [ noopSwitch, { From 12ff7b0829e4f3fdf4ff3fb4fd8ae51ff6a62acc Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 19:09:52 -0700 Subject: [PATCH 04/17] Add direction to get position switches --- src/addons/addons/block-switching/userscript.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 272c8a8950a..590152470d2 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -250,12 +250,26 @@ export default async function ({ addon, console, msg }) { { opcode: "motion_yposition", }, + { + opcode: "motion_direction" + }, ]; blockSwitches["motion_yposition"] = [ { opcode: "motion_xposition", }, noopSwitch, + { + opcode: "motion_direction" + }, + ]; + blockSwitches["motion_direction"] = [ + { + opcode: "motion_xposition", + }, + { + opcode: "motion_yposition", + }, ]; } From ed33b8a31016470ee08e63f0067aeb9c38a51281 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 21:18:05 -0700 Subject: [PATCH 05/17] Add stop speaking to talking switches --- .../addons/block-switching/userscript.js | 70 ++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 590152470d2..f622aa3fec0 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -380,6 +380,7 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + blockSwitches["looks_say"] = [ noopSwitch, { @@ -403,6 +404,11 @@ export default async function ({ addon, console, msg }) { }, }, }, + { + opcode: "looks_stoptalking", + splitInputs: [ "MESSAGE" ], + } + ]; blockSwitches["looks_think"] = [ { @@ -427,35 +433,95 @@ export default async function ({ addon, console, msg }) { }, }, }, + { + opcode: "looks_stoptalking", + splitInputs: [ "MESSAGE" ], + } ]; blockSwitches["looks_sayforsecs"] = [ { opcode: "looks_say", splitInputs: ["SECS"], }, + noopSwitch, { opcode: "looks_think", splitInputs: ["SECS"], }, - noopSwitch, { opcode: "looks_thinkforsecs", }, + { + opcode: "looks_stoptalking", + splitInputs: [ "MESSAGE", "SECS" ], + } ]; blockSwitches["looks_thinkforsecs"] = [ { opcode: "looks_say", splitInputs: ["SECS"], }, + { + opcode: "looks_sayforsecs", + }, { opcode: "looks_think", splitInputs: ["SECS"], }, + noopSwitch, { - opcode: "looks_sayforsecs", + opcode: "looks_stoptalking", + splitInputs: [ "MESSAGE", "SECS" ], + } + ]; + blockSwitches["looks_stoptalking"] = [ + { + opcode: "looks_say", + createInputs: { + MESSAGE: { + shadowType: "text", + value: "Hello!", + } + } + }, + { + opcode: "looks_sayforsecs", + createInputs: { + MESSAGE: { + shadowType: "text", + value: "Hello!" + }, + SECS: { + shadowType: "math_number", + value: "2" + }, + } + }, + { + opcode: "looks_think", + createInputs: { + MESSAGE: { + shadowType: "text", + value: "Hmm..." + } + } + }, + { + opcode: "looks_thinkforsecs", + createInputs: { + MESSAGE: { + shadowType: "text", + value: "Hmm..." + }, + SECS: { + shadowType: "math_number", + value: "2" + }, + } }, noopSwitch, ]; + blockSwitches["looks_switchbackdropto"] = [ noopSwitch, { From db691235dacaed0a22003105f2cd9b3a6ece3d7a Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 21:32:45 -0700 Subject: [PATCH 06/17] Add play at seconds blocks to play sound block switches --- .../addons/block-switching/userscript.js | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index f622aa3fec0..18760a3f64b 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -380,7 +380,6 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; - blockSwitches["looks_say"] = [ noopSwitch, { @@ -521,7 +520,6 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; - blockSwitches["looks_switchbackdropto"] = [ noopSwitch, { @@ -576,15 +574,79 @@ export default async function ({ addon, console, msg }) { if (addon.settings.get("sound")) { blockSwitches["sound_play"] = [ noopSwitch, + { + opcode: "sound_play_at_seconds", + createInputs: { + VALUE: { + shadowType: "math_number", + value: "5", + } + } + }, { opcode: "sound_playuntildone", }, + { + opcode: "sound_play_at_seconds_until_done", + createInputs: { + VALUE: { + shadowType: "math_number", + value: "5", + } + } + }, ]; blockSwitches["sound_playuntildone"] = [ { opcode: "sound_play", }, + { + opcode: "sound_play_at_seconds", + createInputs: { + VALUE: { + shadowType: "math_number", + value: "5", + } + } + }, + noopSwitch, + { + opcode: "sound_play_at_seconds_until_done", + createInputs: { + VALUE: { + shadowType: "math_number", + value: "5", + } + } + }, + ]; + blockSwitches["sound_play_at_seconds"] = [ + { + opcode: "sound_play", + splitInputs: ["VALUE"], + } noopSwitch, + { + opcode: "sound_playuntildone", + splitInputs: [ "VALUE" ] + }, + { + opcode: "sound_play_at_seconds_until_done" + } + ]; + blockSwitches["sound_play_at_seconds_until_done"] = [ + { + opcode: "sound_play", + splitInputs: ["VALUE"], + } + { + opcode: "sound_play_at_seconds" + }, + { + opcode: "sound_playuntildone", + splitInputs: [ "VALUE" ] + }, + noopSwitch ]; blockSwitches["sound_seteffectto"] = [ noopSwitch, From ce6406c25851d9169cd9fb3fcaa531394e80b517 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 21:38:04 -0700 Subject: [PATCH 07/17] When key pressed <-> when key hit --- src/addons/addons/block-switching/userscript.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 18760a3f64b..b4945a2100a 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -687,6 +687,19 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + + blockSwitches["event_whenkeypressed"] = [ + noopSwitch, + { + opcode: "event_whenkeyhit" + } + ]; + blockSwitches["event_whenkeyhit"] = [ + { + opcode: "event_whenkeypressed" + }, + noopSwitch, + ]; } if (addon.settings.get("control")) { From ae84577a263b6f828cd6abb6919c4c2baf949581 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 21:50:38 -0700 Subject: [PATCH 08/17] wait switches As wait until is currently a switch with repeat until, I'm a bit apprehensive to remove it from that. --- .../addons/block-switching/userscript.js | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index b4945a2100a..671b5fd3651 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -716,6 +716,7 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + blockSwitches["control_repeat_until"] = [ noopSwitch, { @@ -739,21 +740,56 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; - blockSwitches["control_wait_until"] = [ + blockSwitches["control_while"] = [ { opcode: "control_repeat_until", }, noopSwitch, + { + opcode: "control_forever", + splitInputs: ["CONDITION"], + }, ]; - blockSwitches["control_while"] = [ + blockSwitches["control_wait_until"] = [ + { + opcode: "control_wait", + createInput: { + DURATION: { + shadowType: "math_number", + value: "1" + } + }, + splitInputs: [ "CONDITION" ] + }, + { + opcode: "control_repeat_until", + }, { opcode: "control_repeat_until", }, noopSwitch, + ]; + + blockSwitches["control_wait"] = [ + noopSwitch, { - opcode: "control_forever", - splitInputs: ["CONDITION"], + opcode: "control_waitsecondsoruntil" + }, + { + opcode: "control_wait_until", + splitInputs: [ "DURATION" ] + } + ]; + blockSwitches["control_waitsecondsoruntil"] = [ + { + opcode: "control_wait", + splitInputs: [ "CONDITION" ] + }, + noopSwitch, + { + opcode: "control_wait_until", + splitInputs: [ "DURATION" ] }, ]; } From 3e302e0d1f84ec43fb1db8af67e0934e6463acd2 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 21:58:03 -0700 Subject: [PATCH 09/17] Switch switches --- src/addons/addons/block-switching/userscript.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 671b5fd3651..d12db80d3b5 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -792,6 +792,15 @@ export default async function ({ addon, console, msg }) { splitInputs: [ "DURATION" ] }, ]; + + blockSwitches["control_switch"] = [ + noopSwitch, + { opcode: "control_switch_default" }, + ]; + blockSwitchs["control_switch_default"] = [ + { opcode: "control_switch" }, + noopSwitch + ]; } if (addon.settings.get("operator")) { From 268519cea953e207f4d9e0cf9764d3c25248fe39 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 22:00:39 -0700 Subject: [PATCH 10/17] Loop controls switches --- src/addons/addons/block-switching/userscript.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index d12db80d3b5..f37372a30fe 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -797,10 +797,19 @@ export default async function ({ addon, console, msg }) { noopSwitch, { opcode: "control_switch_default" }, ]; - blockSwitchs["control_switch_default"] = [ + blockSwitches["control_switch_default"] = [ { opcode: "control_switch" }, noopSwitch ]; + + blockSwitches["control_exitLoop"] = [ + noopSwitch, + { opcode: "control_continueLoop" } + ]; + blockSwitches["control_continueLoop"] = [ + { opcode: "control_exitLoop" } + noopSwitch, + ]; } if (addon.settings.get("operator")) { From ab5a14d3ccec1b9701986410089a3f33bc9c1beb Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Tue, 21 Oct 2025 22:06:15 -0700 Subject: [PATCH 11/17] index of ... in text switches --- src/addons/addons/block-switching/userscript.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index f37372a30fe..8eb53818b76 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -1053,6 +1053,16 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + + blockSwitches["operator_indexOfTextInText"] = [ + noopSwitch, + { opcode: "operator_lastIndexOfTextInText" }, + ]; + blockSwitches["operator_lastIndexOfTextInText"] = [ + { opcode: "operator_indexOfTextInText" }, + noopSwitch, + ]; + } if (addon.settings.get("sensing")) { From eeec4a2462fe1796b8c0ee9f9088bf8998eb25a7 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Fri, 24 Oct 2025 18:20:25 -0700 Subject: [PATCH 12/17] Add distance from and direction to --- src/addons/addons/block-switching/userscript.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 8eb53818b76..5ceb37d6012 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -1097,6 +1097,19 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + + blockSwitches["sensing_distanceTo"] = [ + noopSwitch, + { + opcode: "sensing_directionTo" + } + ]; + blockSwitches["sensing_directionTo"] = [ + noopSwitch, + { + opcode: "sensing_distanceTo" + } + ]; } if (addon.settings.get("data")) { From fe1fe9e3fc197ae0a61da989ab068280e2edec52 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Fri, 24 Oct 2025 18:29:26 -0700 Subject: [PATCH 13/17] Text and number detection switches --- .../addons/block-switching/userscript.js | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 5ceb37d6012..657f28a0888 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -1105,10 +1105,38 @@ export default async function ({ addon, console, msg }) { } ]; blockSwitches["sensing_directionTo"] = [ - noopSwitch, { opcode: "sensing_distanceTo" } + noopSwitch, + ]; + + blockSwitches["sensing_thing_is_text"] = [ + noopSwitch, + { + opcode: "sensing_thing_is_number", + }, + { + opcode: "sensing_thing_has_text", + } + ]; + blockSwitches["sensing_thing_is_number"] = [ + { + opcode: "sensing_thing_is_text", + }, + noopSwitch, + { + opcode: "sensing_thing_has_text", + } + ]; + blockSwitches["sensing_thing_has_text"] = [ + { + opcode: "sensing_thing_is_text", + } + { + opcode: "sensing_thing_is_number", + }, + noopSwitch, ]; } From 22c0958f1aad545e1a4ce27cbd2882232a9ca7fe Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Fri, 24 Oct 2025 18:39:53 -0700 Subject: [PATCH 14/17] Add add to list block to switch --- .../addons/block-switching/userscript.js | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 657f28a0888..70aaa73579e 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -1062,7 +1062,6 @@ export default async function ({ addon, console, msg }) { { opcode: "operator_indexOfTextInText" }, noopSwitch, ]; - } if (addon.settings.get("sensing")) { @@ -1179,18 +1178,43 @@ export default async function ({ addon, console, msg }) { }, noopSwitch, ]; + blockSwitches["data_replaceitemoflist"] = [ noopSwitch, { opcode: "data_insertatlist", }, + { + opcode: "data_addtolist", + splitInputs: ["INDEX"] + }, ]; blockSwitches["data_insertatlist"] = [ { opcode: "data_replaceitemoflist", }, noopSwitch, + { + opcode: "data_addtolist", + splitInputs: ["INDEX"] + }, ]; + blockSwitches["data_addtolist"] = [ + { + opcode: "data_replaceitemoflist", + createInputs: { + INDEX: { shadowType: "math_number" } + } + }, + { + opcode: "data_insertatlist", + createInputs: { + INDEX: { shadowType: "math_number" } + } + }, + noopSwitch + ]; + blockSwitches["data_deleteoflist"] = [ noopSwitch, { From a1005da3a865d89e2acd95c52b3968da32384ec8 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Fri, 24 Oct 2025 18:43:28 -0700 Subject: [PATCH 15/17] Merge adding and subtracting from a list switches --- .../addons/block-switching/userscript.js | 79 ++++++++++++++++++- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index 70aaa73579e..b75fab22666 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -1203,19 +1203,54 @@ export default async function ({ addon, console, msg }) { { opcode: "data_replaceitemoflist", createInputs: { - INDEX: { shadowType: "math_number" } + INDEX: { + shadowType: "math_number", + value: "1" + } + } }, { opcode: "data_insertatlist", createInputs: { - INDEX: { shadowType: "math_number" } + INDEX: { + shadowType: "math_number", + value: "1" + } } }, noopSwitch ]; blockSwitches["data_deleteoflist"] = [ + { + opcode: "data_replaceitemoflist", + createInputs: { + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_insertatlist", + createInputs: { + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_addtolist", + splitInputs: ["INDEX"], + createInputs: { + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, noopSwitch, { opcode: "data_deletealloflist", @@ -1223,6 +1258,46 @@ export default async function ({ addon, console, msg }) { }, ]; blockSwitches["data_deletealloflist"] = [ + { + opcode: "data_replaceitemoflist", + createInputs: { + INDEX: { + shadowType: "math_integer", + value: "1", + }, + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_insertatlist", + createInputs: { + INDEX: { + shadowType: "math_integer", + value: "1", + }, + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_addtolist", + splitInputs: ["INDEX"], + createInputs: { + INDEX: { + shadowType: "math_integer", + value: "1", + }, + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, { opcode: "data_deleteoflist", createInputs: { From 69f0d07d8871c3e7ee900087adf3ea59a0517ff5 Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Fri, 24 Oct 2025 18:48:51 -0700 Subject: [PATCH 16/17] Shift list block --- .../addons/block-switching/userscript.js | 89 ++++++++++++++++++- 1 file changed, 87 insertions(+), 2 deletions(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index b75fab22666..f32b6ea8385 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -1188,6 +1188,18 @@ export default async function ({ addon, console, msg }) { opcode: "data_addtolist", splitInputs: ["INDEX"] }, + { + opcode: "data_deleteoflist", + splitInputs: ["ITEM"] + }, + { + opcode: "data_deletealloflist", + splitInputs: ["INDEX","ITEM"], + }, + { + opcode: "data_shiftlist", + splitInputs: ["ITEM"] + }, ]; blockSwitches["data_insertatlist"] = [ { @@ -1198,6 +1210,18 @@ export default async function ({ addon, console, msg }) { opcode: "data_addtolist", splitInputs: ["INDEX"] }, + { + opcode: "data_deleteoflist", + splitInputs: ["ITEM"] + }, + { + opcode: "data_deletealloflist", + splitInputs: ["INDEX","ITEM"], + }, + { + opcode: "data_shiftlist", + splitInputs: ["ITEM"] + }, ]; blockSwitches["data_addtolist"] = [ { @@ -1219,9 +1243,20 @@ export default async function ({ addon, console, msg }) { } } }, - noopSwitch + noopSwitch, + { + opcode: "data_deleteoflist", + splitInputs: ["ITEM"] + }, + { + opcode: "data_deletealloflist", + splitInputs: ["INDEX","ITEM"], + }, + { + opcode: "data_shiftlist", + splitInputs: ["ITEM"] + }, ]; - blockSwitches["data_deleteoflist"] = [ { opcode: "data_replaceitemoflist", @@ -1256,6 +1291,9 @@ export default async function ({ addon, console, msg }) { opcode: "data_deletealloflist", splitInputs: ["INDEX"], }, + { + opcode: "data_shiftlist", + }, ]; blockSwitches["data_deletealloflist"] = [ { @@ -1308,6 +1346,53 @@ export default async function ({ addon, console, msg }) { }, }, noopSwitch, + { + opcode: "data_shiftlist", + createInputs: { + INDEX: { + shadowType: "math_integer", + value: "1", + }, + }, + }, + ]; + blockSwitches["data_shiftlist"] = [ + { + opcode: "data_replaceitemoflist", + createInputs: { + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_insertatlist", + createInputs: { + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_addtolist", + splitInputs: ["INDEX"], + createInputs: { + ITEM: { + shadowType: "text". + value: "thing", + } + } + }, + { + opcode: "data_deleteoflist" + }, + { + opcode: "data_deletealloflist", + splitInputs: ["INDEX"], + }, + noopSwitch ]; } From 2d067c535aca14075108b3a23b90bf15de5e017f Mon Sep 17 00:00:00 2001 From: Steve0Greatness Date: Sun, 2 Nov 2025 20:23:08 -0800 Subject: [PATCH 17/17] Fix JSON errors --- .../addons/block-switching/userscript.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/addons/addons/block-switching/userscript.js b/src/addons/addons/block-switching/userscript.js index f32b6ea8385..7039c81f261 100644 --- a/src/addons/addons/block-switching/userscript.js +++ b/src/addons/addons/block-switching/userscript.js @@ -624,7 +624,7 @@ export default async function ({ addon, console, msg }) { { opcode: "sound_play", splitInputs: ["VALUE"], - } + }, noopSwitch, { opcode: "sound_playuntildone", @@ -638,7 +638,7 @@ export default async function ({ addon, console, msg }) { { opcode: "sound_play", splitInputs: ["VALUE"], - } + }, { opcode: "sound_play_at_seconds" }, @@ -807,7 +807,7 @@ export default async function ({ addon, console, msg }) { { opcode: "control_continueLoop" } ]; blockSwitches["control_continueLoop"] = [ - { opcode: "control_exitLoop" } + { opcode: "control_exitLoop" }, noopSwitch, ]; } @@ -1106,7 +1106,7 @@ export default async function ({ addon, console, msg }) { blockSwitches["sensing_directionTo"] = [ { opcode: "sensing_distanceTo" - } + }, noopSwitch, ]; @@ -1131,7 +1131,7 @@ export default async function ({ addon, console, msg }) { blockSwitches["sensing_thing_has_text"] = [ { opcode: "sensing_thing_is_text", - } + }, { opcode: "sensing_thing_is_number", }, @@ -1262,7 +1262,7 @@ export default async function ({ addon, console, msg }) { opcode: "data_replaceitemoflist", createInputs: { ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1271,7 +1271,7 @@ export default async function ({ addon, console, msg }) { opcode: "data_insertatlist", createInputs: { ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1281,7 +1281,7 @@ export default async function ({ addon, console, msg }) { splitInputs: ["INDEX"], createInputs: { ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1304,7 +1304,7 @@ export default async function ({ addon, console, msg }) { value: "1", }, ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1317,7 +1317,7 @@ export default async function ({ addon, console, msg }) { value: "1", }, ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1331,7 +1331,7 @@ export default async function ({ addon, console, msg }) { value: "1", }, ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1361,7 +1361,7 @@ export default async function ({ addon, console, msg }) { opcode: "data_replaceitemoflist", createInputs: { ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1370,7 +1370,7 @@ export default async function ({ addon, console, msg }) { opcode: "data_insertatlist", createInputs: { ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } } @@ -1380,7 +1380,7 @@ export default async function ({ addon, console, msg }) { splitInputs: ["INDEX"], createInputs: { ITEM: { - shadowType: "text". + shadowType: "text", value: "thing", } }