MCPcopy
hub / github.com/samyk/skyjack / do_action

Function do_action

drone_control/tweet_repl.js:41–67  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

39});
40
41function do_action(str) {
42 switch (true) {
43 case /^to/.test(str):
44 console.log("• doing takeoff");
45 client.takeoff();
46 break;
47 case /^la/.test(str):
48 console.log("• doing land");
49 client.land();
50 break;
51 case /^st/.test(str):
52 console.log("• doing stop");
53 client.stop();
54 break;
55 case /^cw/.test(str):
56 console.log("• rotate clockwise");
57 client.clockwise(0.5);
58 break;
59 case /^cc/.test(str):
60 console.log("• rotate counterclockwise");
61 client.clockwise(-0.5);
62 break;
63 default:
64 console.log("• unknown command:" + str + ":");
65 break;
66 }
67 }
68
69console.log('streaming from twitter...');
70stream.on('tweet', function (tweet) {

Callers 1

tweet_repl.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected