This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera blocks.xml
14 lines (14 loc) · 5.36 KB
/
camera blocks.xml
1
<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="Setup camera %'width' %'height'" type="command" category="other"><header></header><code></code><inputs><input type="%n"></input><input type="%n"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>setup_camera</l><list><block var="width"/><block var="height"/></list></custom-block></script></block-definition><block-definition s="Watson image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Microsoft image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Google image key" type="reporter" category="other"><header></header><code></code><inputs></inputs><script><block s="doReport"><l>Enter your key here</l></block></script></block-definition><block-definition s="Ask %'cloud provider' to say what it sees then %'then receive response' and show the picture %'show photo?'" type="command" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%cmdRing"></input><input type="%s"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>take_picture_and_analyse</l><list><block var="cloud provider"/><block var="show photo?"/><block var="then receive response"/></list></custom-block></script></block-definition><block-definition s="Do %'handle response' with what Google sees and show the photo %'show'" type="command" category="sensing"><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%b"></input></inputs><script><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><l>Google</l><block s="reifyScript"><script><block s="doRun"><block var="handle response"/><list><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>2</l><block s="reportListItem"><l>2</l><l/></block></block></autolambda><list></list></block><list><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block s="reportListItem"><l>1</l><block var="response"/></block></block></block></list></custom-block></list></block></script><list><l>response</l></list></block><block var="show"/></custom-block></script></block-definition><block-definition s="Do %'handle response' with what IBM Watson sees and show the photo %'show'" type="command" category="sensing"><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%b"></input></inputs><script><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><l>Watson</l><block s="reifyScript"><script><block s="doRun"><block var="handle response"/><list><custom-block s="map %repRing over %mult%l"><block s="reifyReporter"><autolambda><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><l/></block></block></autolambda><list></list></block><list><block var="response"/></list></custom-block></list></block></script><list><l>response</l></list></block><block var="show"/></custom-block></script></block-definition><block-definition s="Do %'handle response' with what Microsoft sees and show the photo %'show'" type="command" category="sensing"><header></header><code></code><inputs><input type="%cmdRing"></input><input type="%b"></input></inputs><script><custom-block s="Ask %txt to say what it sees then %cmdRing and show the picture %s"><l>Microsoft</l><block s="reifyScript"><script><block s="doRun"><block var="handle response"/><list><block s="reportListItem"><l>2</l><block s="reportListItem"><l>1</l><block s="reportListItem"><l>2</l><block s="reportListItem"><l>3</l><block var="responses"/></block></block></block></block></list></block></script><list><l>responses</l></list></block><block var="show"/></custom-block></script></block-definition><block-definition s="run eCraft2Learn command %'command name' with %'inputs'" type="command" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>function_name</l><l>parameters</l></list><l>"use strict";




if (typeof ecraft2learn === 'object') {




 ecraft2learn.snap_context = this;




 ecraft2learn.run(function_name, parameters);




} else {




 var script = document.createElement("script");




 script.type = "text/javascript";




 script.src = "https://toontalk.github.io/ai-cloud/ecraft2learn.js";




 script.addEventListener('load', function () {




 ecraft2learn.snap_context = this;




 ecraft2learn.run(function_name, parameters);




 }.bind(this));




 document.head.appendChild(script);




}</l></block><list><block var="command name"/><block var="inputs"/></list></block></script></block-definition></blocks>