From Test-Scratch-Wiki

Translate: - English - 中文 
The correct title of this article is When () > () (block). The change of name is due to technical restrictions.
When () > ()
2.0 When () is Greater Than ().png
Category Event
Type Hat
Introduced in 2.0

When () > () block is an Events Block and a Hat Block. It starts the script below it when a value (chosen by the dropdown menu) is greater than another value (entered by the number input). The available options are loudness, timer, and video motion.

Values

Loudness

Main article: Loudness (value)

The loudness in the drop-down menu represents the volume of the sound that the computer microphone is picking up. The highest value is 100, and the lowest value is 1. Once the loudness is higher than the chosen amount, the script will begin to run.

Timer

Main article: Timer (value)

The timer variable is default on Scratch and constantly running, and it can be reset. It counts up from 0. Once the timer's value is greater than the chosen time, the script will run.

Example Uses

This block can be used for many things, such as:

  • Saying something when voice is entered
when [loudness v] > (10)
say [Be quiet!] for (2) secs
  • Being motion activated
when [video motion v] > (10)
broadcast [start v]
  • Starting something after a delay
when [timer v] > (10)
broadcast [end game v]

Workaround

Main article: List of Block Workarounds

Using a Wait Until in conjunction with the Greater Than or the Less Than blocks can create a workaround for this block.

forever
wait until <(loudness) > (20)>
. . .
wait until <not <(loudness) > (20)>>

Unceasing Timer Exploit

This event block has been occasionally used to create projects that can not be stopped. The following blocks can not be stopped by pressing the red stop sign once the project has started.

when [timer v] > (0)
reset timer
forever
reset timer
. . .
end

This method can be used to simulate a When Stop Clicked block.

See Also