usedBlock(opcode)
Benutzt diesen Block: opcode
Check whether a type of blocktype was used at all.
Param | Type | Description |
opcode |
string |
Blocktype |
returns boolean
– true if blocktype was executed.
usedLoops()
Benutzt Schleifen.
Checks if any loop block was used.
returns boolean
– True if any loop block ran.
usedNoLoops()
Benutzt keine Schleifen.
Checks if no loop block was used.
returns boolean
– True if no loop block ran.
usedConditions()
Benutzt Verzweigungen.
Checks if any conditional block was used.
returns boolean
– True if conditions ran.
usedNoConditions()
Benutzt keine Verzweigungen.
Checks if any conditional block was used.
returns boolean
– True if no conditions ran.
usedSounds()
Benutzt Soundblöcke.
Checks if any sound-related blocks were used.
returns boolean
– True if sound blocks ran.
usedNoSounds()
Benutzt keine Soundblöcke.
Checks if no sound-related blocks were used.
returns boolean
– True if sound blocks ran.
usedCustomBlocks()
Benutzt eigene Blöcke.
Checks if any custom block (procedure) was used.
returns boolean
– True if any custom blocks ran.
usedNoCustomBlocks()
Benutzt keine eigenen Blöcke.
Checks if any custom block (procedure) was used.
returns boolean
– True if any custom blocks ran.
usedVariable(variable_name)
Benutzt diese Variable: variable_name.
Checks if a specific variable was used.
Param | Type | Description |
variable_name |
string |
|
returns boolean
– True if any variable was used.
endsWithVariable(variable_name, expected_value)
Endwert der Variable "variable_name" ist: expected_value
Checks whether the given variable ends with the expected value.
Param | Type | Description |
variable_name |
string |
Variable name. |
expected_value |
* |
Expected final value. |
returns boolean|null
– True if matched, false if not, null if not found.
changedPosition(sprite)
Figur sprite bewegt sich.
Determines if the given sprite moved.
Param | Type | Description |
sprite |
string |
|
returns boolean
– true if sprite moved.
endsAtPosition(sprite, x, y, tolerance = 0)
sprite endet an Ort (x, y) (± tolerance)
Checks whether a sprite ends at a specific position.
Param | Type | Description |
sprite |
string |
Sprite name or ID. |
x |
number |
Expected X coordinate. |
y |
number |
Expected Y coordinate. |
[tolerance=0] |
number |
Optional tolerance. |
returns boolean|null
– True if matched, false if not, null if not found.
wasAtPosition(sprite, x, y, tolerance = 0)
sprite war bei Ort (x, y) (± tolerance)
Checks if a sprite was ever at a specific position (within tolerance).
Param | Type | Description |
sprite |
string |
sprite name or ID. |
x |
number |
X position. |
y |
number |
Y position. |
[tolerance=0] |
number |
Optional tolerance value. |
returns boolean
–
endsFacingDirection(sprite, direction)
sprite endet in Richtung: direction.
Checks if a sprite ends facing a specific direction.
Param | Type | Description |
sprite |
string |
Sprite name or ID. |
direction |
number |
Expected final direction. |
returns boolean|null
–
wasFacingDirection(sprite, direction)
sprite hatte die Richtung: direction.
Checks if a sprite was ever facing a specific direction.
Param | Type | Description |
sprite |
string |
Sprite name or ID. |
direction |
number |
Direction to check for in history. |
returns boolean
–
usedCostumeChanges()
Benutzt Kostümwechsel.
Checks if any costume-changing blocks were used.
returns boolean
– True if any costume blocks ran.
usedNoCostumeChanges()
Benutzt keine Kostümwechsel.
Checks if no costume-changing blocks were used.
returns boolean
– True if no costume blocks ran.
changedCostumeTo(sprite, costumeName)
sprite wechelte das Kostüm zu: costumeName
Checks if a sprite switched to a specific costume.
Param | Type | Description |
sprite |
string |
sprite name or ID. |
costumeName |
string |
Name of the costume. |
returns boolean
– True if costume was switched to.
endsOnCostume(sprite, costumeName)
sprite endet mit Kostüm: costumeName
Checks if a sprite ends on a specific costume.
Param | Type | Description |
sprite |
string |
Sprite name or ID. |
costumeName |
string |
The expected final costume name. |
returns boolean|null
– True if matches, false if not, null if sprite not found.
wasCostume(sprite, costumeName)
sprite hatte irgendwann das Kostüm: costumeName
Checks if a sprite was ever set to a specific costume.
Param | Type | Description |
sprite |
string |
sprite name or ID. |
costumeName |
string |
Name of the costume. |
returns boolean
– True if the costume was ever used.
usedBackdropChanges()
Benutzt Bühnenwechsel.
Checks if any stage-changing blocks were used.
returns boolean
– True if any costume blocks ran.
usedNoBackdropChanges()
Benutzt keine Bühnenwechsel.
Checks if no backdrop-changing blocks were used.
returns boolean
– True if no backdrop blocks ran.
wasBackdrop(backdrop_name)
Hatte irgendwann die Bühne: backdrop_name
NOT YET WORKING
Checks if a specific backdrop was ever shown during execution.
Param | Type | Description |
backdrop_name |
string |
The name of the backdrop to check for. |
returns boolean
– True if the backdrop was ever set.
endsOnBackdrop(backdrop_name)
Endet mit Bühne: backdrop_name
Checks if the project ends on a specific backdrop.
Param | Type | Description |
backdrop_name |
string |
The expected final backdrop name. |
returns boolean|null
– True if matches, false if not, null if not found.
endsVisible(sprite)
sprite endet sichtbar.
Checks if a sprite ends up visible.
Param | Type | Description |
sprite |
string |
Sprite name or ID. |
returns boolean|null
– True if visible, false if hidden, null if sprite not found.
endsHidden(sprite)
sprite endet versteckt.
Checks if a sprite ends up hidden.
Param | Type | Description |
sprite |
string |
Sprite name or ID. |
returns boolean|null
– True if hidden, false if visible, null if sprite not found.
broadcasted(message)
Sendet diese Nachricht: message.
Checks if a given message was broadcast.
Param | Type | Description |
message name of the broadcast message |
string |
|
returns boolean
– True if the message was broadcast.
lastBroadcasted(msg)
Sendet als letzte Nachricht: message.
Checks if the last broadcast message matches a specific value.
Param | Type | Description |
msg |
string |
Message to check. |
returns boolean
–
countBlocks(opcode)
Anzahl ausgeführter "opcode"-Blöcke
Counts how many times one or more blocktypes were executed (including loops).
- string: counts that opcode.
- array of strings: sums executions for all listed opcodes.
- omitted: returns the total number of executed blocks.
Param | Type | Description |
[opcode] |
string|string[]|undefined |
The block opcode(s) to count. |
returns number
– The number of matched executed blocks.
countUniqueBlocks()
Anzahl verschiedener Blöcke
Counts the number of unique blocks (by blockID) executed.
returns number
– Amount of unique blocks executed
secondsElapsed()
Laufzeit in Sekunden
Returns the elapsed program time in seconds.
returns number|null
– Duration in seconds, or null if timing info is missing.
efficiency()
Effizienzfaktor
Calculates block efficiency: total executed blocks over unique blocks.
returns number
– Reuse factor (1 = every block gets executed only once)
Opcopes: