scratchattach 2.1.13__py3-none-any.whl → 2.1.15b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. scratchattach/cloud/_base.py +12 -8
  2. scratchattach/cloud/cloud.py +19 -7
  3. scratchattach/editor/asset.py +59 -5
  4. scratchattach/editor/base.py +82 -31
  5. scratchattach/editor/block.py +86 -15
  6. scratchattach/editor/blockshape.py +10 -6
  7. scratchattach/editor/build_defaulting.py +6 -2
  8. scratchattach/editor/code_translation/__init__.py +0 -0
  9. scratchattach/editor/code_translation/parse.py +177 -0
  10. scratchattach/editor/comment.py +6 -0
  11. scratchattach/editor/commons.py +49 -19
  12. scratchattach/editor/extension.py +10 -3
  13. scratchattach/editor/field.py +9 -0
  14. scratchattach/editor/inputs.py +4 -1
  15. scratchattach/editor/meta.py +11 -3
  16. scratchattach/editor/monitor.py +46 -38
  17. scratchattach/editor/mutation.py +11 -4
  18. scratchattach/editor/pallete.py +24 -25
  19. scratchattach/editor/prim.py +2 -2
  20. scratchattach/editor/project.py +9 -3
  21. scratchattach/editor/sprite.py +19 -6
  22. scratchattach/editor/twconfig.py +2 -1
  23. scratchattach/editor/vlb.py +1 -1
  24. scratchattach/eventhandlers/_base.py +2 -2
  25. scratchattach/eventhandlers/cloud_events.py +2 -2
  26. scratchattach/eventhandlers/cloud_requests.py +3 -3
  27. scratchattach/eventhandlers/cloud_server.py +3 -3
  28. scratchattach/eventhandlers/message_events.py +1 -1
  29. scratchattach/other/other_apis.py +4 -4
  30. scratchattach/other/project_json_capabilities.py +3 -3
  31. scratchattach/site/_base.py +13 -12
  32. scratchattach/site/activity.py +11 -43
  33. scratchattach/site/alert.py +227 -0
  34. scratchattach/site/backpack_asset.py +2 -2
  35. scratchattach/site/browser_cookie3_stub.py +17 -0
  36. scratchattach/site/browser_cookies.py +27 -21
  37. scratchattach/site/classroom.py +51 -34
  38. scratchattach/site/cloud_activity.py +4 -4
  39. scratchattach/site/comment.py +30 -8
  40. scratchattach/site/forum.py +101 -69
  41. scratchattach/site/project.py +42 -21
  42. scratchattach/site/session.py +170 -80
  43. scratchattach/site/studio.py +4 -4
  44. scratchattach/site/user.py +179 -64
  45. scratchattach/utils/commons.py +35 -23
  46. scratchattach/utils/enums.py +44 -5
  47. scratchattach/utils/exceptions.py +10 -0
  48. scratchattach/utils/requests.py +57 -31
  49. {scratchattach-2.1.13.dist-info → scratchattach-2.1.15b0.dist-info}/METADATA +8 -3
  50. scratchattach-2.1.15b0.dist-info/RECORD +66 -0
  51. {scratchattach-2.1.13.dist-info → scratchattach-2.1.15b0.dist-info}/WHEEL +1 -1
  52. scratchattach/editor/sbuild.py +0 -2837
  53. scratchattach-2.1.13.dist-info/RECORD +0 -63
  54. {scratchattach-2.1.13.dist-info → scratchattach-2.1.15b0.dist-info}/licenses/LICENSE +0 -0
  55. {scratchattach-2.1.13.dist-info → scratchattach-2.1.15b0.dist-info}/top_level.txt +0 -0
@@ -1,2837 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from .. import editor
4
- from typing import Optional
5
-
6
- # Copied from sbuild so we have to make a few wrappers ;-;
7
- # May need to recreate this from scratch. In which case, it is to be done in palette.py
8
- class Block(editor.Block):
9
- ...
10
-
11
- class Input(editor.Input):
12
- ...
13
- class Field(editor.Field):
14
- ...
15
- class Variable(editor.Variable):
16
- ...
17
- class List(editor.List):
18
- ...
19
- class Broadcast(editor.Broadcast):
20
- ...
21
- class Mutation(editor.Mutation):
22
- ...
23
-
24
-
25
- class Motion:
26
- class MoveSteps(Block):
27
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
28
- super().__init__(None, "motion_movesteps", _shadow=shadow, pos=pos)
29
-
30
- def set_steps(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
31
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
32
-
33
- if isinstance(value, Block):
34
- value = self.target.add_block(value)
35
- elif isinstance(value, list) or isinstance(value, tuple):
36
- if isinstance(value[0], Block):
37
- value = self.target.link_chain(value)
38
- return self.add_input(
39
- Input("STEPS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
40
-
41
- class TurnRight(Block):
42
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
43
- super().__init__(None, "motion_turnright", _shadow=shadow, pos=pos)
44
-
45
- def set_degrees(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
46
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
47
-
48
- if isinstance(value, Block):
49
- value = self.target.add_block(value)
50
- elif isinstance(value, list) or isinstance(value, tuple):
51
- if isinstance(value[0], Block):
52
- value = self.target.link_chain(value)
53
- return self.add_input(
54
- Input("DEGREES", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
55
-
56
- class TurnLeft(Block):
57
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
58
- super().__init__(None, "motion_turnleft", _shadow=shadow, pos=pos)
59
-
60
- def set_degrees(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
61
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
62
-
63
- if isinstance(value, Block):
64
- value = self.target.add_block(value)
65
- elif isinstance(value, list) or isinstance(value, tuple):
66
- if isinstance(value[0], Block):
67
- value = self.target.link_chain(value)
68
- return self.add_input(
69
- Input("DEGREES", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
70
-
71
- class GoTo(Block):
72
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
73
- super().__init__(None, "motion_goto", _shadow=shadow, pos=pos)
74
-
75
- def set_to(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
76
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
77
-
78
- if isinstance(value, Block):
79
- value = self.target.add_block(value)
80
- elif isinstance(value, list) or isinstance(value, tuple):
81
- if isinstance(value[0], Block):
82
- value = self.target.link_chain(value)
83
- return self.add_input(Input("TO", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
84
-
85
- class GoToMenu(Block):
86
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
87
- super().__init__(None, "motion_goto_menu", _shadow=shadow, pos=pos)
88
-
89
- def set_to(self, value: str = "_random_", value_id: Optional[str] = None):
90
- return self.add_field(Field("TO", value, value_id))
91
-
92
- class GoToXY(Block):
93
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
94
- super().__init__(None, "motion_gotoxy", _shadow=shadow, pos=pos)
95
-
96
- def set_x(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
97
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
98
-
99
- if isinstance(value, Block):
100
- value = self.target.add_block(value)
101
- elif isinstance(value, list) or isinstance(value, tuple):
102
- if isinstance(value[0], Block):
103
- value = self.target.link_chain(value)
104
- return self.add_input(Input("X", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
105
-
106
- def set_y(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
107
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
108
-
109
- if isinstance(value, Block):
110
- value = self.target.add_block(value)
111
- elif isinstance(value, list) or isinstance(value, tuple):
112
- if isinstance(value[0], Block):
113
- value = self.target.link_chain(value)
114
- return self.add_input(Input("Y", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
115
-
116
- class GlideTo(Block):
117
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
118
- super().__init__(None, "motion_glideto", _shadow=shadow, pos=pos)
119
-
120
- def set_secs(self, value, input_type: str | int = "positive number", shadow_status: int = 1, *,
121
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
122
-
123
- if isinstance(value, Block):
124
- value = self.target.add_block(value)
125
- elif isinstance(value, list) or isinstance(value, tuple):
126
- if isinstance(value[0], Block):
127
- value = self.target.link_chain(value)
128
- return self.add_input(Input("SECS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
129
-
130
- def set_to(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
131
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
132
-
133
- if isinstance(value, Block):
134
- value = self.target.add_block(value)
135
- elif isinstance(value, list) or isinstance(value, tuple):
136
- if isinstance(value[0], Block):
137
- value = self.target.link_chain(value)
138
- return self.add_input(Input("TO", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
139
-
140
- class GlideToMenu(Block):
141
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
142
- super().__init__(None, "motion_glideto_menu", _shadow=shadow, pos=pos)
143
-
144
- def set_to(self, value: str = "_random_", value_id: Optional[str] = None):
145
- return self.add_field(Field("TO", value, value_id))
146
-
147
- class GlideSecsToXY(Block):
148
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
149
- super().__init__(None, "motion_glidesecstoxy", _shadow=shadow, pos=pos)
150
-
151
- def set_x(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
152
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
153
-
154
- if isinstance(value, Block):
155
- value = self.target.add_block(value)
156
- elif isinstance(value, list) or isinstance(value, tuple):
157
- if isinstance(value[0], Block):
158
- value = self.target.link_chain(value)
159
- return self.add_input(Input("X", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
160
-
161
- def set_y(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
162
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
163
-
164
- if isinstance(value, Block):
165
- value = self.target.add_block(value)
166
- elif isinstance(value, list) or isinstance(value, tuple):
167
- if isinstance(value[0], Block):
168
- value = self.target.link_chain(value)
169
- return self.add_input(Input("Y", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
170
-
171
- def set_secs(self, value, input_type: str | int = "positive number", shadow_status: int = 1, *,
172
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
173
-
174
- if isinstance(value, Block):
175
- value = self.target.add_block(value)
176
- elif isinstance(value, list) or isinstance(value, tuple):
177
- if isinstance(value[0], Block):
178
- value = self.target.link_chain(value)
179
- return self.add_input(Input("SECS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
180
-
181
- class PointInDirection(Block):
182
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
183
- super().__init__(None, "motion_pointindirection", _shadow=shadow, pos=pos)
184
-
185
- def set_direction(self, value, input_type: str | int = "angle", shadow_status: int = 1, *,
186
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
187
-
188
- if isinstance(value, Block):
189
- value = self.target.add_block(value)
190
- elif isinstance(value, list) or isinstance(value, tuple):
191
- if isinstance(value[0], Block):
192
- value = self.target.link_chain(value)
193
- return self.add_input(
194
- Input("DIRECTION", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
195
-
196
- class PointTowards(Block):
197
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
198
- super().__init__(None, "motion_pointtowards", _shadow=shadow, pos=pos)
199
-
200
- def set_towards(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
201
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
202
-
203
- if isinstance(value, Block):
204
- value = self.target.add_block(value)
205
- elif isinstance(value, list) or isinstance(value, tuple):
206
- if isinstance(value[0], Block):
207
- value = self.target.link_chain(value)
208
- return self.add_input(
209
- Input("TOWARDS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
210
-
211
- class PointTowardsMenu(Block):
212
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
213
- super().__init__(None, "motion_pointtowards_menu", _shadow=shadow, pos=pos)
214
-
215
- def set_towards(self, value: str = "_mouse_", value_id: Optional[str] = None):
216
- return self.add_field(Field("TOWARDS", value, value_id))
217
-
218
- class ChangeXBy(Block):
219
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
220
- super().__init__(None, "motion_changexby", _shadow=shadow, pos=pos)
221
-
222
- def set_dx(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
223
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
224
-
225
- if isinstance(value, Block):
226
- value = self.target.add_block(value)
227
- elif isinstance(value, list) or isinstance(value, tuple):
228
- if isinstance(value[0], Block):
229
- value = self.target.link_chain(value)
230
- return self.add_input(Input("DX", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
231
-
232
- class ChangeYBy(Block):
233
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
234
- super().__init__(None, "motion_changeyby", _shadow=shadow, pos=pos)
235
-
236
- def set_dy(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
237
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
238
-
239
- if isinstance(value, Block):
240
- value = self.target.add_block(value)
241
- elif isinstance(value, list) or isinstance(value, tuple):
242
- if isinstance(value[0], Block):
243
- value = self.target.link_chain(value)
244
- return self.add_input(Input("DY", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
245
-
246
- class SetX(Block):
247
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
248
- super().__init__(None, "motion_setx", _shadow=shadow, pos=pos)
249
-
250
- def set_x(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
251
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
252
-
253
- if isinstance(value, Block):
254
- value = self.target.add_block(value)
255
- elif isinstance(value, list) or isinstance(value, tuple):
256
- if isinstance(value[0], Block):
257
- value = self.target.link_chain(value)
258
- return self.add_input(Input("X", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
259
-
260
- class SetY(Block):
261
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
262
- super().__init__(None, "motion_sety", _shadow=shadow, pos=pos)
263
-
264
- def set_y(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
265
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
266
-
267
- if isinstance(value, Block):
268
- value = self.target.add_block(value)
269
- elif isinstance(value, list) or isinstance(value, tuple):
270
- if isinstance(value[0], Block):
271
- value = self.target.link_chain(value)
272
- return self.add_input(Input("Y", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
273
-
274
- class IfOnEdgeBounce(Block):
275
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
276
- super().__init__(None, "motion_ifonedgebounce", _shadow=shadow, pos=pos)
277
-
278
- class SetRotationStyle(Block):
279
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
280
- super().__init__(None, "motion_setrotationstyle", _shadow=shadow, pos=pos)
281
-
282
- def set_style(self, value: str = "all around", value_id: Optional[str] = None):
283
- return self.add_field(Field("STYLE", value, value_id))
284
-
285
- class XPosition(Block):
286
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
287
- super().__init__(None, "motion_xposition", _shadow=shadow, pos=pos)
288
-
289
- class YPosition(Block):
290
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
291
- super().__init__(None, "motion_yposition", _shadow=shadow, pos=pos)
292
-
293
- class Direction(Block):
294
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
295
- super().__init__(None, "motion_direction", _shadow=shadow, pos=pos)
296
-
297
- class ScrollRight(Block):
298
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
299
- super().__init__(None, "motion_scroll_right", _shadow=shadow, pos=pos)
300
-
301
- def set_distance(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
302
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
303
-
304
- if isinstance(value, Block):
305
- value = self.target.add_block(value)
306
- elif isinstance(value, list) or isinstance(value, tuple):
307
- if isinstance(value[0], Block):
308
- value = self.target.link_chain(value)
309
- return self.add_input(
310
- Input("DISTANCE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
311
-
312
- class ScrollUp(Block):
313
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
314
- super().__init__(None, "motion_scroll_up", _shadow=shadow, pos=pos)
315
-
316
- def set_distance(self, value, input_type: str | int = "number", shadow_status: int = 1, *,
317
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
318
-
319
- if isinstance(value, Block):
320
- value = self.target.add_block(value)
321
- elif isinstance(value, list) or isinstance(value, tuple):
322
- if isinstance(value[0], Block):
323
- value = self.target.link_chain(value)
324
- return self.add_input(
325
- Input("DISTANCE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
326
-
327
- class AlignScene(Block):
328
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
329
- super().__init__(None, "motion_align_scene", _shadow=shadow, pos=pos)
330
-
331
- def set_alignment(self, value: str = "bottom-left", value_id: Optional[str] = None):
332
- return self.add_field(Field("ALIGNMENT", value, value_id))
333
-
334
- class XScroll(Block):
335
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
336
- super().__init__(None, "motion_xscroll", _shadow=shadow, pos=pos)
337
-
338
- class YScroll(Block):
339
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
340
- super().__init__(None, "motion_yscroll", _shadow=shadow, pos=pos)
341
-
342
-
343
- class Looks:
344
- class SayForSecs(Block):
345
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
346
- super().__init__(None, "looks_sayforsecs", _shadow=shadow, pos=pos)
347
-
348
- def set_message(self, value="Hello!", input_type: str | int = "string", shadow_status: int = 1, *,
349
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
350
-
351
- if isinstance(value, Block):
352
- value = self.target.add_block(value)
353
- elif isinstance(value, list) or isinstance(value, tuple):
354
- if isinstance(value[0], Block):
355
- value = self.target.link_chain(value)
356
- return self.add_input(
357
- Input("MESSAGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
358
- )
359
-
360
- def set_secs(self, value=2, input_type: str | int = "positive integer", shadow_status: int = 1, *,
361
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
362
-
363
- if isinstance(value, Block):
364
- value = self.target.add_block(value)
365
- elif isinstance(value, list) or isinstance(value, tuple):
366
- if isinstance(value[0], Block):
367
- value = self.target.link_chain(value)
368
- return self.add_input(
369
- Input("SECS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
370
- )
371
-
372
- class Say(Block):
373
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
374
- super().__init__(None, "looks_say", _shadow=shadow, pos=pos)
375
-
376
- def set_message(self, value="Hello!", input_type: str | int = "string", shadow_status: int = 1, *,
377
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
378
-
379
- if isinstance(value, Block):
380
- value = self.target.add_block(value)
381
- elif isinstance(value, list) or isinstance(value, tuple):
382
- if isinstance(value[0], Block):
383
- value = self.target.link_chain(value)
384
- return self.add_input(
385
- Input("MESSAGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
386
- )
387
-
388
- class ThinkForSecs(Block):
389
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
390
- super().__init__(None, "looks_thinkforsecs", _shadow=shadow, pos=pos)
391
-
392
- def set_message(self, value="Hmm...", input_type: str | int = "string", shadow_status: int = 1, *,
393
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
394
-
395
- if isinstance(value, Block):
396
- value = self.target.add_block(value)
397
- elif isinstance(value, list) or isinstance(value, tuple):
398
- if isinstance(value[0], Block):
399
- value = self.target.link_chain(value)
400
- return self.add_input(
401
- Input("MESSAGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
402
- )
403
-
404
- def set_secs(self, value=2, input_type: str | int = "positive integer", shadow_status: int = 1, *,
405
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
406
-
407
- if isinstance(value, Block):
408
- value = self.target.add_block(value)
409
- elif isinstance(value, list) or isinstance(value, tuple):
410
- if isinstance(value[0], Block):
411
- value = self.target.link_chain(value)
412
- return self.add_input(
413
- Input("SECS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
414
- )
415
-
416
- class Think(Block):
417
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
418
- super().__init__(None, "looks_think", _shadow=shadow, pos=pos)
419
-
420
- def set_message(self, value="Hmm...", input_type: str | int = "string", shadow_status: int = 1, *,
421
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
422
-
423
- if isinstance(value, Block):
424
- value = self.target.add_block(value)
425
- elif isinstance(value, list) or isinstance(value, tuple):
426
- if isinstance(value[0], Block):
427
- value = self.target.link_chain(value)
428
- return self.add_input(
429
- Input("MESSAGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
430
- )
431
-
432
- class SwitchCostumeTo(Block):
433
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
434
- super().__init__(None, "looks_switchcostumeto", _shadow=shadow, pos=pos)
435
-
436
- def set_costume(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
437
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
438
-
439
- if isinstance(value, Block):
440
- value = self.target.add_block(value)
441
- elif isinstance(value, list) or isinstance(value, tuple):
442
- if isinstance(value[0], Block):
443
- value = self.target.link_chain(value)
444
- return self.add_input(
445
- Input("COSTUME", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
446
-
447
- class Costume(Block):
448
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
449
- super().__init__(None, "looks_costume", _shadow=shadow, pos=pos)
450
-
451
- def set_costume(self, value: str = "costume1", value_id: Optional[str] = None):
452
- return self.add_field(Field("COSTUME", value, value_id))
453
-
454
- class NextCostume(Block):
455
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
456
- super().__init__(None, "looks_nextcostume", _shadow=shadow, pos=pos)
457
-
458
- class SwitchBackdropTo(Block):
459
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
460
- super().__init__(None, "looks_switchbackdropto", _shadow=shadow, pos=pos)
461
-
462
- def set_backdrop(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
463
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
464
-
465
- if isinstance(value, Block):
466
- value = self.target.add_block(value)
467
- elif isinstance(value, list) or isinstance(value, tuple):
468
- if isinstance(value[0], Block):
469
- value = self.target.link_chain(value)
470
- return self.add_input(
471
- Input("BACKDROP", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
472
-
473
- class Backdrops(Block):
474
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
475
- super().__init__(None, "looks_backdrops", _shadow=shadow, pos=pos)
476
-
477
- def set_backdrop(self, value: str = "costume1", value_id: Optional[str] = None):
478
- return self.add_field(Field("BACKDROP", value, value_id))
479
-
480
- class SwitchBackdropToAndWait(Block):
481
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
482
- super().__init__(None, "looks_switchbackdroptoandwait", _shadow=shadow, pos=pos)
483
-
484
- def set_backdrop(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
485
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
486
-
487
- if isinstance(value, Block):
488
- value = self.target.add_block(value)
489
- elif isinstance(value, list) or isinstance(value, tuple):
490
- if isinstance(value[0], Block):
491
- value = self.target.link_chain(value)
492
- return self.add_input(
493
- Input("BACKDROP", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
494
-
495
- class NextBackdrop(Block):
496
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
497
- super().__init__(None, "looks_nextbackdrop", _shadow=shadow, pos=pos)
498
-
499
- class ChangeSizeBy(Block):
500
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
501
- super().__init__(None, "looks_changesizeby", _shadow=shadow, pos=pos)
502
-
503
- def set_change(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
504
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
505
-
506
- if isinstance(value, Block):
507
- value = self.target.add_block(value)
508
- elif isinstance(value, list) or isinstance(value, tuple):
509
- if isinstance(value[0], Block):
510
- value = self.target.link_chain(value)
511
- return self.add_input(
512
- Input("CHANGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
513
-
514
- class SetSizeTo(Block):
515
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
516
- super().__init__(None, "looks_setsizeto", _shadow=shadow, pos=pos)
517
-
518
- def set_size(self, value="100", input_type: str | int = "number", shadow_status: int = 1, *,
519
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
520
-
521
- if isinstance(value, Block):
522
- value = self.target.add_block(value)
523
- elif isinstance(value, list) or isinstance(value, tuple):
524
- if isinstance(value[0], Block):
525
- value = self.target.link_chain(value)
526
- return self.add_input(
527
- Input("SIZE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
528
-
529
- class ChangeEffectBy(Block):
530
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
531
- super().__init__(None, "looks_changeeffectby", _shadow=shadow, pos=pos)
532
-
533
- def set_change(self, value="100", input_type: str | int = "number", shadow_status: int = 1, *,
534
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
535
-
536
- if isinstance(value, Block):
537
- value = self.target.add_block(value)
538
- elif isinstance(value, list) or isinstance(value, tuple):
539
- if isinstance(value[0], Block):
540
- value = self.target.link_chain(value)
541
- return self.add_input(
542
- Input("CHANGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
543
-
544
- def set_effect(self, value: str = "COLOR", value_id: Optional[str] = None):
545
- return self.add_field(Field("EFFECT", value, value_id))
546
-
547
- class SetEffectTo(Block):
548
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
549
- super().__init__(None, "looks_seteffectto", _shadow=shadow, pos=pos)
550
-
551
- def set_value(self, value="0", input_type: str | int = "number", shadow_status: int = 1, *,
552
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
553
-
554
- if isinstance(value, Block):
555
- value = self.target.add_block(value)
556
- elif isinstance(value, list) or isinstance(value, tuple):
557
- if isinstance(value[0], Block):
558
- value = self.target.link_chain(value)
559
- return self.add_input(
560
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
561
-
562
- def set_effect(self, value: str = "COLOR", value_id: Optional[str] = None):
563
- return self.add_field(Field("EFFECT", value, value_id))
564
-
565
- class ClearGraphicEffects(Block):
566
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
567
- super().__init__(None, "looks_cleargraphiceffects", _shadow=shadow, pos=pos)
568
-
569
- class Hide(Block):
570
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
571
- super().__init__(None, "looks_hide", _shadow=shadow, pos=pos)
572
-
573
- class Show(Block):
574
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
575
- super().__init__(None, "looks_show", _shadow=shadow, pos=pos)
576
-
577
- class GoToFrontBack(Block):
578
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
579
- super().__init__(None, "looks_gotofrontback", _shadow=shadow, pos=pos)
580
-
581
- def set_front_back(self, value: str = "front", value_id: Optional[str] = None):
582
- return self.add_field(Field("FRONT_BACK", value, value_id))
583
-
584
- class GoForwardBackwardLayers(Block):
585
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
586
- super().__init__(None, "looks_goforwardbackwardlayers", _shadow=shadow, pos=pos)
587
-
588
- def set_num(self, value="1", input_type: str | int = "positive integer", shadow_status: int = 1, *,
589
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
590
-
591
- if isinstance(value, Block):
592
- value = self.target.add_block(value)
593
- elif isinstance(value, list) or isinstance(value, tuple):
594
- if isinstance(value[0], Block):
595
- value = self.target.link_chain(value)
596
- return self.add_input(
597
- Input("NUM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
598
-
599
- def set_fowrward_backward(self, value: str = "forward", value_id: Optional[str] = None):
600
- return self.add_field(Field("FORWARD_BACKWARD", value, value_id))
601
-
602
- class CostumeNumberName(Block):
603
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
604
- super().__init__(None, "looks_costumenumbername", _shadow=shadow, pos=pos)
605
-
606
- def set_number_name(self, value: str = "string", value_id: Optional[str] = None):
607
- return self.add_field(Field("NUMBER_NAME", value, value_id))
608
-
609
- class BackdropNumberName(Block):
610
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
611
- super().__init__(None, "looks_backdropnumbername", _shadow=shadow, pos=pos)
612
-
613
- def set_number_name(self, value: str = "number", value_id: Optional[str] = None):
614
- return self.add_field(Field("NUMBER_NAME", value, value_id))
615
-
616
- class Size(Block):
617
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
618
- super().__init__(None, "looks_size", _shadow=shadow, pos=pos)
619
-
620
- class HideAllSprites(Block):
621
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
622
- super().__init__(None, "looks_hideallsprites", _shadow=shadow, pos=pos)
623
-
624
- class SetStretchTo(Block):
625
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
626
- super().__init__(None, "looks_setstretchto", _shadow=shadow, pos=pos)
627
-
628
- def set_stretch(self, value="100", input_type: str | int = "number", shadow_status: int = 1, *,
629
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
630
-
631
- if isinstance(value, Block):
632
- value = self.target.add_block(value)
633
- elif isinstance(value, list) or isinstance(value, tuple):
634
- if isinstance(value[0], Block):
635
- value = self.target.link_chain(value)
636
- return self.add_input(
637
- Input("STRETCH", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
638
-
639
- class ChangeStretchBy(Block):
640
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
641
- super().__init__(None, "looks_changestretchby", _shadow=shadow, pos=pos)
642
-
643
- def set_change(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
644
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
645
-
646
- if isinstance(value, Block):
647
- value = self.target.add_block(value)
648
- elif isinstance(value, list) or isinstance(value, tuple):
649
- if isinstance(value[0], Block):
650
- value = self.target.link_chain(value)
651
- return self.add_input(
652
- Input("CHANGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
653
-
654
-
655
- class Sounds:
656
- class Play(Block):
657
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
658
- super().__init__(None, "sound_play", _shadow=shadow, pos=pos)
659
-
660
- def set_sound_menu(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
661
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
662
-
663
- if isinstance(value, Block):
664
- value = self.target.add_block(value)
665
- elif isinstance(value, list) or isinstance(value, tuple):
666
- if isinstance(value[0], Block):
667
- value = self.target.link_chain(value)
668
- return self.add_input(
669
- Input("SOUND_MENU", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
670
-
671
- class SoundsMenu(Block):
672
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
673
- super().__init__(None, "sound_sounds_menu", _shadow=shadow, pos=pos)
674
-
675
- def set_sound_menu(self, value: str = "pop", value_id: Optional[str] = None):
676
- return self.add_field(Field("SOUND_MENU", value, value_id))
677
-
678
- class PlayUntilDone(Block):
679
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
680
- super().__init__(None, "sound_playuntildone", _shadow=shadow, pos=pos)
681
-
682
- def set_sound_menu(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
683
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
684
-
685
- if isinstance(value, Block):
686
- value = self.target.add_block(value)
687
- elif isinstance(value, list) or isinstance(value, tuple):
688
- if isinstance(value[0], Block):
689
- value = self.target.link_chain(value)
690
- return self.add_input(
691
- Input("SOUND_MENU", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
692
-
693
- class StopAllSounds(Block):
694
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
695
- super().__init__(None, "sound_stopallsounds", _shadow=shadow, pos=pos)
696
-
697
- class ChangeEffectBy(Block):
698
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
699
- super().__init__(None, "sound_changeeffectby", _shadow=shadow, pos=pos)
700
-
701
- def set_value(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
702
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
703
-
704
- if isinstance(value, Block):
705
- value = self.target.add_block(value)
706
- elif isinstance(value, list) or isinstance(value, tuple):
707
- if isinstance(value[0], Block):
708
- value = self.target.link_chain(value)
709
- return self.add_input(
710
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
711
-
712
- def set_effect(self, value: str = "PITCH", value_id: Optional[str] = None):
713
- return self.add_field(Field("EFFECT", value, value_id))
714
-
715
- class SetEffectTo(Block):
716
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
717
- super().__init__(None, "sound_seteffectto", _shadow=shadow, pos=pos)
718
-
719
- def set_value(self, value="100", input_type: str | int = "number", shadow_status: int = 1, *,
720
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
721
-
722
- if isinstance(value, Block):
723
- value = self.target.add_block(value)
724
- elif isinstance(value, list) or isinstance(value, tuple):
725
- if isinstance(value[0], Block):
726
- value = self.target.link_chain(value)
727
- return self.add_input(
728
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
729
-
730
- def set_effect(self, value: str = "PITCH", value_id: Optional[str] = None):
731
- return self.add_field(Field("EFFECT", value, value_id))
732
-
733
- class ClearEffects(Block):
734
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
735
- super().__init__(None, "sound_cleareffects", _shadow=shadow, pos=pos)
736
-
737
- class ChangeVolumeBy(Block):
738
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
739
- super().__init__(None, "sound_changevolumeby", _shadow=shadow, pos=pos)
740
-
741
- def set_volume(self, value="-10", input_type: str | int = "number", shadow_status: int = 1, *,
742
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
743
-
744
- if isinstance(value, Block):
745
- value = self.target.add_block(value)
746
- elif isinstance(value, list) or isinstance(value, tuple):
747
- if isinstance(value[0], Block):
748
- value = self.target.link_chain(value)
749
- return self.add_input(
750
- Input("VOLUME", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
751
-
752
- class SetVolumeTo(Block):
753
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
754
- super().__init__(None, "sound_setvolumeto", _shadow=shadow, pos=pos)
755
-
756
- def set_volume(self, value="100", input_type: str | int = "number", shadow_status: int = 1, *,
757
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
758
-
759
- if isinstance(value, Block):
760
- value = self.target.add_block(value)
761
- elif isinstance(value, list) or isinstance(value, tuple):
762
- if isinstance(value[0], Block):
763
- value = self.target.link_chain(value)
764
- return self.add_input(
765
- Input("VOLUME", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
766
-
767
- class Volume(Block):
768
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
769
- super().__init__(None, "sound_volume", _shadow=shadow, pos=pos)
770
-
771
-
772
- class Events:
773
- class WhenFlagClicked(Block):
774
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
775
- super().__init__(None, "event_whenflagclicked", _shadow=shadow, pos=pos)
776
-
777
- class WhenKeyPressed(Block):
778
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
779
- super().__init__(None, "event_whenkeypressed", _shadow=shadow, pos=pos)
780
-
781
- def set_key_option(self, value: str = "space", value_id: Optional[str] = None):
782
- return self.add_field(Field("KEY_OPTION", value, value_id))
783
-
784
- class WhenThisSpriteClicked(Block):
785
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
786
- super().__init__(None, "event_whenthisspriteclicked", _shadow=shadow, pos=pos)
787
-
788
- class WhenStageClicked(Block):
789
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
790
- super().__init__(None, "event_whenstageclicked", _shadow=shadow, pos=pos)
791
-
792
- class WhenBackdropSwitchesTo(Block):
793
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
794
- super().__init__(None, "event_whenbackdropswitchesto", _shadow=shadow, pos=pos)
795
-
796
- def set_backdrop(self, value: str = "backdrop1", value_id: Optional[str] = None):
797
- return self.add_field(Field("BACKDROP", value, value_id))
798
-
799
- class WhenGreaterThan(Block):
800
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
801
- super().__init__(None, "event_whengreaterthan", _shadow=shadow, pos=pos)
802
-
803
- def set_value(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
804
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
805
-
806
- if isinstance(value, Block):
807
- value = self.target.add_block(value)
808
- elif isinstance(value, list) or isinstance(value, tuple):
809
- if isinstance(value[0], Block):
810
- value = self.target.link_chain(value)
811
- return self.add_input(
812
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
813
-
814
- def set_when_greater_than_menu(self, value: str = "LOUDNESS", value_id: Optional[str] = None):
815
- return self.add_field(Field("WHENGREATERTHANMENU", value, value_id))
816
-
817
- class WhenBroadcastReceived(Block):
818
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
819
- super().__init__(None, "event_whenbroadcastreceived", _shadow=shadow, pos=pos)
820
-
821
- def set_broadcast_option(self, value="message1", value_id: str = "I didn't get an id..."):
822
- return self.add_field(Field("BROADCAST_OPTION", value, value_id))
823
-
824
- class Broadcast(Block):
825
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
826
- super().__init__(None, "event_broadcast", _shadow=shadow, pos=pos)
827
-
828
- def set_broadcast_input(self, value="message1", input_type: str | int = "broadcast", shadow_status: int = 1, *,
829
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
830
-
831
- if isinstance(value, Block):
832
- value = self.target.add_block(value)
833
- elif isinstance(value, list) or isinstance(value, tuple):
834
- if isinstance(value[0], Block):
835
- value = self.target.link_chain(value)
836
- return self.add_input(
837
- Input("BROADCAST_INPUT", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
838
-
839
- class BroadcastAndWait(Block):
840
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
841
- super().__init__(None, "event_broadcastandwait", _shadow=shadow, pos=pos)
842
-
843
- def set_broadcast_input(self, value="message1", input_type: str | int = "broadcast", shadow_status: int = 1, *,
844
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
845
-
846
- if isinstance(value, Block):
847
- value = self.target.add_block(value)
848
- elif isinstance(value, list) or isinstance(value, tuple):
849
- if isinstance(value[0], Block):
850
- value = self.target.link_chain(value)
851
- return self.add_input(
852
- Input("BROADCAST_INPUT", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
853
-
854
- class WhenTouchingObject(Block):
855
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
856
- super().__init__(None, "event_whentouchingobject", _shadow=shadow, pos=pos)
857
-
858
- def set_touching_object_menu(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
859
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
860
-
861
- if isinstance(value, Block):
862
- value = self.target.add_block(value)
863
- elif isinstance(value, list) or isinstance(value, tuple):
864
- if isinstance(value[0], Block):
865
- value = self.target.link_chain(value)
866
- return self.add_input(
867
- Input("TOUCHINGOBJECTMENU", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
868
-
869
- class TouchingObjectMenu(Block):
870
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
871
- super().__init__(None, "event_touchingobjectmenu", _shadow=shadow, pos=pos)
872
-
873
- def set_touching_object_menu(self, value: str = "_mouse_", value_id: Optional[str] = None):
874
- return self.add_field(Field("TOUCHINGOBJECTMENU", value, value_id))
875
-
876
-
877
- class Control:
878
- class Wait(Block):
879
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
880
- super().__init__(None, "control_wait", _shadow=shadow, pos=pos)
881
-
882
- def set_duration(self, value="1", input_type: str | int = "number", shadow_status: int = 1, *,
883
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
884
-
885
- if isinstance(value, Block):
886
- value = self.target.add_block(value)
887
- elif isinstance(value, list) or isinstance(value, tuple):
888
- if isinstance(value[0], Block):
889
- value = self.target.link_chain(value)
890
- return self.add_input(
891
- Input("DURATION", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
892
-
893
- class Forever(Block):
894
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
895
- super().__init__(None, "control_forever", _shadow=shadow, pos=pos, can_next=False)
896
-
897
- def set_substack(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
898
- input_id: Optional[str] = None):
899
- if isinstance(value, Block):
900
- value = self.target.add_block(value)
901
- elif isinstance(value, list) or isinstance(value, tuple):
902
- if isinstance(value[0], Block):
903
- value = self.target.link_chain(value)
904
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
905
- return self.add_input(inp)
906
-
907
- class If(Block):
908
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
909
- super().__init__(None, "control_if", _shadow=shadow, pos=pos)
910
-
911
- def set_substack(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
912
- input_id: Optional[str] = None):
913
- if isinstance(value, Block):
914
- value = self.target.add_block(value)
915
- elif isinstance(value, list) or isinstance(value, tuple):
916
- if isinstance(value[0], Block):
917
- value = self.target.link_chain(value)
918
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
919
- return self.add_input(inp)
920
-
921
- def set_condition(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
922
- input_id: Optional[str] = None):
923
- if isinstance(value, Block):
924
- value = self.target.add_block(value)
925
- elif isinstance(value, list) or isinstance(value, tuple):
926
- if isinstance(value[0], Block):
927
- value = self.target.link_chain(value)
928
- inp = Input("CONDITION", value, input_type, shadow_status, input_id=input_id)
929
- return self.add_input(inp)
930
-
931
- class IfElse(Block):
932
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
933
- super().__init__(None, "control_if_else", _shadow=shadow, pos=pos)
934
-
935
- def set_substack1(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
936
- input_id: Optional[str] = None):
937
- if isinstance(value, Block):
938
- value = self.target.add_block(value)
939
- elif isinstance(value, list) or isinstance(value, tuple):
940
- if isinstance(value[0], Block):
941
- value = self.target.link_chain(value)
942
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
943
- return self.add_input(inp)
944
-
945
- def set_substack2(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
946
- input_id: Optional[str] = None):
947
- if isinstance(value, Block):
948
- value = self.target.add_block(value)
949
- elif isinstance(value, list) or isinstance(value, tuple):
950
- if isinstance(value[0], Block):
951
- value = self.target.link_chain(value)
952
- inp = Input("SUBSTACK2", value, input_type, shadow_status, input_id=input_id)
953
- return self.add_input(inp)
954
-
955
- def set_condition(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
956
- input_id: Optional[str] = None):
957
- if isinstance(value, Block):
958
- value = self.target.add_block(value)
959
- elif isinstance(value, list) or isinstance(value, tuple):
960
- if isinstance(value[0], Block):
961
- value = self.target.link_chain(value)
962
- inp = Input("CONDITION", value, input_type, shadow_status, input_id=input_id)
963
- return self.add_input(inp)
964
-
965
- class WaitUntil(Block):
966
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
967
- super().__init__(None, "control_wait_until", _shadow=shadow, pos=pos)
968
-
969
- def set_condition(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
970
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
971
-
972
- if isinstance(value, Block):
973
- value = self.target.add_block(value)
974
- elif isinstance(value, list) or isinstance(value, tuple):
975
- if isinstance(value[0], Block):
976
- value = self.target.link_chain(value)
977
- return self.add_input(
978
- Input("CONDITION", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
979
-
980
- class RepeatUntil(Block):
981
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
982
- super().__init__(None, "control_repeat_until", _shadow=shadow, pos=pos)
983
-
984
- def set_substack(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
985
- input_id: Optional[str] = None):
986
- if isinstance(value, Block):
987
- value = self.target.add_block(value)
988
- elif isinstance(value, list) or isinstance(value, tuple):
989
- if isinstance(value[0], Block):
990
- value = self.target.link_chain(value)
991
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
992
- return self.add_input(inp)
993
-
994
- def set_condition(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
995
- input_id: Optional[str] = None):
996
- if isinstance(value, Block):
997
- value = self.target.add_block(value)
998
- elif isinstance(value, list) or isinstance(value, tuple):
999
- if isinstance(value[0], Block):
1000
- value = self.target.link_chain(value)
1001
- inp = Input("CONDITION", value, input_type, shadow_status, input_id=input_id)
1002
- return self.add_input(inp)
1003
-
1004
- class While(Block):
1005
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1006
- super().__init__(None, "control_while", _shadow=shadow, pos=pos)
1007
-
1008
- def set_substack(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
1009
- input_id: Optional[str] = None):
1010
- if isinstance(value, Block):
1011
- value = self.target.add_block(value)
1012
- elif isinstance(value, list) or isinstance(value, tuple):
1013
- if isinstance(value[0], Block):
1014
- value = self.target.link_chain(value)
1015
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
1016
- return self.add_input(inp)
1017
-
1018
- def set_condition(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
1019
- input_id: Optional[str] = None):
1020
- if isinstance(value, Block):
1021
- value = self.target.add_block(value)
1022
- elif isinstance(value, list) or isinstance(value, tuple):
1023
- if isinstance(value[0], Block):
1024
- value = self.target.link_chain(value)
1025
- inp = Input("CONDITION", value, input_type, shadow_status, input_id=input_id)
1026
- return self.add_input(inp)
1027
-
1028
- class Stop(Block):
1029
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1030
- super().__init__(None, "control_stop", _shadow=shadow, pos=pos, mutation=Mutation())
1031
-
1032
- def set_stop_option(self, value: str = "all", value_id: Optional[str] = None):
1033
- return self.add_field(Field("STOP_OPTION", value, value_id))
1034
-
1035
- def set_hasnext(self, has_next: bool = True):
1036
- self.mutation.has_next = has_next
1037
- return self
1038
-
1039
- class StartAsClone(Block):
1040
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1041
- super().__init__(None, "control_start_as_clone", _shadow=shadow, pos=pos)
1042
-
1043
- class CreateCloneOf(Block):
1044
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1045
- super().__init__(None, "control_create_clone_of", _shadow=shadow, pos=pos)
1046
-
1047
- def set_clone_option(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1048
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1049
-
1050
- if isinstance(value, Block):
1051
- value = self.target.add_block(value)
1052
- elif isinstance(value, list) or isinstance(value, tuple):
1053
- if isinstance(value[0], Block):
1054
- value = self.target.link_chain(value)
1055
- return self.add_input(
1056
- Input("CLONE_OPTION", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1057
-
1058
- class CreateCloneOfMenu(Block):
1059
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
1060
- super().__init__(None, "control_create_clone_of_menu", _shadow=shadow, pos=pos)
1061
-
1062
- def set_clone_option(self, value: str = "_myself_", value_id: Optional[str] = None):
1063
- return self.add_field(Field("CLONE_OPTION", value, value_id))
1064
-
1065
- class DeleteThisClone(Block):
1066
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1067
- super().__init__(None, "control_delete_this_clone", _shadow=shadow, pos=pos, can_next=False)
1068
-
1069
- class ForEach(Block):
1070
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1071
- super().__init__(None, "control_for_each", _shadow=shadow, pos=pos)
1072
-
1073
- def set_substack(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
1074
- input_id: Optional[str] = None):
1075
- if isinstance(value, Block):
1076
- value = self.target.add_block(value)
1077
- elif isinstance(value, list) or isinstance(value, tuple):
1078
- if isinstance(value[0], Block):
1079
- value = self.target.link_chain(value)
1080
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
1081
- return self.add_input(inp)
1082
-
1083
- def set_value(self, value="5", input_type: str | int = "positive integer", shadow_status: int = 1, *,
1084
- input_id: Optional[str] = None):
1085
- if isinstance(value, Block):
1086
- value = self.target.add_block(value)
1087
- elif isinstance(value, list) or isinstance(value, tuple):
1088
- if isinstance(value[0], Block):
1089
- value = self.target.link_chain(value)
1090
- inp = Input("VALUE", value, input_type, shadow_status, input_id=input_id)
1091
- return self.add_input(inp)
1092
-
1093
- def set_variable(self, value: str = "i", value_id: Optional[str] = None):
1094
- return self.add_field(Field("VARIABLE", value, value_id))
1095
-
1096
- class GetCounter(Block):
1097
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1098
- super().__init__(None, "control_get_counter", _shadow=shadow, pos=pos)
1099
-
1100
- class IncrCounter(Block):
1101
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1102
- super().__init__(None, "control_incr_counter", _shadow=shadow, pos=pos)
1103
-
1104
- class ClearCounter(Block):
1105
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1106
- super().__init__(None, "control_clear_counter", _shadow=shadow, pos=pos)
1107
-
1108
- class AllAtOnce(Block):
1109
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1110
- super().__init__(None, "control_all_at_once", _shadow=shadow, pos=pos)
1111
-
1112
- def set_substack(self, value, input_type: str | int = "block", shadow_status: int = 2, *,
1113
- input_id: Optional[str] = None):
1114
- if isinstance(value, Block):
1115
- value = self.target.add_block(value)
1116
- elif isinstance(value, list) or isinstance(value, tuple):
1117
- if isinstance(value[0], Block):
1118
- value = self.target.link_chain(value)
1119
- inp = Input("SUBSTACK", value, input_type, shadow_status, input_id=input_id)
1120
- return self.add_input(inp)
1121
-
1122
-
1123
- class Sensing:
1124
- class TouchingObject(Block):
1125
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1126
- super().__init__(None, "sensing_touchingobject", _shadow=shadow, pos=pos)
1127
-
1128
- def set_touching_object_menu(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1129
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1130
-
1131
- if isinstance(value, Block):
1132
- value = self.target.add_block(value)
1133
- elif isinstance(value, list) or isinstance(value, tuple):
1134
- if isinstance(value[0], Block):
1135
- value = self.target.link_chain(value)
1136
- return self.add_input(
1137
- Input("TOUCHINGOBJECTMENU", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1138
-
1139
- class TouchingObjectMenu(Block):
1140
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
1141
- super().__init__(None, "sensing_touchingobjectmenu", _shadow=shadow, pos=pos)
1142
-
1143
- def set_touching_object_menu(self, value: str = "_mouse_", value_id: Optional[str] = None):
1144
- return self.add_field(Field("TOUCHINGOBJECTMENU", value, value_id))
1145
-
1146
- class TouchingColor(Block):
1147
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1148
- super().__init__(None, "sensing_touchingcolor", _shadow=shadow, pos=pos)
1149
-
1150
- def set_color(self, value="#0000FF", input_type: str | int = "color", shadow_status: int = 1, *,
1151
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1152
-
1153
- if isinstance(value, Block):
1154
- value = self.target.add_block(value)
1155
- elif isinstance(value, list) or isinstance(value, tuple):
1156
- if isinstance(value[0], Block):
1157
- value = self.target.link_chain(value)
1158
- return self.add_input(
1159
- Input("COLOR", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1160
-
1161
- class ColorIsTouchingColor(Block):
1162
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1163
- super().__init__(None, "sensing_coloristouchingcolor", _shadow=shadow, pos=pos)
1164
-
1165
- def set_color1(self, value="#0000FF", input_type: str | int = "color", shadow_status: int = 1, *,
1166
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1167
-
1168
- if isinstance(value, Block):
1169
- value = self.target.add_block(value)
1170
- elif isinstance(value, list) or isinstance(value, tuple):
1171
- if isinstance(value[0], Block):
1172
- value = self.target.link_chain(value)
1173
- return self.add_input(
1174
- Input("COLOR", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1175
-
1176
- def set_color2(self, value="#00FF00", input_type: str | int = "color", shadow_status: int = 1, *,
1177
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1178
-
1179
- if isinstance(value, Block):
1180
- value = self.target.add_block(value)
1181
- elif isinstance(value, list) or isinstance(value, tuple):
1182
- if isinstance(value[0], Block):
1183
- value = self.target.link_chain(value)
1184
- return self.add_input(
1185
- Input("COLOR2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1186
-
1187
- class DistanceTo(Block):
1188
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1189
- super().__init__(None, "sensing_distanceto", _shadow=shadow, pos=pos)
1190
-
1191
- def set_distance_to_menu(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1192
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1193
-
1194
- if isinstance(value, Block):
1195
- value = self.target.add_block(value)
1196
- elif isinstance(value, list) or isinstance(value, tuple):
1197
- if isinstance(value[0], Block):
1198
- value = self.target.link_chain(value)
1199
- return self.add_input(
1200
- Input("DISTANCETOMENU", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1201
-
1202
- class DistanceToMenu(Block):
1203
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
1204
- super().__init__(None, "sensing_distancetomenu", _shadow=shadow, pos=pos)
1205
-
1206
- def set_distance_to_menu(self, value: str = "_mouse_", value_id: Optional[str] = None):
1207
- return self.add_field(Field("DISTANCETOMENU", value, value_id))
1208
-
1209
- class Loud(Block):
1210
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1211
- super().__init__(None, "sensing_loud", _shadow=shadow, pos=pos)
1212
-
1213
- class AskAndWait(Block):
1214
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1215
- super().__init__(None, "sensing_askandwait", _shadow=shadow, pos=pos)
1216
-
1217
- def set_question(self, value="What's your name?", input_type: str | int = "string", shadow_status: int = 1, *,
1218
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1219
-
1220
- if isinstance(value, Block):
1221
- value = self.target.add_block(value)
1222
- elif isinstance(value, list) or isinstance(value, tuple):
1223
- if isinstance(value[0], Block):
1224
- value = self.target.link_chain(value)
1225
- return self.add_input(
1226
- Input("QUESTION", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
1227
- )
1228
-
1229
- class Answer(Block):
1230
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1231
- super().__init__(None, "sensing_answer", _shadow=shadow, pos=pos)
1232
-
1233
- class KeyPressed(Block):
1234
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1235
- super().__init__(None, "sensing_keypressed", _shadow=shadow, pos=pos)
1236
-
1237
- def set_key_option(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1238
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1239
-
1240
- if isinstance(value, Block):
1241
- value = self.target.add_block(value)
1242
- elif isinstance(value, list) or isinstance(value, tuple):
1243
- if isinstance(value[0], Block):
1244
- value = self.target.link_chain(value)
1245
- return self.add_input(
1246
- Input("KEY_OPTION", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1247
-
1248
- class KeyOptions(Block):
1249
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
1250
- super().__init__(None, "sensing_keyoptions", _shadow=shadow, pos=pos)
1251
-
1252
- def set_key_option(self, value: str = "space", value_id: Optional[str] = None):
1253
- return self.add_field(Field("KEY_OPTION", value, value_id))
1254
-
1255
- class MouseDown(Block):
1256
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1257
- super().__init__(None, "sensing_mousedown", _shadow=shadow, pos=pos)
1258
-
1259
- class MouseX(Block):
1260
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1261
- super().__init__(None, "sensing_mousex", _shadow=shadow, pos=pos)
1262
-
1263
- class MouseY(Block):
1264
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1265
- super().__init__(None, "sensing_mousey", _shadow=shadow, pos=pos)
1266
-
1267
- class SetDragMode(Block):
1268
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1269
- super().__init__(None, "sensing_setdragmode", _shadow=shadow, pos=pos)
1270
-
1271
- def set_drag_mode(self, value: str = "draggable", value_id: Optional[str] = None):
1272
- return self.add_field(Field("DRAG_MODE", value, value_id))
1273
-
1274
- class Loudness(Block):
1275
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1276
- super().__init__(None, "sensing_loudness", _shadow=shadow, pos=pos)
1277
-
1278
- class Timer(Block):
1279
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1280
- super().__init__(None, "sensing_timer", _shadow=shadow, pos=pos)
1281
-
1282
- class ResetTimer(Block):
1283
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1284
- super().__init__(None, "sensing_resettimer", _shadow=shadow, pos=pos)
1285
-
1286
- class Of(Block):
1287
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1288
- super().__init__(None, "sensing_of", _shadow=shadow, pos=pos)
1289
-
1290
- def set_object(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1291
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1292
-
1293
- if isinstance(value, Block):
1294
- value = self.target.add_block(value)
1295
- elif isinstance(value, list) or isinstance(value, tuple):
1296
- if isinstance(value[0], Block):
1297
- value = self.target.link_chain(value)
1298
- return self.add_input(
1299
- Input("OBJECT", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1300
-
1301
- def set_property(self, value: str = "backdrop #", value_id: Optional[str] = None):
1302
- return self.add_field(Field("PROPERTY", value, value_id))
1303
-
1304
- class OfObjectMenu(Block):
1305
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
1306
- super().__init__(None, "sensing_of_object_menu", _shadow=shadow, pos=pos)
1307
-
1308
- def set_object(self, value: str = "_stage_", value_id: Optional[str] = None):
1309
- return self.add_field(Field("OBJECT", value, value_id))
1310
-
1311
- class Current(Block):
1312
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1313
- super().__init__(None, "sensing_current", _shadow=shadow, pos=pos)
1314
-
1315
- def set_current_menu(self, value: str = "YEAR", value_id: Optional[str] = None):
1316
- return self.add_field(Field("CURRENTMENU", value, value_id))
1317
-
1318
- class DaysSince2000(Block):
1319
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1320
- super().__init__(None, "sensing_dayssince2000", _shadow=shadow, pos=pos)
1321
-
1322
- class Username(Block):
1323
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1324
- super().__init__(None, "sensing_username", _shadow=shadow, pos=pos)
1325
-
1326
- class UserID(Block):
1327
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1328
- super().__init__(None, "sensing_userid", _shadow=shadow, pos=pos)
1329
-
1330
-
1331
- class Operators:
1332
- class Add(Block):
1333
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1334
- super().__init__(None, "operator_add", _shadow=shadow, pos=pos)
1335
-
1336
- def set_num1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1337
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1338
-
1339
- if isinstance(value, Block):
1340
- value = self.target.add_block(value)
1341
- elif isinstance(value, list) or isinstance(value, tuple):
1342
- if isinstance(value[0], Block):
1343
- value = self.target.link_chain(value)
1344
- return self.add_input(
1345
- Input("NUM1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1346
-
1347
- def set_num2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1348
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1349
-
1350
- if isinstance(value, Block):
1351
- value = self.target.add_block(value)
1352
- elif isinstance(value, list) or isinstance(value, tuple):
1353
- if isinstance(value[0], Block):
1354
- value = self.target.link_chain(value)
1355
- return self.add_input(
1356
- Input("NUM2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1357
-
1358
- class Subtract(Block):
1359
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1360
- super().__init__(None, "operator_subtract", _shadow=shadow, pos=pos)
1361
-
1362
- def set_num1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1363
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1364
-
1365
- if isinstance(value, Block):
1366
- value = self.target.add_block(value)
1367
- elif isinstance(value, list) or isinstance(value, tuple):
1368
- if isinstance(value[0], Block):
1369
- value = self.target.link_chain(value)
1370
- return self.add_input(
1371
- Input("NUM1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1372
-
1373
- def set_num2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1374
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1375
-
1376
- if isinstance(value, Block):
1377
- value = self.target.add_block(value)
1378
- elif isinstance(value, list) or isinstance(value, tuple):
1379
- if isinstance(value[0], Block):
1380
- value = self.target.link_chain(value)
1381
- return self.add_input(
1382
- Input("NUM2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1383
-
1384
- class Multiply(Block):
1385
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1386
- super().__init__(None, "operator_multiply", _shadow=shadow, pos=pos)
1387
-
1388
- def set_num1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1389
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1390
-
1391
- if isinstance(value, Block):
1392
- value = self.target.add_block(value)
1393
- elif isinstance(value, list) or isinstance(value, tuple):
1394
- if isinstance(value[0], Block):
1395
- value = self.target.link_chain(value)
1396
- return self.add_input(
1397
- Input("NUM1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1398
-
1399
- def set_num2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1400
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1401
-
1402
- if isinstance(value, Block):
1403
- value = self.target.add_block(value)
1404
- elif isinstance(value, list) or isinstance(value, tuple):
1405
- if isinstance(value[0], Block):
1406
- value = self.target.link_chain(value)
1407
- return self.add_input(
1408
- Input("NUM2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1409
-
1410
- class Divide(Block):
1411
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1412
- super().__init__(None, "operator_divide", _shadow=shadow, pos=pos)
1413
-
1414
- def set_num1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1415
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1416
-
1417
- if isinstance(value, Block):
1418
- value = self.target.add_block(value)
1419
- elif isinstance(value, list) or isinstance(value, tuple):
1420
- if isinstance(value[0], Block):
1421
- value = self.target.link_chain(value)
1422
- return self.add_input(
1423
- Input("NUM1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1424
-
1425
- def set_num2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1426
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1427
-
1428
- if isinstance(value, Block):
1429
- value = self.target.add_block(value)
1430
- elif isinstance(value, list) or isinstance(value, tuple):
1431
- if isinstance(value[0], Block):
1432
- value = self.target.link_chain(value)
1433
- return self.add_input(
1434
- Input("NUM2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1435
-
1436
- class Random(Block):
1437
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1438
- super().__init__(None, "operator_random", _shadow=shadow, pos=pos)
1439
-
1440
- def set_from(self, value="1", input_type: str | int = "number", shadow_status: int = 1, *,
1441
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1442
-
1443
- if isinstance(value, Block):
1444
- value = self.target.add_block(value)
1445
- elif isinstance(value, list) or isinstance(value, tuple):
1446
- if isinstance(value[0], Block):
1447
- value = self.target.link_chain(value)
1448
- return self.add_input(
1449
- Input("FROM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1450
-
1451
- def set_to(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
1452
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1453
-
1454
- if isinstance(value, Block):
1455
- value = self.target.add_block(value)
1456
- elif isinstance(value, list) or isinstance(value, tuple):
1457
- if isinstance(value[0], Block):
1458
- value = self.target.link_chain(value)
1459
- return self.add_input(
1460
- Input("TO", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1461
-
1462
- class GT(Block):
1463
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1464
- super().__init__(None, "operator_gt", _shadow=shadow, pos=pos)
1465
-
1466
- def set_operand1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1467
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1468
-
1469
- if isinstance(value, Block):
1470
- value = self.target.add_block(value)
1471
- elif isinstance(value, list) or isinstance(value, tuple):
1472
- if isinstance(value[0], Block):
1473
- value = self.target.link_chain(value)
1474
- return self.add_input(
1475
- Input("OPERAND1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1476
-
1477
- def set_operand2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1478
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1479
-
1480
- if isinstance(value, Block):
1481
- value = self.target.add_block(value)
1482
- elif isinstance(value, list) or isinstance(value, tuple):
1483
- if isinstance(value[0], Block):
1484
- value = self.target.link_chain(value)
1485
- return self.add_input(
1486
- Input("OPERAND2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1487
-
1488
- class LT(Block):
1489
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1490
- super().__init__(None, "operator_lt", _shadow=shadow, pos=pos)
1491
-
1492
- def set_operand1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1493
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1494
-
1495
- if isinstance(value, Block):
1496
- value = self.target.add_block(value)
1497
- elif isinstance(value, list) or isinstance(value, tuple):
1498
- if isinstance(value[0], Block):
1499
- value = self.target.link_chain(value)
1500
- return self.add_input(
1501
- Input("OPERAND1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1502
-
1503
- def set_operand2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1504
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1505
-
1506
- if isinstance(value, Block):
1507
- value = self.target.add_block(value)
1508
- elif isinstance(value, list) or isinstance(value, tuple):
1509
- if isinstance(value[0], Block):
1510
- value = self.target.link_chain(value)
1511
- return self.add_input(
1512
- Input("OPERAND2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1513
-
1514
- class Equals(Block):
1515
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1516
- super().__init__(None, "operator_equals", _shadow=shadow, pos=pos)
1517
-
1518
- def set_operand1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1519
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1520
-
1521
- if isinstance(value, Block):
1522
- value = self.target.add_block(value)
1523
- elif isinstance(value, list) or isinstance(value, tuple):
1524
- if isinstance(value[0], Block):
1525
- value = self.target.link_chain(value)
1526
- return self.add_input(
1527
- Input("OPERAND1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1528
-
1529
- def set_operand2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1530
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1531
-
1532
- if isinstance(value, Block):
1533
- value = self.target.add_block(value)
1534
- elif isinstance(value, list) or isinstance(value, tuple):
1535
- if isinstance(value[0], Block):
1536
- value = self.target.link_chain(value)
1537
- return self.add_input(
1538
- Input("OPERAND2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1539
-
1540
- class And(Block):
1541
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1542
- super().__init__(None, "operator_and", _shadow=shadow, pos=pos)
1543
-
1544
- def set_operand1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1545
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1546
-
1547
- if isinstance(value, Block):
1548
- value = self.target.add_block(value)
1549
- elif isinstance(value, list) or isinstance(value, tuple):
1550
- if isinstance(value[0], Block):
1551
- value = self.target.link_chain(value)
1552
- return self.add_input(
1553
- Input("OPERAND1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1554
-
1555
- def set_operand2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1556
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1557
-
1558
- if isinstance(value, Block):
1559
- value = self.target.add_block(value)
1560
- elif isinstance(value, list) or isinstance(value, tuple):
1561
- if isinstance(value[0], Block):
1562
- value = self.target.link_chain(value)
1563
- return self.add_input(
1564
- Input("OPERAND2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1565
-
1566
- class Or(Block):
1567
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1568
- super().__init__(None, "operator_or", _shadow=shadow, pos=pos)
1569
-
1570
- def set_operand1(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1571
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1572
-
1573
- if isinstance(value, Block):
1574
- value = self.target.add_block(value)
1575
- elif isinstance(value, list) or isinstance(value, tuple):
1576
- if isinstance(value[0], Block):
1577
- value = self.target.link_chain(value)
1578
- return self.add_input(
1579
- Input("OPERAND1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1580
-
1581
- def set_operand2(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1582
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1583
-
1584
- if isinstance(value, Block):
1585
- value = self.target.add_block(value)
1586
- elif isinstance(value, list) or isinstance(value, tuple):
1587
- if isinstance(value[0], Block):
1588
- value = self.target.link_chain(value)
1589
- return self.add_input(
1590
- Input("OPERAND2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1591
-
1592
- class Not(Block):
1593
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1594
- super().__init__(None, "operator_not", _shadow=shadow, pos=pos)
1595
-
1596
- def set_operand(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
1597
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1598
-
1599
- if isinstance(value, Block):
1600
- value = self.target.add_block(value)
1601
- elif isinstance(value, list) or isinstance(value, tuple):
1602
- if isinstance(value[0], Block):
1603
- value = self.target.link_chain(value)
1604
- return self.add_input(
1605
- Input("OPERAND", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1606
-
1607
- class Join(Block):
1608
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1609
- super().__init__(None, "operator_join", _shadow=shadow, pos=pos)
1610
-
1611
- def set_string1(self, value="apple ", input_type: str | int = "string", shadow_status: int = 1, *,
1612
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1613
-
1614
- if isinstance(value, Block):
1615
- value = self.target.add_block(value)
1616
- elif isinstance(value, list) or isinstance(value, tuple):
1617
- if isinstance(value[0], Block):
1618
- value = self.target.link_chain(value)
1619
- return self.add_input(
1620
- Input("STRING1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1621
-
1622
- def set_string2(self, value="banana", input_type: str | int = "string", shadow_status: int = 1, *,
1623
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1624
-
1625
- if isinstance(value, Block):
1626
- value = self.target.add_block(value)
1627
- elif isinstance(value, list) or isinstance(value, tuple):
1628
- if isinstance(value[0], Block):
1629
- value = self.target.link_chain(value)
1630
- return self.add_input(
1631
- Input("STRING2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1632
-
1633
- class LetterOf(Block):
1634
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1635
- super().__init__(None, "operator_letter_of", _shadow=shadow, pos=pos)
1636
-
1637
- def set_letter(self, value="1", input_type: str | int = "positive integer", shadow_status: int = 1, *,
1638
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1639
-
1640
- if isinstance(value, Block):
1641
- value = self.target.add_block(value)
1642
- elif isinstance(value, list) or isinstance(value, tuple):
1643
- if isinstance(value[0], Block):
1644
- value = self.target.link_chain(value)
1645
- return self.add_input(
1646
- Input("LETTER", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1647
-
1648
- def set_string(self, value="apple", input_type: str | int = "string", shadow_status: int = 1, *,
1649
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1650
-
1651
- if isinstance(value, Block):
1652
- value = self.target.add_block(value)
1653
- elif isinstance(value, list) or isinstance(value, tuple):
1654
- if isinstance(value[0], Block):
1655
- value = self.target.link_chain(value)
1656
- return self.add_input(
1657
- Input("STRING", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1658
-
1659
- class Length(Block):
1660
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1661
- super().__init__(None, "operator_length", _shadow=shadow, pos=pos)
1662
-
1663
- def set_string(self, value="apple", input_type: str | int = "string", shadow_status: int = 1, *,
1664
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1665
-
1666
- if isinstance(value, Block):
1667
- value = self.target.add_block(value)
1668
- elif isinstance(value, list) or isinstance(value, tuple):
1669
- if isinstance(value[0], Block):
1670
- value = self.target.link_chain(value)
1671
- return self.add_input(
1672
- Input("STRING", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1673
-
1674
- class Contains(Block):
1675
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1676
- super().__init__(None, "operator_contains", _shadow=shadow, pos=pos)
1677
-
1678
- def set_string1(self, value="apple", input_type: str | int = "string", shadow_status: int = 1, *,
1679
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1680
-
1681
- if isinstance(value, Block):
1682
- value = self.target.add_block(value)
1683
- elif isinstance(value, list) or isinstance(value, tuple):
1684
- if isinstance(value[0], Block):
1685
- value = self.target.link_chain(value)
1686
- return self.add_input(
1687
- Input("STRING1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1688
-
1689
- def set_string2(self, value="a", input_type: str | int = "string", shadow_status: int = 1, *,
1690
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1691
-
1692
- if isinstance(value, Block):
1693
- value = self.target.add_block(value)
1694
- elif isinstance(value, list) or isinstance(value, tuple):
1695
- if isinstance(value[0], Block):
1696
- value = self.target.link_chain(value)
1697
- return self.add_input(
1698
- Input("STRING2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1699
-
1700
- class Mod(Block):
1701
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1702
- super().__init__(None, "operator_mod", _shadow=shadow, pos=pos)
1703
-
1704
- def set_num1(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1705
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1706
-
1707
- if isinstance(value, Block):
1708
- value = self.target.add_block(value)
1709
- elif isinstance(value, list) or isinstance(value, tuple):
1710
- if isinstance(value[0], Block):
1711
- value = self.target.link_chain(value)
1712
- return self.add_input(
1713
- Input("NUM1", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1714
-
1715
- def set_num2(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1716
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1717
-
1718
- if isinstance(value, Block):
1719
- value = self.target.add_block(value)
1720
- elif isinstance(value, list) or isinstance(value, tuple):
1721
- if isinstance(value[0], Block):
1722
- value = self.target.link_chain(value)
1723
- return self.add_input(
1724
- Input("NUM2", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1725
-
1726
- class Round(Block):
1727
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1728
- super().__init__(None, "operator_round", _shadow=shadow, pos=pos)
1729
-
1730
- def set_num(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1731
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1732
-
1733
- if isinstance(value, Block):
1734
- value = self.target.add_block(value)
1735
- elif isinstance(value, list) or isinstance(value, tuple):
1736
- if isinstance(value[0], Block):
1737
- value = self.target.link_chain(value)
1738
- return self.add_input(
1739
- Input("NUM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1740
-
1741
- class MathOp(Block):
1742
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1743
- super().__init__(None, "operator_mathop", _shadow=shadow, pos=pos)
1744
-
1745
- def set_num(self, value='', input_type: str | int = "number", shadow_status: int = 1, *,
1746
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1747
-
1748
- if isinstance(value, Block):
1749
- value = self.target.add_block(value)
1750
- elif isinstance(value, list) or isinstance(value, tuple):
1751
- if isinstance(value[0], Block):
1752
- value = self.target.link_chain(value)
1753
- return self.add_input(
1754
- Input("NUM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1755
-
1756
- def set_operator(self, value: str = "abs", value_id: Optional[str] = None):
1757
- return self.add_field(Field("OPERATOR", value, value_id))
1758
-
1759
-
1760
- class Data:
1761
- class VariableArr(Block):
1762
- def __init__(self, value, input_type: str | int = "variable", shadow_status: Optional[int] = None, *,
1763
- pos: tuple[int | float, int | float] = (0, 0)):
1764
- if isinstance(value, Block):
1765
- value = self.target.add_block(value)
1766
- elif isinstance(value, list) or isinstance(value, tuple):
1767
- if isinstance(value[0], Block):
1768
- value = self.target.link_chain(value)
1769
- inp = Input(None, value, input_type, shadow_status)
1770
- if inp.type_str == "block":
1771
- arr = inp.json[0]
1772
- else:
1773
- arr = inp.json[1][-1]
1774
-
1775
- super().__init__(array=arr, pos=pos)
1776
-
1777
- class Variable(Block):
1778
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1779
- super().__init__(None, "data_variable", _shadow=shadow, pos=pos)
1780
-
1781
- def set_variable(self, value: str | Variable = "variable", value_id: Optional[str] = None):
1782
- return self.add_field(Field("VARIABLE", value, value_id))
1783
-
1784
- class SetVariableTo(Block):
1785
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1786
- super().__init__(None, "data_setvariableto", _shadow=shadow, pos=pos)
1787
-
1788
- def set_value(self, value="0", input_type: str | int = "string", shadow_status: int = 1, *,
1789
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1790
-
1791
- if isinstance(value, Block):
1792
- value = self.target.add_block(value)
1793
- elif isinstance(value, list) or isinstance(value, tuple):
1794
- if isinstance(value[0], Block):
1795
- value = self.target.link_chain(value)
1796
- return self.add_input(
1797
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1798
-
1799
- def set_variable(self, value: str | Variable = "variable", value_id: Optional[str] = None):
1800
- return self.add_field(Field("VARIABLE", value, value_id))
1801
-
1802
- class ChangeVariableBy(Block):
1803
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1804
- super().__init__(None, "data_changevariableby", _shadow=shadow, pos=pos)
1805
-
1806
- def set_value(self, value="1", input_type: str | int = "number", shadow_status: int = 1, *,
1807
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1808
-
1809
- if isinstance(value, Block):
1810
- value = self.target.add_block(value)
1811
- elif isinstance(value, list) or isinstance(value, tuple):
1812
- if isinstance(value[0], Block):
1813
- value = self.target.link_chain(value)
1814
- return self.add_input(
1815
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1816
-
1817
- def set_variable(self, value: str | Variable = "variable", value_id: Optional[str] = None):
1818
- return self.add_field(Field("VARIABLE", value, value_id))
1819
-
1820
- class ShowVariable(Block):
1821
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1822
- super().__init__(None, "data_showvariable", _shadow=shadow, pos=pos)
1823
-
1824
- def set_variable(self, value: str | Variable = "variable", value_id: Optional[str] = None):
1825
- return self.add_field(Field("VARIABLE", value, value_id))
1826
-
1827
- class HideVariable(Block):
1828
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1829
- super().__init__(None, "data_hidevariable", _shadow=shadow, pos=pos)
1830
-
1831
- def set_variable(self, value: str | Variable = "variable", value_id: Optional[str] = None):
1832
- return self.add_field(Field("VARIABLE", value, value_id))
1833
-
1834
- class ListArr(Block):
1835
- def __init__(self, value, input_type: str | int = "list", shadow_status: Optional[int] = None, *,
1836
- pos: tuple[int | float, int | float] = (0, 0)):
1837
- inp = Input(None, value, input_type, shadow_status)
1838
- if inp.type_str == "block":
1839
- arr = inp.json[0]
1840
- else:
1841
- arr = inp.json[1][-1]
1842
-
1843
- super().__init__(array=arr, pos=pos)
1844
-
1845
- class ListContents(Block):
1846
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1847
- super().__init__(None, "data_listcontents", _shadow=shadow, pos=pos)
1848
-
1849
- def set_list(self, value: str | List = "my list", value_id: Optional[str] = None):
1850
- return self.add_field(Field("LIST", value, value_id))
1851
-
1852
- class AddToList(Block):
1853
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1854
- super().__init__(None, "data_addtolist", _shadow=shadow, pos=pos)
1855
-
1856
- def set_item(self, value="thing", input_type: str | int = "string", shadow_status: int = 1, *,
1857
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1858
-
1859
- if isinstance(value, Block):
1860
- value = self.target.add_block(value)
1861
- elif isinstance(value, list) or isinstance(value, tuple):
1862
- if isinstance(value[0], Block):
1863
- value = self.target.link_chain(value)
1864
- return self.add_input(
1865
- Input("ITEM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1866
-
1867
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1868
- return self.add_field(Field("LIST", value, value_id))
1869
-
1870
- class DeleteOfList(Block):
1871
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1872
- super().__init__(None, "data_deleteoflist", _shadow=shadow, pos=pos)
1873
-
1874
- def set_index(self, value="random", input_type: str | int = "positive integer", shadow_status: int = 1, *,
1875
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1876
-
1877
- if isinstance(value, Block):
1878
- value = self.target.add_block(value)
1879
- elif isinstance(value, list) or isinstance(value, tuple):
1880
- if isinstance(value[0], Block):
1881
- value = self.target.link_chain(value)
1882
- return self.add_input(
1883
- Input("INDEX", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1884
-
1885
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1886
- return self.add_field(Field("LIST", value, value_id))
1887
-
1888
- class InsertAtList(Block):
1889
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1890
- super().__init__(None, "data_insertatlist", _shadow=shadow, pos=pos)
1891
-
1892
- def set_item(self, value="thing", input_type: str | int = "string", shadow_status: int = 1, *,
1893
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1894
-
1895
- if isinstance(value, Block):
1896
- value = self.target.add_block(value)
1897
- elif isinstance(value, list) or isinstance(value, tuple):
1898
- if isinstance(value[0], Block):
1899
- value = self.target.link_chain(value)
1900
- return self.add_input(
1901
- Input("ITEM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1902
-
1903
- def set_index(self, value="random", input_type: str | int = "positive integer", shadow_status: int = 1, *,
1904
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1905
-
1906
- if isinstance(value, Block):
1907
- value = self.target.add_block(value)
1908
- elif isinstance(value, list) or isinstance(value, tuple):
1909
- if isinstance(value[0], Block):
1910
- value = self.target.link_chain(value)
1911
- return self.add_input(
1912
- Input("INDEX", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1913
-
1914
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1915
- return self.add_field(Field("LIST", value, value_id))
1916
-
1917
- class DeleteAllOfList(Block):
1918
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1919
- super().__init__(None, "data_deletealloflist", _shadow=shadow, pos=pos)
1920
-
1921
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1922
- return self.add_field(Field("LIST", value, value_id))
1923
-
1924
- class ReplaceItemOfList(Block):
1925
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1926
- super().__init__(None, "data_replaceitemoflist", _shadow=shadow, pos=pos)
1927
-
1928
- def set_item(self, value="thing", input_type: str | int = "string", shadow_status: int = 1, *,
1929
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1930
-
1931
- if isinstance(value, Block):
1932
- value = self.target.add_block(value)
1933
- elif isinstance(value, list) or isinstance(value, tuple):
1934
- if isinstance(value[0], Block):
1935
- value = self.target.link_chain(value)
1936
- return self.add_input(
1937
- Input("ITEM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1938
-
1939
- def set_index(self, value="random", input_type: str | int = "positive integer", shadow_status: int = 1, *,
1940
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1941
-
1942
- if isinstance(value, Block):
1943
- value = self.target.add_block(value)
1944
- elif isinstance(value, list) or isinstance(value, tuple):
1945
- if isinstance(value[0], Block):
1946
- value = self.target.link_chain(value)
1947
- return self.add_input(
1948
- Input("INDEX", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1949
-
1950
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1951
- return self.add_field(Field("LIST", value, value_id))
1952
-
1953
- class ItemOfList(Block):
1954
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1955
- super().__init__(None, "data_itemoflist", _shadow=shadow, pos=pos)
1956
-
1957
- def set_index(self, value="random", input_type: str | int = "positive integer", shadow_status: int = 1, *,
1958
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1959
-
1960
- if isinstance(value, Block):
1961
- value = self.target.add_block(value)
1962
- elif isinstance(value, list) or isinstance(value, tuple):
1963
- if isinstance(value[0], Block):
1964
- value = self.target.link_chain(value)
1965
- return self.add_input(
1966
- Input("INDEX", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1967
-
1968
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1969
- return self.add_field(Field("LIST", value, value_id))
1970
-
1971
- class ItemNumOfList(Block):
1972
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1973
- super().__init__(None, "data_itemnumoflist", _shadow=shadow, pos=pos)
1974
-
1975
- def set_item(self, value="thing", input_type: str | int = "string", shadow_status: int = 1, *,
1976
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
1977
-
1978
- if isinstance(value, Block):
1979
- value = self.target.add_block(value)
1980
- elif isinstance(value, list) or isinstance(value, tuple):
1981
- if isinstance(value[0], Block):
1982
- value = self.target.link_chain(value)
1983
- return self.add_input(
1984
- Input("ITEM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
1985
-
1986
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1987
- return self.add_field(Field("LIST", value, value_id))
1988
-
1989
- class LengthOfList(Block):
1990
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1991
- super().__init__(None, "data_lengthoflist", _shadow=shadow, pos=pos)
1992
-
1993
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
1994
- return self.add_field(Field("LIST", value, value_id))
1995
-
1996
- class ListContainsItem(Block):
1997
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
1998
- super().__init__(None, "data_listcontainsitem", _shadow=shadow, pos=pos)
1999
-
2000
- def set_item(self, value="thing", input_type: str | int = "string", shadow_status: int = 1, *,
2001
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2002
-
2003
- if isinstance(value, Block):
2004
- value = self.target.add_block(value)
2005
- elif isinstance(value, list) or isinstance(value, tuple):
2006
- if isinstance(value[0], Block):
2007
- value = self.target.link_chain(value)
2008
- return self.add_input(
2009
- Input("ITEM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2010
-
2011
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
2012
- return self.add_field(Field("LIST", value, value_id))
2013
-
2014
- class ShowList(Block):
2015
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2016
- super().__init__(None, "data_showlist", _shadow=shadow, pos=pos)
2017
-
2018
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
2019
- return self.add_field(Field("LIST", value, value_id))
2020
-
2021
- class HideList(Block):
2022
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2023
- super().__init__(None, "data_hidelist", _shadow=shadow, pos=pos)
2024
-
2025
- def set_list(self, value: str | List = "list", value_id: Optional[str] = None):
2026
- return self.add_field(Field("LIST", value, value_id))
2027
-
2028
- class ListIndexAll(Block):
2029
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2030
- super().__init__(None, "data_listindexall", _shadow=shadow, pos=pos)
2031
-
2032
- class ListIndexRandom(Block):
2033
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2034
- super().__init__(None, "data_listindexrandom", _shadow=shadow, pos=pos)
2035
-
2036
-
2037
- class Proc:
2038
- class Definition(Block):
2039
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2040
- super().__init__(None, "procedures_definition", _shadow=shadow, pos=pos)
2041
-
2042
- def set_custom_block(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2043
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2044
-
2045
- if isinstance(value, Block):
2046
- value = self.target.add_block(value)
2047
- elif isinstance(value, list) or isinstance(value, tuple):
2048
- if isinstance(value[0], Block):
2049
- value = self.target.link_chain(value)
2050
- return self.add_input(
2051
- Input("custom_block", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2052
-
2053
- class Call(Block):
2054
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2055
- super().__init__(None, "procedures_call", _shadow=shadow, pos=pos, mutation=Mutation())
2056
-
2057
- def set_proc_code(self, proc_code: str = ''):
2058
- self.mutation.proc_code = proc_code
2059
- return self
2060
-
2061
- def set_argument_ids(self, *argument_ids: list[str]):
2062
- self.mutation.argument_ids = argument_ids
2063
- return self
2064
-
2065
- def set_warp(self, warp: bool = True):
2066
- self.mutation.warp = warp
2067
- return self
2068
-
2069
- def set_arg(self, arg, value='', input_type: str | int = "string", shadow_status: int = 1, *,
2070
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2071
-
2072
- if isinstance(value, Block):
2073
- value = self.target.add_block(value)
2074
- elif isinstance(value, list) or isinstance(value, tuple):
2075
- if isinstance(value[0], Block):
2076
- value = self.target.link_chain(value)
2077
- return self.add_input(
2078
- Input(arg, value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2079
-
2080
- class Declaration(Block):
2081
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2082
- super().__init__(None, "procedures_declaration", _shadow=shadow, pos=pos, mutation=Mutation())
2083
-
2084
- def set_proc_code(self, proc_code: str = ''):
2085
- self.mutation.proc_code = proc_code
2086
- return self
2087
-
2088
- class Prototype(Block):
2089
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2090
- super().__init__(None, "procedures_prototype", _shadow=shadow, pos=pos, mutation=Mutation())
2091
-
2092
- def set_proc_code(self, proc_code: str = ''):
2093
- self.mutation.proc_code = proc_code
2094
- return self
2095
-
2096
- def set_argument_ids(self, *argument_ids: list[str]):
2097
- self.mutation.argument_ids = argument_ids
2098
- return self
2099
-
2100
- def set_argument_names(self, *argument_names: list[str]):
2101
- self.mutation.argument_names = list(argument_names)
2102
- return self
2103
-
2104
- def set_argument_defaults(self, *argument_defaults: list[str]):
2105
- self.mutation.argument_defaults = argument_defaults
2106
- return self
2107
-
2108
- def set_warp(self, warp: bool = True):
2109
- self.mutation.warp = warp
2110
- return self
2111
-
2112
- def set_arg(self, arg, value, input_type: str | int = "block", shadow_status: int = 1, *,
2113
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2114
-
2115
- if isinstance(value, Block):
2116
- value = self.target.add_block(value)
2117
- elif isinstance(value, list) or isinstance(value, tuple):
2118
- if isinstance(value[0], Block):
2119
- value = self.target.link_chain(value)
2120
- return self.add_input(
2121
- Input(arg, value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2122
-
2123
-
2124
- class Args:
2125
- class EditorBoolean(Block):
2126
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2127
- super().__init__(None, "argument_editor_boolean", _shadow=shadow, pos=pos, mutation=Mutation())
2128
-
2129
- def set_text(self, value: str = "foo", value_id: Optional[str] = None):
2130
- return self.add_field(Field("TEXT", value, value_id))
2131
-
2132
- class EditorStringNumber(Block):
2133
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2134
- super().__init__(None, "argument_editor_string_number", _shadow=shadow, pos=pos, mutation=Mutation())
2135
-
2136
- def set_text(self, value: str = "foo", value_id: Optional[str] = None):
2137
- return self.add_field(Field("TEXT", value, value_id))
2138
-
2139
- class ReporterBoolean(Block):
2140
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2141
- super().__init__(None, "argument_reporter_boolean", _shadow=shadow, pos=pos, mutation=Mutation())
2142
-
2143
- def set_value(self, value: str = "boolean", value_id: Optional[str] = None):
2144
- return self.add_field(Field("VALUE", value, value_id))
2145
-
2146
- class ReporterStringNumber(Block):
2147
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2148
- super().__init__(None, "argument_reporter_string_number", _shadow=shadow, pos=pos, mutation=Mutation())
2149
-
2150
- def set_value(self, value: str = "boolean", value_id: Optional[str] = None):
2151
- return self.add_field(Field("VALUE", value, value_id))
2152
-
2153
-
2154
- class Addons:
2155
- class IsTurbowarp(Args.ReporterBoolean):
2156
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2157
- super().__init__(_shadow=shadow, pos=pos)
2158
- self.set_value("is turbowarp?")
2159
-
2160
- class IsCompiled(Args.ReporterBoolean):
2161
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2162
- super().__init__(_shadow=shadow, pos=pos)
2163
- self.set_value("is compiled?")
2164
-
2165
- class IsForkphorus(Args.ReporterBoolean):
2166
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2167
- super().__init__(_shadow=shadow, pos=pos)
2168
- self.set_value("is forkphorus?")
2169
-
2170
- class Breakpoint(Proc.Call):
2171
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2172
- super().__init__(_shadow=shadow, pos=pos)
2173
- self.set_proc_code("​​breakpoint​​")
2174
-
2175
- class Log(Proc.Call):
2176
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2177
- super().__init__(_shadow=shadow, pos=pos)
2178
- self.set_proc_code("​​log​​ %s")
2179
- self.set_argument_ids("arg0")
2180
-
2181
- def set_message(self, value='', input_type: str | int = "string", shadow_status: int = 1, *,
2182
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2183
- return self.set_arg("arg0", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
2184
-
2185
- class Warn(Proc.Call):
2186
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2187
- super().__init__(_shadow=shadow, pos=pos)
2188
- self.set_proc_code("​​warn​​ %s")
2189
- self.set_argument_ids("arg0")
2190
-
2191
- def set_message(self, value='', input_type: str | int = "string", shadow_status: int = 1, *,
2192
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2193
- return self.set_arg("arg0", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
2194
-
2195
- class Error(Proc.Call):
2196
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2197
- super().__init__(_shadow=shadow, pos=pos)
2198
- self.set_proc_code("​​error​​ %s")
2199
- self.set_argument_ids("arg0")
2200
-
2201
- def set_message(self, value='', input_type: str | int = "string", shadow_status: int = 1, *,
2202
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2203
- return self.set_arg("arg0", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer)
2204
-
2205
-
2206
- class Pen:
2207
- class Clear(Block):
2208
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2209
- super().__init__(None, "pen_clear", _shadow=shadow, pos=pos)
2210
-
2211
- class Stamp(Block):
2212
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2213
- super().__init__(None, "pen_stamp", _shadow=shadow, pos=pos)
2214
-
2215
- class PenDown(Block):
2216
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2217
- super().__init__(None, "pen_penDown", _shadow=shadow, pos=pos)
2218
-
2219
- class PenUp(Block):
2220
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2221
- super().__init__(None, "pen_penUp", _shadow=shadow, pos=pos)
2222
-
2223
- class SetPenColorToColor(Block):
2224
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2225
- super().__init__(None, "pen_setPenColorToColor", _shadow=shadow, pos=pos)
2226
-
2227
- def set_color(self, value="#FF0000", input_type: str | int = "color", shadow_status: int = 1, *,
2228
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2229
-
2230
- if isinstance(value, Block):
2231
- value = self.target.add_block(value)
2232
- elif isinstance(value, list) or isinstance(value, tuple):
2233
- if isinstance(value[0], Block):
2234
- value = self.target.link_chain(value)
2235
- return self.add_input(
2236
- Input("COLOR", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2237
-
2238
- class ChangePenParamBy(Block):
2239
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2240
- super().__init__(None, "pen_changePenColorParamBy", _shadow=shadow, pos=pos)
2241
-
2242
- def set_param(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2243
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2244
-
2245
- if isinstance(value, Block):
2246
- value = self.target.add_block(value)
2247
- elif isinstance(value, list) or isinstance(value, tuple):
2248
- if isinstance(value[0], Block):
2249
- value = self.target.link_chain(value)
2250
- return self.add_input(
2251
- Input("COLOR_PARAM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2252
-
2253
- def set_value(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
2254
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2255
-
2256
- if isinstance(value, Block):
2257
- value = self.target.add_block(value)
2258
- elif isinstance(value, list) or isinstance(value, tuple):
2259
- if isinstance(value[0], Block):
2260
- value = self.target.link_chain(value)
2261
- return self.add_input(
2262
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2263
-
2264
- class SetPenParamTo(Block):
2265
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2266
- super().__init__(None, "pen_setPenColorParamTo", _shadow=shadow, pos=pos)
2267
-
2268
- def set_param(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2269
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2270
-
2271
- if isinstance(value, Block):
2272
- value = self.target.add_block(value)
2273
- elif isinstance(value, list) or isinstance(value, tuple):
2274
- if isinstance(value[0], Block):
2275
- value = self.target.link_chain(value)
2276
- return self.add_input(
2277
- Input("COLOR_PARAM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2278
-
2279
- def set_value(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
2280
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2281
-
2282
- if isinstance(value, Block):
2283
- value = self.target.add_block(value)
2284
- elif isinstance(value, list) or isinstance(value, tuple):
2285
- if isinstance(value[0], Block):
2286
- value = self.target.link_chain(value)
2287
- return self.add_input(
2288
- Input("VALUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2289
-
2290
- class ChangePenSizeBy(Block):
2291
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2292
- super().__init__(None, "pen_changePenSizeBy", _shadow=shadow, pos=pos)
2293
-
2294
- def set_size(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2295
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2296
-
2297
- if isinstance(value, Block):
2298
- value = self.target.add_block(value)
2299
- elif isinstance(value, list) or isinstance(value, tuple):
2300
- if isinstance(value[0], Block):
2301
- value = self.target.link_chain(value)
2302
- return self.add_input(
2303
- Input("SIZE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2304
-
2305
- class SetPenSizeTo(Block):
2306
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2307
- super().__init__(None, "pen_setPenSizeTo", _shadow=shadow, pos=pos)
2308
-
2309
- def set_size(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2310
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2311
-
2312
- if isinstance(value, Block):
2313
- value = self.target.add_block(value)
2314
- elif isinstance(value, list) or isinstance(value, tuple):
2315
- if isinstance(value[0], Block):
2316
- value = self.target.link_chain(value)
2317
- return self.add_input(
2318
- Input("SIZE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2319
-
2320
- class SetPenHueTo(Block):
2321
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2322
- super().__init__(None, "pen_setPenHueToNumber", _shadow=shadow, pos=pos)
2323
-
2324
- def set_hue(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2325
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2326
-
2327
- if isinstance(value, Block):
2328
- value = self.target.add_block(value)
2329
- elif isinstance(value, list) or isinstance(value, tuple):
2330
- if isinstance(value[0], Block):
2331
- value = self.target.link_chain(value)
2332
- return self.add_input(
2333
- Input("HUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2334
-
2335
- class ChangePenHueBy(Block):
2336
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2337
- super().__init__(None, "pen_changePenHueBy", _shadow=shadow, pos=pos)
2338
-
2339
- def set_hue(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2340
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2341
-
2342
- if isinstance(value, Block):
2343
- value = self.target.add_block(value)
2344
- elif isinstance(value, list) or isinstance(value, tuple):
2345
- if isinstance(value[0], Block):
2346
- value = self.target.link_chain(value)
2347
- return self.add_input(
2348
- Input("HUE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2349
-
2350
- class SetPenShadeTo(Block):
2351
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2352
- super().__init__(None, "pen_setPenShadeToNumber", _shadow=shadow, pos=pos)
2353
-
2354
- def set_shade(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2355
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2356
-
2357
- if isinstance(value, Block):
2358
- value = self.target.add_block(value)
2359
- elif isinstance(value, list) or isinstance(value, tuple):
2360
- if isinstance(value[0], Block):
2361
- value = self.target.link_chain(value)
2362
- return self.add_input(
2363
- Input("SHADE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2364
-
2365
- class ChangePenShadeBy(Block):
2366
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2367
- super().__init__(None, "pen_changePenShadeBy", _shadow=shadow, pos=pos)
2368
-
2369
- def set_shade(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2370
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2371
-
2372
- if isinstance(value, Block):
2373
- value = self.target.add_block(value)
2374
- elif isinstance(value, list) or isinstance(value, tuple):
2375
- if isinstance(value[0], Block):
2376
- value = self.target.link_chain(value)
2377
- return self.add_input(
2378
- Input("SHADE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2379
-
2380
- class ColorParamMenu(Block):
2381
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2382
- super().__init__(None, "pen_menu_colorParam", _shadow=shadow, pos=pos)
2383
-
2384
- def set_color_param(self, value: str = "color", value_id: Optional[str] = None):
2385
- return self.add_field(Field("colorParam", value, value_id))
2386
-
2387
-
2388
- class Music:
2389
- class PlayDrumForBeats(Block):
2390
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2391
- super().__init__(None, "music_playDrumForBeats", _shadow=shadow, pos=pos)
2392
-
2393
- def set_drum(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2394
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2395
-
2396
- if isinstance(value, Block):
2397
- value = self.target.add_block(value)
2398
- elif isinstance(value, list) or isinstance(value, tuple):
2399
- if isinstance(value[0], Block):
2400
- value = self.target.link_chain(value)
2401
- return self.add_input(
2402
- Input("DRUM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2403
-
2404
- def set_beats(self, value="0.25", input_type: str | int = "positive number", shadow_status: int = 1, *,
2405
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2406
-
2407
- if isinstance(value, Block):
2408
- value = self.target.add_block(value)
2409
- elif isinstance(value, list) or isinstance(value, tuple):
2410
- if isinstance(value[0], Block):
2411
- value = self.target.link_chain(value)
2412
- return self.add_input(
2413
- Input("BEATS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2414
-
2415
- class PlayNoteForBeats(Block):
2416
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2417
- super().__init__(None, "music_playDrumForBeats", _shadow=shadow, pos=pos)
2418
-
2419
- def set_note(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2420
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2421
-
2422
- if isinstance(value, Block):
2423
- value = self.target.add_block(value)
2424
- elif isinstance(value, list) or isinstance(value, tuple):
2425
- if isinstance(value[0], Block):
2426
- value = self.target.link_chain(value)
2427
- return self.add_input(
2428
- Input("NOTE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2429
-
2430
- def set_beats(self, value="0.25", input_type: str | int = "positive number", shadow_status: int = 1, *,
2431
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2432
-
2433
- if isinstance(value, Block):
2434
- value = self.target.add_block(value)
2435
- elif isinstance(value, list) or isinstance(value, tuple):
2436
- if isinstance(value[0], Block):
2437
- value = self.target.link_chain(value)
2438
- return self.add_input(
2439
- Input("BEATS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2440
-
2441
- class RestForBeats(Block):
2442
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2443
- super().__init__(None, "music_restForBeats", _shadow=shadow, pos=pos)
2444
-
2445
- def set_beats(self, value="0.25", input_type: str | int = "positive number", shadow_status: int = 1, *,
2446
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2447
-
2448
- if isinstance(value, Block):
2449
- value = self.target.add_block(value)
2450
- elif isinstance(value, list) or isinstance(value, tuple):
2451
- if isinstance(value[0], Block):
2452
- value = self.target.link_chain(value)
2453
- return self.add_input(
2454
- Input("BEATS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2455
-
2456
- class SetTempo(Block):
2457
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2458
- super().__init__(None, "music_setTempo", _shadow=shadow, pos=pos)
2459
-
2460
- def set_beats(self, value="60", input_type: str | int = "positive number", shadow_status: int = 1, *,
2461
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2462
-
2463
- if isinstance(value, Block):
2464
- value = self.target.add_block(value)
2465
- elif isinstance(value, list) or isinstance(value, tuple):
2466
- if isinstance(value[0], Block):
2467
- value = self.target.link_chain(value)
2468
- return self.add_input(
2469
- Input("TEMPO", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2470
-
2471
- class ChangeTempo(Block):
2472
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2473
- super().__init__(None, "music_changeTempo", _shadow=shadow, pos=pos)
2474
-
2475
- def set_beats(self, value="60", input_type: str | int = "positive number", shadow_status: int = 1, *,
2476
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2477
-
2478
- if isinstance(value, Block):
2479
- value = self.target.add_block(value)
2480
- elif isinstance(value, list) or isinstance(value, tuple):
2481
- if isinstance(value[0], Block):
2482
- value = self.target.link_chain(value)
2483
- return self.add_input(
2484
- Input("TEMPO", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2485
-
2486
- class GetTempo(Block):
2487
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2488
- super().__init__(None, "music_getTempo", _shadow=shadow, pos=pos)
2489
-
2490
- class SetInstrument(Block):
2491
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2492
- super().__init__(None, "music_setInstrument", _shadow=shadow, pos=pos)
2493
-
2494
- def set_instrument(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2495
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2496
-
2497
- if isinstance(value, Block):
2498
- value = self.target.add_block(value)
2499
- elif isinstance(value, list) or isinstance(value, tuple):
2500
- if isinstance(value[0], Block):
2501
- value = self.target.link_chain(value)
2502
- return self.add_input(
2503
- Input("INSTRUMENT", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2504
-
2505
- class MidiPlayDrumForBeats(Block):
2506
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2507
- super().__init__(None, "music_midiPlayDrumForBeats", _shadow=shadow, pos=pos)
2508
-
2509
- def set_drum(self, value="123", input_type: str | int = "positive integer", shadow_status: int = 1, *,
2510
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2511
-
2512
- if isinstance(value, Block):
2513
- value = self.target.add_block(value)
2514
- elif isinstance(value, list) or isinstance(value, tuple):
2515
- if isinstance(value[0], Block):
2516
- value = self.target.link_chain(value)
2517
- return self.add_input(
2518
- Input("DRUM", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2519
-
2520
- def set_beats(self, value="1", input_type: str | int = "positive number", shadow_status: int = 1, *,
2521
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2522
-
2523
- if isinstance(value, Block):
2524
- value = self.target.add_block(value)
2525
- elif isinstance(value, list) or isinstance(value, tuple):
2526
- if isinstance(value[0], Block):
2527
- value = self.target.link_chain(value)
2528
- return self.add_input(
2529
- Input("BEATS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2530
-
2531
- class MidiSetInstrument(Block):
2532
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2533
- super().__init__(None, "music_midiSetInstrument", _shadow=shadow, pos=pos)
2534
-
2535
- def set_instrument(self, value="6", input_type: str | int = "positive integer", shadow_status: int = 1, *,
2536
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2537
-
2538
- if isinstance(value, Block):
2539
- value = self.target.add_block(value)
2540
- elif isinstance(value, list) or isinstance(value, tuple):
2541
- if isinstance(value[0], Block):
2542
- value = self.target.link_chain(value)
2543
- return self.add_input(
2544
- Input("INSTRUMENT", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2545
-
2546
- class MenuDrum(Block):
2547
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2548
- super().__init__(None, "music_menu_DRUM", _shadow=shadow, pos=pos)
2549
-
2550
- def set_drum(self, value: str = "1", value_id: Optional[str] = None):
2551
- return self.add_field(Field("DRUM", value, value_id))
2552
-
2553
- class MenuInstrument(Block):
2554
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2555
- super().__init__(None, "music_menu_INSTRUMENT", _shadow=shadow, pos=pos)
2556
-
2557
- def set_instrument(self, value: str = "1", value_id: Optional[str] = None):
2558
- return self.add_field(Field("INSTRUMENT", value, value_id))
2559
-
2560
-
2561
- class VideoSensing:
2562
- class WhenMotionGreaterThan(Block):
2563
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2564
- super().__init__(None, "videoSensing_whenMotionGreaterThan", _shadow=shadow, pos=pos)
2565
-
2566
- def set_reference(self, value="10", input_type: str | int = "number", shadow_status: int = 1, *,
2567
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2568
-
2569
- if isinstance(value, Block):
2570
- value = self.target.add_block(value)
2571
- elif isinstance(value, list) or isinstance(value, tuple):
2572
- if isinstance(value[0], Block):
2573
- value = self.target.link_chain(value)
2574
- return self.add_input(
2575
- Input("REFERENCE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2576
-
2577
- class VideoOn(Block):
2578
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2579
- super().__init__(None, "videoSensing_videoOn", _shadow=shadow, pos=pos)
2580
-
2581
- def set_attribute(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2582
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2583
-
2584
- if isinstance(value, Block):
2585
- value = self.target.add_block(value)
2586
- elif isinstance(value, list) or isinstance(value, tuple):
2587
- if isinstance(value[0], Block):
2588
- value = self.target.link_chain(value)
2589
- return self.add_input(
2590
- Input("ATTRIBUTE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2591
-
2592
- def set_subject(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2593
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2594
-
2595
- if isinstance(value, Block):
2596
- value = self.target.add_block(value)
2597
- elif isinstance(value, list) or isinstance(value, tuple):
2598
- if isinstance(value[0], Block):
2599
- value = self.target.link_chain(value)
2600
- return self.add_input(
2601
- Input("SUBJECT", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2602
-
2603
- class MenuAttribute(Block):
2604
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2605
- super().__init__(None, "videoSensing_menu_ATTRIBUTE", _shadow=shadow, pos=pos)
2606
-
2607
- def set_attribute(self, value: str = "motion", value_id: Optional[str] = None):
2608
- return self.add_field(Field("ATTRIBUTE", value, value_id))
2609
-
2610
- class MenuSubject(Block):
2611
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2612
- super().__init__(None, "videoSensing_menu_SUBJECT", _shadow=shadow, pos=pos)
2613
-
2614
- def set_subject(self, value: str = "this sprite", value_id: Optional[str] = None):
2615
- return self.add_field(Field("SUBJECT", value, value_id))
2616
-
2617
- class VideoToggle(Block):
2618
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2619
- super().__init__(None, "videoSensing_videoToggle", _shadow=shadow, pos=pos)
2620
-
2621
- def set_video_state(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2622
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2623
-
2624
- if isinstance(value, Block):
2625
- value = self.target.add_block(value)
2626
- elif isinstance(value, list) or isinstance(value, tuple):
2627
- if isinstance(value[0], Block):
2628
- value = self.target.link_chain(value)
2629
- return self.add_input(
2630
- Input("VIDEO_STATE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2631
-
2632
- class MenuVideoState(Block):
2633
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2634
- super().__init__(None, "videoSensing_menu_VIDEO_STATE", _shadow=shadow, pos=pos)
2635
-
2636
- def set_video_state(self, value: str = "on", value_id: Optional[str] = None):
2637
- return self.add_field(Field("VIDEO_STATE", value, value_id))
2638
-
2639
- class SetVideoTransparency(Block):
2640
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2641
- super().__init__(None, "videoSensing_setVideoTransparency", _shadow=shadow, pos=pos)
2642
-
2643
- def set_transparency(self, value: str = "50", input_type: str | int = "number", shadow_status: int = 1, *,
2644
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2645
-
2646
- if isinstance(value, Block):
2647
- value = self.target.add_block(value)
2648
- elif isinstance(value, list) or isinstance(value, tuple):
2649
- if isinstance(value[0], Block):
2650
- value = self.target.link_chain(value)
2651
- return self.add_input(
2652
- Input("TRANSPARENCY", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2653
-
2654
-
2655
- class Text2Speech:
2656
- class SpeakAndWait(Block):
2657
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2658
- super().__init__(None, "text2speech_speakAndWait", _shadow=shadow, pos=pos)
2659
-
2660
- def set_words(self, value: str = "50", input_type: str | int = "number", shadow_status: int = 1, *,
2661
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2662
-
2663
- if isinstance(value, Block):
2664
- value = self.target.add_block(value)
2665
- elif isinstance(value, list) or isinstance(value, tuple):
2666
- if isinstance(value[0], Block):
2667
- value = self.target.link_chain(value)
2668
- return self.add_input(
2669
- Input("WORDS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2670
-
2671
- class SetVoice(Block):
2672
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2673
- super().__init__(None, "text2speech_setVoice", _shadow=shadow, pos=pos)
2674
-
2675
- def set_voice(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2676
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2677
-
2678
- if isinstance(value, Block):
2679
- value = self.target.add_block(value)
2680
- elif isinstance(value, list) or isinstance(value, tuple):
2681
- if isinstance(value[0], Block):
2682
- value = self.target.link_chain(value)
2683
- return self.add_input(
2684
- Input("VOICE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2685
-
2686
- class MenuVoices(Block):
2687
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2688
- super().__init__(None, "text2speech_menu_voices", _shadow=shadow, pos=pos)
2689
-
2690
- def set_voices(self, value: str = "ALTO", value_id: Optional[str] = None):
2691
- return self.add_field(Field("voices", value, value_id))
2692
-
2693
- class SetLanguage(Block):
2694
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2695
- super().__init__(None, "text2speech_setLanguage", _shadow=shadow, pos=pos)
2696
-
2697
- def set_language(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2698
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2699
-
2700
- if isinstance(value, Block):
2701
- value = self.target.add_block(value)
2702
- elif isinstance(value, list) or isinstance(value, tuple):
2703
- if isinstance(value[0], Block):
2704
- value = self.target.link_chain(value)
2705
- return self.add_input(
2706
- Input("LANGUAGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2707
-
2708
- class MenuLanguages(Block):
2709
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2710
- super().__init__(None, "text2speech_menu_languages", _shadow=shadow, pos=pos)
2711
-
2712
- def set_languages(self, value: str = "en", value_id: Optional[str] = None):
2713
- return self.add_field(Field("languages", value, value_id))
2714
-
2715
-
2716
- class Translate:
2717
- class GetTranslate(Block):
2718
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2719
- super().__init__(None, "translate_getTranslate", _shadow=shadow, pos=pos)
2720
-
2721
- def set_words(self, value="hello!", input_type: str | int = "string", shadow_status: int = 1, *,
2722
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2723
-
2724
- if isinstance(value, Block):
2725
- value = self.target.add_block(value)
2726
- elif isinstance(value, list) or isinstance(value, tuple):
2727
- if isinstance(value[0], Block):
2728
- value = self.target.link_chain(value)
2729
- return self.add_input(
2730
- Input("WORDS", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2731
-
2732
- def set_language(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2733
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2734
-
2735
- if isinstance(value, Block):
2736
- value = self.target.add_block(value)
2737
- elif isinstance(value, list) or isinstance(value, tuple):
2738
- if isinstance(value[0], Block):
2739
- value = self.target.link_chain(value)
2740
- return self.add_input(
2741
- Input("LANGUAGE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2742
-
2743
- class MenuLanguages(Block):
2744
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2745
- super().__init__(None, "translate_menu_languages", _shadow=shadow, pos=pos)
2746
-
2747
- def set_languages(self, value: str = "sv", value_id: Optional[str] = None):
2748
- return self.add_field(Field("languages", value, value_id))
2749
-
2750
- class GetViewerLanguage(Block):
2751
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2752
- super().__init__(None, "translate_getViewerLanguage", _shadow=shadow, pos=pos)
2753
-
2754
-
2755
- class MakeyMakey:
2756
- class WhenMakeyKeyPressed(Block):
2757
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2758
- super().__init__(None, "makeymakey_whenMakeyKeyPressed", _shadow=shadow, pos=pos)
2759
-
2760
- def set_key(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2761
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2762
-
2763
- if isinstance(value, Block):
2764
- value = self.target.add_block(value)
2765
- elif isinstance(value, list) or isinstance(value, tuple):
2766
- if isinstance(value[0], Block):
2767
- value = self.target.link_chain(value)
2768
- return self.add_input(
2769
- Input("KEY", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2770
-
2771
- class MenuKey(Block):
2772
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2773
- super().__init__(None, "makeymakey_menu_KEY", _shadow=shadow, pos=pos)
2774
-
2775
- def set_key(self, value: str = "SPACE", value_id: Optional[str] = None):
2776
- return self.add_field(Field("KEY", value, value_id))
2777
-
2778
- class WhenCodePressed(Block):
2779
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2780
- super().__init__(None, "makeymakey_whenCodePressed", _shadow=shadow, pos=pos)
2781
-
2782
- def set_sequence(self, value, input_type: str | int = "block", shadow_status: int = 1, *,
2783
- input_id: Optional[str] = None, obscurer: Optional[str | Block] = None):
2784
-
2785
- if isinstance(value, Block):
2786
- value = self.target.add_block(value)
2787
- elif isinstance(value, list) or isinstance(value, tuple):
2788
- if isinstance(value[0], Block):
2789
- value = self.target.link_chain(value)
2790
- return self.add_input(
2791
- Input("SEQUENCE", value, input_type, shadow_status, input_id=input_id, obscurer=obscurer))
2792
-
2793
- class MenuSequence(Block):
2794
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2795
- super().__init__(None, "makeymakey_menu_SEQUENCE", _shadow=shadow, pos=pos)
2796
-
2797
- def set_key(self, value: str = "LEFT UP RIGHT", value_id: Optional[str] = None):
2798
- return self.add_field(Field("SEQUENCE", value, value_id))
2799
-
2800
-
2801
- class CoreExample:
2802
- class ExampleOpcode(Block):
2803
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2804
- super().__init__(None, "coreExample_exampleOpcode", _shadow=shadow, pos=pos)
2805
-
2806
- class ExampleWithInlineImage(Block):
2807
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2808
- super().__init__(None, "coreExample_exampleWithInlineImage", _shadow=shadow, pos=pos)
2809
-
2810
-
2811
- class OtherBlocks:
2812
- class Note(Block):
2813
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2814
- super().__init__(None, "note", _shadow=shadow, pos=pos)
2815
-
2816
- def set_note(self, value: str = "60", value_id: Optional[str] = None):
2817
- return self.add_field(Field("NOTE", value, value_id))
2818
-
2819
- class Matrix(Block):
2820
- def __init__(self, *, shadow: bool = True, pos: tuple[int | float, int | float] = (0, 0)):
2821
- super().__init__(None, "matrix", _shadow=shadow, pos=pos)
2822
-
2823
- def set_note(self, value: str = "0101010101100010101000100", value_id: Optional[str] = None):
2824
- return self.add_field(Field("MATRIX", value, value_id))
2825
-
2826
- class RedHatBlock(Block):
2827
- def __init__(self, *, shadow: bool = False, pos: tuple[int | float, int | float] = (0, 0)):
2828
- # Note: There is no single opcode for the red hat block as the block is simply the result of an error
2829
- # The opcode here has been set to 'redhatblock' to make it obvious what is going on
2830
-
2831
- # (It's not called red_hat_block because then TurboWarp thinks that it's supposed to find an extension
2832
- # called red)
2833
-
2834
- # Appendix: You **CAN** actually add comments to this block, however it will make the block misbehave in the
2835
- # editor. The link between the comment and the block will not be visible, but will be visible with the
2836
- # corresponding TurboWarp addon
2837
- super().__init__(None, "redhatblock", _shadow=shadow, pos=pos, can_next=False)