scratch-vm/src/import/sb2specmap.js

1389 lines
33 KiB
JavaScript
Raw Normal View History

2016-08-31 13:56:05 -04:00
/**
* @fileoverview
* The specMap below handles a few pieces of "translation" work between
* the SB2 JSON format and the data we need to run a project
* in the Scratch 3.0 VM.
* Notably:
* - Map 2.0 and 1.4 opcodes (forward:) into 3.0-format (motion_movesteps).
2016-08-31 13:56:05 -04:00
* - Map ordered, unnamed args to unordered, named inputs and fields.
* Keep this up-to-date as 3.0 blocks are renamed, changed, etc.
* Originally this was generated largely by a hand-guided scripting process.
* The relevant data lives here:
* https://github.com/LLK/scratch-flash/blob/master/src/Specs.as
* (for the old opcode and argument order).
* and here:
* https://github.com/LLK/scratch-blocks/tree/develop/blocks_vertical
* (for the new opcodes and argument names).
* and here:
* https://github.com/LLK/scratch-blocks/blob/develop/tests/
* (for the shadow blocks created for each block).
* I started with the `commands` array in Specs.as, and discarded irrelevant
* properties. By hand, I matched the opcode name to the 3.0 opcode.
* Finally, I filled in the expected arguments as below.
2016-08-31 13:56:05 -04:00
*/
var specMap = {
'forward:': {
'opcode': 'motion_movesteps',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'STEPS'
2016-08-31 13:56:05 -04:00
}
]
},
'turnRight:': {
'opcode': 'motion_turnright',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'DEGREES'
2016-08-31 13:56:05 -04:00
}
]
},
'turnLeft:': {
'opcode': 'motion_turnleft',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'DEGREES'
2016-08-31 13:56:05 -04:00
}
]
},
'heading:': {
'opcode': 'motion_pointindirection',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_angle',
'inputName': 'DIRECTION'
2016-08-31 13:56:05 -04:00
}
]
},
'pointTowards:': {
'opcode': 'motion_pointtowards',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'motion_pointtowards_menu',
'inputName': 'TOWARDS'
2016-08-31 13:56:05 -04:00
}
]
},
'gotoX:y:': {
'opcode': 'motion_gotoxy',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'X'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'Y'
2016-08-31 13:56:05 -04:00
}
]
},
'gotoSpriteOrMouse:': {
'opcode': 'motion_goto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'motion_goto_menu',
'inputName': 'TO'
2016-08-31 13:56:05 -04:00
}
]
},
'glideSecs:toX:y:elapsed:from:': {
'opcode': 'motion_glidesecstoxy',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SECS'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'X'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'Y'
2016-08-31 13:56:05 -04:00
}
]
},
'changeXposBy:': {
'opcode': 'motion_changexby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'DX'
2016-08-31 13:56:05 -04:00
}
]
},
'xpos:': {
'opcode': 'motion_setx',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'X'
2016-08-31 13:56:05 -04:00
}
]
},
'changeYposBy:': {
'opcode': 'motion_changeyby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'DY'
2016-08-31 13:56:05 -04:00
}
]
},
'ypos:': {
'opcode': 'motion_sety',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'Y'
2016-08-31 13:56:05 -04:00
}
]
},
'bounceOffEdge': {
'opcode': 'motion_ifonedgebounce',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'setRotationStyle': {
'opcode': 'motion_setrotationstyle',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'motion_setrotationstyle_menu',
'inputName': 'STYLE'
2016-08-31 13:56:05 -04:00
}
]
},
'xpos': {
'opcode': 'motion_xposition',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'ypos': {
'opcode': 'motion_yposition',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'heading': {
'opcode': 'motion_direction',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'say:duration:elapsed:from:': {
'opcode': 'looks_sayforsecs',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'MESSAGE'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SECS'
2016-08-31 13:56:05 -04:00
}
]
},
'say:': {
'opcode': 'looks_say',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'MESSAGE'
2016-08-31 13:56:05 -04:00
}
]
},
'think:duration:elapsed:from:': {
'opcode': 'looks_thinkforsecs',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'MESSAGE'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SECS'
2016-08-31 13:56:05 -04:00
}
]
},
'think:': {
'opcode': 'looks_think',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'MESSAGE'
2016-08-31 13:56:05 -04:00
}
]
},
'show': {
'opcode': 'looks_show',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'hide': {
'opcode': 'looks_hide',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'lookLike:': {
'opcode': 'looks_switchcostumeto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'looks_costume',
'inputName': 'COSTUME'
2016-08-31 13:56:05 -04:00
}
]
},
'nextCostume': {
'opcode': 'looks_nextcostume',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'startScene': {
'opcode': 'looks_switchbackdropto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'looks_backdrops',
'inputName': 'BACKDROP'
2016-08-31 13:56:05 -04:00
}
]
},
'changeGraphicEffect:by:': {
'opcode': 'looks_changeeffectby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'looks_effectmenu',
'inputName': 'EFFECT'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'CHANGE'
2016-08-31 13:56:05 -04:00
}
]
},
'setGraphicEffect:to:': {
'opcode': 'looks_seteffectto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'looks_effectmenu',
'inputName': 'EFFECT'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'VALUE'
2016-08-31 13:56:05 -04:00
}
]
},
'filterReset': {
'opcode': 'looks_cleargraphiceffects',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'changeSizeBy:': {
'opcode': 'looks_changesizeby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'CHANGE'
2016-08-31 13:56:05 -04:00
}
]
},
'setSizeTo:': {
'opcode': 'looks_setsizeto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SIZE'
2016-08-31 13:56:05 -04:00
}
]
},
'comeToFront': {
'opcode': 'looks_gotofront',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'goBackByLayers:': {
'opcode': 'looks_gobacklayers',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_integer',
'inputName': 'NUM'
2016-08-31 13:56:05 -04:00
}
]
},
'costumeIndex': {
'opcode': 'looks_costumeorder',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'sceneName': {
'opcode': 'looks_backdropname',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'scale': {
'opcode': 'looks_size',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'startSceneAndWait': {
'opcode': 'looks_switchbackdroptoandwait',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'looks_backdrops',
'inputName': 'BACKDROP'
2016-08-31 13:56:05 -04:00
}
]
},
'nextScene': {
'opcode': 'looks_nextbackdrop',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'backgroundIndex': {
'opcode': 'looks_backdroporder',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'playSound:': {
'opcode': 'sound_play',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sound_sounds_option',
'inputName': 'SOUND_MENU'
2016-08-31 13:56:05 -04:00
}
]
},
'doPlaySoundAndWait': {
'opcode': 'sound_playuntildone',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sound_sounds_option',
'inputName': 'SOUND_MENU'
2016-08-31 13:56:05 -04:00
}
]
},
'stopAllSounds': {
'opcode': 'sound_stopallsounds',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'playDrum': {
'opcode': 'sound_playdrumforbeats',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'DRUMTYPE'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'BEATS'
2016-08-31 13:56:05 -04:00
}
]
},
'rest:elapsed:from:': {
'opcode': 'sound_restforbeats',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'BEATS'
2016-08-31 13:56:05 -04:00
}
]
},
'noteOn:duration:elapsed:from:': {
'opcode': 'sound_playnoteforbeats',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NOTE'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'BEATS'
2016-08-31 13:56:05 -04:00
}
]
},
'instrument:': {
'opcode': 'sound_setinstrumentto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'INSTRUMENT'
2016-08-31 13:56:05 -04:00
}
]
},
'changeVolumeBy:': {
'opcode': 'sound_changevolumeby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'VOLUME'
2016-08-31 13:56:05 -04:00
}
]
},
'setVolumeTo:': {
'opcode': 'sound_setvolumeto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'VOLUME'
2016-08-31 13:56:05 -04:00
}
]
},
'volume': {
'opcode': 'sound_volume',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'changeTempoBy:': {
'opcode': 'sound_changetempoby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'TEMPO'
2016-08-31 13:56:05 -04:00
}
]
},
'setTempoTo:': {
'opcode': 'sound_settempotobpm',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'TEMPO'
2016-08-31 13:56:05 -04:00
}
]
},
'tempo': {
'opcode': 'sound_tempo',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'clearPenTrails': {
'opcode': 'pen_clear',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'stampCostume': {
'opcode': 'pen_stamp',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'putPenDown': {
'opcode': 'pen_pendown',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'putPenUp': {
'opcode': 'pen_penup',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'penColor:': {
'opcode': 'pen_setpencolortocolor',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'colour_picker',
'inputName': 'COLOR'
2016-08-31 13:56:05 -04:00
}
]
},
'changePenHueBy:': {
'opcode': 'pen_changepencolorby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'COLOR'
2016-08-31 13:56:05 -04:00
}
]
},
'setPenHueTo:': {
'opcode': 'pen_setpencolortonum',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'COLOR'
2016-08-31 13:56:05 -04:00
}
]
},
'changePenShadeBy:': {
'opcode': 'pen_changepenshadeby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SHADE'
2016-08-31 13:56:05 -04:00
}
]
},
'setPenShadeTo:': {
'opcode': 'pen_changepenshadeby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SHADE'
2016-08-31 13:56:05 -04:00
}
]
},
'changePenSizeBy:': {
'opcode': 'pen_changepensizeby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SIZE'
2016-08-31 13:56:05 -04:00
}
]
},
'penSize:': {
'opcode': 'pen_setpensizeto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'SIZE'
2016-08-31 13:56:05 -04:00
}
]
},
'whenGreenFlag': {
'opcode': 'event_whenflagclicked',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'whenKeyPressed': {
'opcode': 'event_whenkeypressed',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'KEY_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'whenClicked': {
'opcode': 'event_whenthisspriteclicked',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'whenSceneStarts': {
'opcode': 'event_whenbackdropswitchesto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'BACKDROP'
2016-08-31 13:56:05 -04:00
}
]
},
'whenSensorGreaterThan': {
'opcode': 'event_whengreaterthan',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'WHENGREATERTHANMENU'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'VALUE'
2016-08-31 13:56:05 -04:00
}
]
},
'whenIReceive': {
'opcode': 'event_whenbroadcastreceived',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'BROADCAST_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'broadcast:': {
'opcode': 'event_broadcast',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'event_broadcast_menu',
'inputName': 'BROADCAST_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'doBroadcastAndWait': {
'opcode': 'event_broadcastandwait',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'event_broadcast_menu',
'inputName': 'BROADCAST_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'wait:elapsed:from:': {
'opcode': 'control_wait',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_positive_number',
'inputName': 'DURATION'
2016-08-31 13:56:05 -04:00
}
]
},
'doRepeat': {
'opcode': 'control_repeat',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_whole_number',
'inputName': 'TIMES'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
2016-08-31 13:56:05 -04:00
'inputName': 'SUBSTACK'
}
]
},
'doForever': {
'opcode': 'control_forever',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'SUBSTACK'
2016-08-31 13:56:05 -04:00
}
]
},
'doIf': {
'opcode': 'control_if',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'CONDITION'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputName': 'SUBSTACK'
2016-08-31 13:56:05 -04:00
}
]
},
'doIfElse': {
'opcode': 'control_if_else',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'CONDITION'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputName': 'SUBSTACK'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputName': 'SUBSTACK2'
2016-08-31 13:56:05 -04:00
}
]
},
'doWaitUntil': {
'opcode': 'control_wait_until',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'CONDITION'
2016-08-31 13:56:05 -04:00
}
]
},
'doUntil': {
'opcode': 'control_repeat_until',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'CONDITION'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputName': 'SUBSTACK'
2016-08-31 13:56:05 -04:00
}
]
},
'stopScripts': {
'opcode': 'control_stop',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'STOP_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'whenCloned': {
'opcode': 'control_start_as_clone',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'createCloneOf': {
'opcode': 'control_create_clone_of',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'control_create_clone_of_menu',
'inputName': 'CLONE_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'deleteClone': {
'opcode': 'control_delete_this_clone',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'touching:': {
'opcode': 'sensing_touchingobject',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_touchingobjectmenu',
'inputName': 'TOUCHINGOBJECTMENU'
2016-08-31 13:56:05 -04:00
}
]
},
'touchingColor:': {
'opcode': 'sensing_touchingcolor',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'colour_picker',
'inputName': 'COLOR'
2016-08-31 13:56:05 -04:00
}
]
},
'color:sees:': {
'opcode': 'sensing_coloristouchingcolor',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'colour_picker',
'inputName': 'COLOR'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'colour_picker',
'inputName': 'COLOR2'
2016-08-31 13:56:05 -04:00
}
]
},
'distanceTo:': {
'opcode': 'sensing_distanceto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_distancetomenu',
'inputName': 'DISTANCETOMENU'
2016-08-31 13:56:05 -04:00
}
]
},
'doAsk': {
'opcode': 'sensing_askandwait',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'QUESTION'
2016-08-31 13:56:05 -04:00
}
]
},
'answer': {
'opcode': 'sensing_answer',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'keyPressed:': {
'opcode': 'sensing_keypressed',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_keyoptions',
'inputName': 'KEY_OPTION'
2016-08-31 13:56:05 -04:00
}
]
},
'mousePressed': {
'opcode': 'sensing_mousedown',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'mouseX': {
'opcode': 'sensing_mousex',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'mouseY': {
'opcode': 'sensing_mousey',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'soundLevel': {
'opcode': 'sensing_loudness',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'senseVideoMotion': {
'opcode': 'sensing_videoon',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_videoonmenuone',
'inputName': 'VIDEOONMENU1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'sensing_videoonmenutwo',
'inputName': 'VIDEOONMENU2'
2016-08-31 13:56:05 -04:00
}
]
},
'setVideoState': {
'opcode': 'sensing_videotoggle',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_videotogglemenu',
'inputName': 'VIDEOTOGGLEMENU'
2016-08-31 13:56:05 -04:00
}
]
},
'setVideoTransparency': {
'opcode': 'sensing_setvideotransparency',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'TRANSPARENCY'
2016-08-31 13:56:05 -04:00
}
]
},
'timer': {
'opcode': 'sensing_timer',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'timerReset': {
'opcode': 'sensing_resettimer',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'getAttribute:of:': {
'opcode': 'sensing_of',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_of_property_menu',
'inputName': 'PROPERTY'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'sensing_of_object_menu',
'inputName': 'OBJECT'
2016-08-31 13:56:05 -04:00
}
]
},
'timeAndDate': {
'opcode': 'sensing_current',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'sensing_currentmenu',
'inputName': 'CURRENTMENU'
2016-08-31 13:56:05 -04:00
}
]
},
'timestamp': {
'opcode': 'sensing_dayssince2000',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'getUserName': {
'opcode': 'sensing_username',
'argMap': [
2016-08-31 13:56:05 -04:00
]
},
'+': {
'opcode': 'operator_add',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM2'
2016-08-31 13:56:05 -04:00
}
]
},
'-': {
'opcode': 'operator_subtract',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM2'
2016-08-31 13:56:05 -04:00
}
]
},
'*': {
'opcode': 'operator_multiply',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM2'
2016-08-31 13:56:05 -04:00
}
]
},
'/': {
'opcode': 'operator_divide',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM2'
2016-08-31 13:56:05 -04:00
}
]
},
'randomFrom:to:': {
'opcode': 'operator_random',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'FROM'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'TO'
2016-08-31 13:56:05 -04:00
}
]
},
'<': {
'opcode': 'operator_lt',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'OPERAND1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'OPERAND2'
2016-08-31 13:56:05 -04:00
}
]
},
'=': {
'opcode': 'operator_equals',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'OPERAND1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'OPERAND2'
2016-08-31 13:56:05 -04:00
}
]
},
'>': {
'opcode': 'operator_gt',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'OPERAND1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'OPERAND2'
2016-08-31 13:56:05 -04:00
}
]
},
'&': {
'opcode': 'operator_and',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'OPERAND1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputName': 'OPERAND2'
2016-08-31 13:56:05 -04:00
}
]
},
'|': {
'opcode': 'operator_or',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'OPERAND1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputName': 'OPERAND2'
2016-08-31 13:56:05 -04:00
}
]
},
'not': {
'opcode': 'operator_not',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputName': 'OPERAND'
2016-08-31 13:56:05 -04:00
}
]
},
'concatenate:with:': {
'opcode': 'operator_join',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'STRING1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'STRING2'
2016-08-31 13:56:05 -04:00
}
]
},
'letter:of:': {
'opcode': 'operator_letter_of',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_whole_number',
'inputName': 'LETTER'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'STRING'
2016-08-31 13:56:05 -04:00
}
]
},
'stringLength:': {
'opcode': 'operator_length',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'STRING'
2016-08-31 13:56:05 -04:00
}
]
},
'%': {
'opcode': 'operator_mod',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM1'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM2'
2016-08-31 13:56:05 -04:00
}
]
},
'rounded': {
'opcode': 'operator_round',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM'
2016-08-31 13:56:05 -04:00
}
]
},
'computeFunction:of:': {
'opcode': 'operator_mathop',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'operator_mathop_menu',
'inputName': 'OPERATOR'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'NUM'
2016-08-31 13:56:05 -04:00
}
]
},
'readVariable': {
'opcode': 'data_variable',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'data_variablemenu',
'inputName': 'VARIABLE'
2016-08-31 13:56:05 -04:00
}
]
},
'setVar:to:': {
'opcode': 'data_setvariableto',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'data_variablemenu',
'inputName': 'VARIABLE'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'VALUE'
2016-08-31 13:56:05 -04:00
}
]
},
'changeVar:by:': {
'opcode': 'data_changevariableby',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'data_variablemenu',
'inputName': 'VARIABLE'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_number',
'inputName': 'VALUE'
2016-08-31 13:56:05 -04:00
}
]
},
'showVariable:': {
'opcode': 'data_showvariable',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'data_variablemenu',
'inputName': 'VARIABLE'
2016-08-31 13:56:05 -04:00
}
]
},
'hideVariable:': {
'opcode': 'data_hidevariable',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'data_variablemenu',
'inputName': 'VARIABLE'
2016-08-31 13:56:05 -04:00
}
]
},
'contentsOfList:': {
'opcode': 'data_list',
'argMap': [
{
'type': 'field',
'fieldName': 'LIST'
}
]
},
'append:toList:': {
'opcode': 'data_addtolist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'ITEM'
2016-08-31 13:56:05 -04:00
},
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'deleteLine:ofList:': {
'opcode': 'data_deleteoflist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_integer',
'inputName': 'INDEX'
2016-08-31 13:56:05 -04:00
},
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'insert:at:ofList:': {
'opcode': 'data_insertatlist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'text',
'inputName': 'ITEM'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'math_integer',
'inputName': 'INDEX'
2016-08-31 13:56:05 -04:00
},
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'setLine:ofList:to:': {
'opcode': 'data_replaceitemoflist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_integer',
'inputName': 'INDEX'
2016-08-31 13:56:05 -04:00
},
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'ITEM'
2016-08-31 13:56:05 -04:00
}
]
},
'getLine:ofList:': {
'opcode': 'data_itemoflist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'input',
'inputOp': 'math_integer',
'inputName': 'INDEX'
2016-08-31 13:56:05 -04:00
},
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'lineCountOfList:': {
'opcode': 'data_lengthoflist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'list:contains:': {
'opcode': 'data_listcontainsitem',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
},
{
'type': 'input',
'inputOp': 'text',
'inputName': 'ITEM'
2016-08-31 13:56:05 -04:00
}
]
},
'showList:': {
'opcode': 'data_showlist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'hideList:': {
'opcode': 'data_hidelist',
'argMap': [
2016-08-31 13:56:05 -04:00
{
'type': 'field',
'fieldName': 'LIST'
2016-08-31 13:56:05 -04:00
}
]
},
'procDef': {
'opcode': 'procedures_defnoreturn',
'argMap': []
2016-08-31 13:56:05 -04:00
},
'getParam': {
'opcode': 'procedures_param',
'argMap': []
2016-08-31 13:56:05 -04:00
},
'call': {
'opcode': 'procedures_callnoreturn',
'argMap': []
2016-08-31 13:56:05 -04:00
}
};
module.exports = specMap;