when green flag clicked reset timer repeat (10) switch to background [please wait v] end if <(timer) > [0.1]> then switch to background [please use turbo mode v] stop [all v]//or run some other code end switch to background [Turbo mode detected! v]
when gf clicked set [Counter v] to (0) reset timer repeat until <(timer) > > change [Counter v] by (1) end If <(Counter) > > then switch to background [Turbo speed detected! v] Else Switch to background [Normal speed v] End
In Scratch 1.4, single stepping could be detected with the following script:
when green flag clicked reset timer switch to background [Please wait v] // This block is required! if <(timer) > [0.1]> then switch to background [Single stepping detected v] else switch to background [Single stepping off v] end
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.