Skip to content
Iwotastic edited this page Aug 21, 2015 · 2 revisions

If you want to know what a certain block does you've come to the right place.

Browser

All the blocks that can interact with your browser.

alert [message]

Shows a popup box that says message.

ask [message]

Shows a popup box that asks message and returns true if the user clicked Ok or false if the user clicked Cancel.

prompt [message]

Shows a popup box that asks message and returns what the user entered.

show copy box [text]

Show a popup box that prompts the user to copy text.

prompt [message] with default value [value]

Shows a popup box that asks message and has value already entered into it. Then, returns what the user entered.

set tab name to [name]

Sets the tab's name to name.

tab name

Returns the tab's name.

JavaScript

Run JavaScript in Scratch!

import Scratch extension from URL: [URL]

Loads a Scratch extension from URL.

run JS [script]

Runs script as JavaScript.

send [GET, POST, PUT, or DELETE] request to URL: [url] with data [data]

Sends a request of type GET, POST, PUT, or DELETE to the url url along with optional data data. Then returns the result (if any). make sure that if data is included that it is a Scratch Boost Object.

Local Variables

Save stuff to the user's browser.

create local variable [variable]

Makes and saves a local variable named variable on the user's computer.

local variable [variable]

Loads the local variable named variable.

set local variable [variable] to [value]

Saves the local variable named variable with a value of value.

delete local variable [variable]

Deletes the local variable named variable.

Miscellaneous

All the blocks I couldn't find a place for.

if <bool> then [true] else [false]

Returns true if bool is true or false.

(x) [compare] (y)

Returns whether x is not equal to y, x is less than or equal to y, or x is greater than or equal to y.

color r: (red) g: (green) b: (blue)

Returns a color based on the red, green, and blue values.

Scratch Boost installed?

Returns true unless Scratch Boost isn't installed

comment [text]

This is an inline comment.

whenever <bool> becomes true

Executed every time bool switches from being false to true

<bool> to number

Returns 1 if bool is true and 0 if false

Objects

Bringing object oriented programming to Scratch! Note: All Object blocks return a JSON value.

create object

Returns an empty object which looks like {}. This block can be used inside of variables, lists, local variables, and more.

object [property] of [object]

Returns the property property of object as an object.

[property] of [object]

Returns the property property of object as a number or a string.

set [property] of [object] to [value]

Returns an object with the property property set to value. value can be a number, string, boolean, or object.

Scratch

Interact with more Scratch features with Scratch Boost.

viewing with editor?

Returns true if the user has the project's editor open and false if not.

see inside

Switches to the editor view.

see project page

Switches to the project page.

toggle see inside

Switches between the editor view and the project page.

project ID

Returns this project's ID.

set [navbar item] color to r: (red) g: (green) b: (blue)

Sets the color of either the navbar text or navbar background to a color based on the red, green, and blue values.

go to [page type] [ID]

Prompts the user if the want to go to one of the following:

  • The project page of the project with the ID of ID
  • The profile of the user named ID
  • The studio with the ID ID
  • The discussion topic with the ID ID
  • The results of searching Scratch for ID

Strings

More text tools!

[string] contains [substring]

Returns true if substring can be found in string.

where is [substring] in [string]

Returns the first location of substring in string.

letters (x) to (y) of [string]

Returns the letters from string in the range x to y.

[string] to boolean

Returns true if string is:

  • Any capitalization of the word "true"
  • Any capitalization of the word "yes"
  • The number 1
number of words in [sentence]

Returns how many words are in sentence. Words are calculated by how many pieces of text with spaces or punctuation there are.

how many times is [substring] in [string]

Returns the number of times substring is in string even if substring is within a word.

Clone this wiki locally