%xml{:id => 'toolbox', :style => 'display: none'} %category{:name => tt('.motion')} - category = 'hardware' - subcategory = 'smalrubot_s1' %block{type: "#{category}_#{subcategory}_action"} %field{name: 'ACTION'}< forward %block{type: "#{category}_#{subcategory}_action_with_sec"} %field{name: 'ACTION'}< forward = toolbox_number_value('SEC', 0.5) %block{type: "#{category}_#{subcategory}_dc_motor_set_power_ratio"} = toolbox_number_value('SPEED', 100) - category = 'looks' %category{:name => tt('.looks')} %block{:type => "#{category}_say"} %value{name: 'TEXT'} - category = 'hardware' - subcategory = 'smalrubot_s1' %block{type: "#{category}_#{subcategory}_ir_photoreflector_value"} - category = 'hardware' - subcategory = 'smalrubot_s1' %block{type: "#{category}_#{subcategory}_led_turn_on_or_off"} %field{name: 'OOO'}< turn_on %category{:name => tt('.data'), :custom => 'VARIABLE'} - category = 'events' %category{:name => tt('.events')} -# まずは %block{:type => "#{category}_on_start"} -# キーボードの[▼キー]が[▼押された/押され続けている]とき %block{:type => "#{category}_on_key_push_or_down"} = toolbox_key_field = toolbox_pod_field -# キャラクターがクリックされたとき %block{:type => "#{category}_on_click"} - category = 'control' %category{:name => tt('.control')} -# ( )秒待つ %block{:type => "#{category}_sleep"} = toolbox_number_value('SEC', 1) -# ほんの少し待つ %block{:type => "#{category}_await"} -# ( )回繰り返す %block{:type => "#{category}_times"} = toolbox_number_value('COUNT', 10) -# ずっと %block{:type => "#{category}_loop"} -# もし< >なら %block{:type => "#{category}_if"} -# もし< >なら~でなければ %block{:type => "#{category}_if_else"} -# < >まで待つ %block{:type => "#{category}_await_until"} -# < >まで繰り返す %block{:type => "#{category}_until"} -# 繰り返しから脱出する %block{:type => "#{category}_break"} -# 次の繰り返しにジャンプする %block{:type => "#{category}_next"} - category = 'sensing' %category{:name => tt('.sensing')} -# 条件:キーボードの[▼キー]が[▼押された] %block{:type => "#{category}_input_key_push_or_down"} = toolbox_key_field = toolbox_pod_field -# 条件:マウスの[▼左ボタン]が[▼押された] %block{:type => "#{category}_input_mouse_push_or_down"} = toolbox_pod_field -# [ ]と聞いて待つ -#%block{:type => "#{category}_ask"} -# = toolbox_text_value('TEXT', 'あなたのお名前は?') -# 変数:答え -#%block{:type => "#{category}_answer"} -# 変数:タイマー -#%block{:type => "#{category}_timer_count"} -# タイマーをリセット -#%block{:type => "#{category}_timer_reset"} - category = 'hardware' - subcategory = 'smalrubot_s1' %block{type: "#{category}_#{subcategory}_ir_photoreflector_value"} %block{type: "#{category}_#{subcategory}_dc_motor_power_ratio"} - category = 'operators' %category{:name => tt('.operators')} -# 数値 %block{:type => 'math_number'} %field{:name => 'NUM'}< 0 -# テキスト %block{:type => 'text'} %field{:name => 'TEXT'}< = tt('.text') -# 変数:( ) + ( ) %block{:type => "#{category}_add"} -# 変数:( ) - ( ) %block{:type => "#{category}_minus"} -# 変数:( ) * ( ) %block{:type => "#{category}_multiply"} -# 変数:( ) / ( ) %block{:type => "#{category}_divide"} -# 変数:( )から( )までの乱数 %block{:type => "#{category}_rand"} = toolbox_number_value('A', 1) = toolbox_number_value('B', 10) -# 条件:( ) < ( ) %block{:type => "#{category}_compare_lt"} -# 条件:( ) <= ( ) %block{:type => "#{category}_compare_lte"} -# 条件:( ) = ( ) %block{:type => "#{category}_compare_eq"} -# 条件:( ) >= ( ) %block{:type => "#{category}_compare_gte"} -# 条件:( ) > ( ) %block{:type => "#{category}_compare_gt"} -# 条件:< > かつ < > %block{:type => "#{category}_and"} -# 条件:< > または < > %block{:type => "#{category}_or"} -# 条件:< > ではない %block{:type => "#{category}_negate"} -# 変数:( )の( )番目 %block{:type => "#{category}_index_of"} = toolbox_text_value('A', tt('.world')) = toolbox_number_value('INDEX', 1) -# 変数:( )の長さ %block{:type => "#{category}_length"} = toolbox_text_value('A', tt('.world')) -# 変数:( )を( )で割った余り %block{:type => "#{category}_modulo"} = toolbox_number_value('A', 5) = toolbox_number_value('B', 2) -# 変数:( )を四捨五入 %block{:type => "#{category}_round"} = toolbox_number_value('A', 0.5) -# 変数:( )の[▼数学関数] %block{:type => "#{category}_math_method"} = toolbox_number_value('NUM', 9) %field{:name => 'METHOD'}< Math.sqrt(%num%) -# 条件:真 %block{:type => "#{category}_true"} -# 条件:偽 %block{:type => "#{category}_false"} - if !SmalrubyEditor::Config.enabled?('auto_init_hardware') %category{:name => tt('.etc')} - category = 'hardware' -# ハードウェアを準備する %block{:type => "#{category}_init_hardware"}