(Redirected from Turbo Mode Detection)

Detecting Turbo Mode can be done with a simple script:

when green flag clicked
reset timer
repeat (10)
  switch backdrop to [please wait v]
if <(timer) > [0.1]> then
  switch backdrop to [please use turbo mode v]
  stop [all v]//or run some other code
switch backdrop to [Turbo mode detected! v]

In turbo mode, the action of switching to the same background 10 times will take less than 0.1 seconds, but off it will take longer. If turbo mode is not on, the project will stop.

when gf clicked
set [Counter v] to (0)
reset timer
repeat until <(timer) > [1]>
  change [Counter v] by (1)
If <(Counter) > [100]> then
  switch backdrop to [Turbo Mode detected! v]//or your Turbo Mode code.
  switch backdrop to [Normal Mode v]//or your Normal Mode code.

This script is a little different. Turbo speed will greatly speed up the repeat until C Block and the counter variable value will be very high.

Single Stepping

Archive.png This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective.

In Scratch 1.4, single stepping could be detected with the following script:

when green flag clicked
reset timer
switch backdrop to [Please wait v] // This block is required!
if <(timer) > [0.1]> then
  switch backdrop to [Single stepping detected v]
  switch backdrop to [Single stepping off v]

The "switch to background" block can also be replaced with other blocks, such as "wait (0) seconds" if desired. Its purpose is to delay the script. If a script is single stepping, that block will take over 0.1 seconds to run, thus entering the "if" block.