This repository has been archived by the owner on May 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.js
92 lines (78 loc) · 1.98 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
const vorpal = require('vorpal')();
const Actions = require('./inc/actions');
const Server = require('./inc/server');
global.server = new Server();
Actions.init().then(() => {
vorpal.show();
});
vorpal
.command('status')
.description('reset module position')
.action(function(args, callback) {
Actions.status(server, true);
callback();
})
vorpal
.command('reset')
.description('reset module position')
.action(function(args, callback) {
Actions.reset();
callback();
})
vorpal
.command('message')
.description('get current message')
.action(function(args, callback) {
Actions.message();
callback();
})
vorpal
.command('position')
.description('get module position')
.action(function(args, callback) {
Actions.position();
callback();
})
vorpal
.command('list')
.description('get module messages')
.action(function(args, callback) {
Actions.list();
callback();
})
vorpal
.command('find <string>')
.description('move the module to searched <string>')
.action(function(args, callback) {
Actions.find(args.string)
callback();
})
vorpal
.command('step')
.description('step the module 1 step ahead')
.action(function(args, callback) {
Actions.step()
callback();
})
vorpal
.command('move <position>')
.description('move the module to <position>')
.action(function(args, callback) {
Actions.move(args.position)
callback();
})
vorpal
.command('turn <action> [duration] [variation]')
.description('turn mode duration variation, use with start|stop, time in seconds')
.action(function(args, callback) {
Actions.turn(args.action, args.duration, args.variation);
callback();
});
vorpal
.command('random <action> [duration] [variation]')
.description('random mode duration variation, use with start|stop, time in seconds')
.action(function(args, callback) {
Actions.random(args.action, args.duration, args.variation);
callback();
});
vorpal.delimiter('fallblatt >');