CoderQC Scratch Extension

What the blocks do in the extension

Extension not working? Try again later!

Blocks and Reporters

Public IP Address

Returns your IP Address on the internet. Uses ipify to get the address. If you want to obfuscate this, use a VPN.

OS Information

Returns your user agent which can identify your browser and your OS.

Time

Returns the time in hh:mm:ss format. Useful for making a custom OS in Scratch.

Temporary Variable

A temporary variable. Set it by setting the tempvar variable in the Execute JS Code. You can use this communicate between Scratch and JS.

Screen [width v]

Returns information about your screen. The taskbar width and height are calculated by subtracting the available screen space from the total screen resolution.

Fetch from (URL)

Fetches a URL and returns the result. It follows CORS rules though meaning you cannot fetch from most sites.

Get value of () in dictionary ({})

Returns a value from the provided JSON input.

Set value of () to () in dictionary ({})

Returns an edited JSON input with the appropriate key being changed.

Send data (DATA) as of user (USER) to the server (URL)

A special way to do a formdata POST message. Use to send and store data on your own PHP servers. Returns true or false based on server response. (Server code example will come eventually)

(5)% of (50)

Calculates percentage of total. Formerly, broken math was involved but this fixed now. For compatibility reasons, the old math is used in a different block.

(5)% of (50) * 4

Horribly calculates percentage of total. The only reason this block exists is to keep compatibility with other projects.

(5) ^ (2)

Lets you do equations involving exponents. Scratch originally only supported 10^.

Optimize number (number)

Saves RAM by turning the number into a string.

color/matrix/direction/note ()

Returns a color, matrix (5x5 grid), direction or note value from the input.

[null v]

Returns null or undefined depending on the option selected.

<> or <> but not both

The same as an XOR Logic Gate, but in Scratch. XOR is the same as OR + NAND (Not AND) gate.

<() is all uppercase?>

Returns true if all letters in the input are uppercase. If there is a letter that is lowercase, the block will return false.

() == ()

Basically the equals sign but case must match. Same as a strict equal sign.

() ~ ()

Approximately equals function recreated in Scratch. Scale is less than one so 3 is not approx. to 4 but 3 is approx. to 3.99.

Execute JS Code (console.log("I'm here!"))

Executes JavaScript Code in the extension sandbox. Each block runs in it's own sandbox.

Play sound from URL (URL)

Plays audio from a URL. Only works if media autoplay is enabled for turbowarp.org. Sound unloads when it stops playing.

Stop sound at index (1)

Stops audio started from the Play sound from the URL block. The index number is the sound to stop. It starts from the least recently loaded sound to the most recently loaded sound. Note that 1 is actually the first item in the list when using this block.

Discard value ()

Ignores the value returned by the reporter block. Can be used to run reporter blocks. If there is no reporter block inserted, the block simply does nothing.

// ()

Basically a comment but it's a block. You can use comments to leave messages for yourself and to help during debugging. It does nothing.

JavaScript Special Variables

tempvar

Use this to get and set the Temporary Variable. This value can store anything, not just a string!

audios

Returns the array of loaded Internet sounds. Each entry is an Audio object.