-
Notifications
You must be signed in to change notification settings - Fork 2
/
leekwars.js
executable file
·85 lines (82 loc) · 2.46 KB
/
leekwars.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
#!/usr/bin/nodejs
/*
@project LeekWarsBuilder
@author Nathan Lopez
@version 1.0
*/
//Local
var commands = require('./lib/commands');
require('yargs')
.usage('$0 <cmd> [args]')
.command('garden-solo <name>', 'Look for a solo garden fight for a leek', {
auto: {
alias: 'a',
describe: 'Automatically choose oponent',
},
number: {
alias: 'n',
describe: 'Number of fights',
}
},
function(argv){
commands.garden_start_solo_fight(argv);
})
.command('garden-farmer', 'Look for a solo garden fight for a farmer', {
auto: {
alias: 'a',
describe: 'Automatically choose oponent',
},
number: {
alias: 'n',
describe: 'Number of fights',
}
}, function(argv){
commands.garden_start_farmer_fight(argv);
})
.command('garden-team <name>', 'Look for a team garden fight for a composition', {
auto: {
alias: 'a',
describe: 'Automatically choose oponent',
},
number: {
alias: 'n',
describe: 'Number of fights',
}
},
function(argv){
commands.garden_start_team_fight(argv);
})
.command('garden-solo-challange <leek1> <leek2>', 'Start solo garden challange for a leek', {
number: {
alias: 'n',
describe: 'Number of fights',
}
},
function(argv){
commands.garden_start_solo_challange(argv);
})
.command('list <type>', 'List items', {}, function (argv) {
switch (argv.type) {
case "leeks":
commands.list_leeks();
break;
case "ais":
commands.list_ais();
break;
default:
console.log('Type must be (leeks|ais)')
}
})
.command('set-ai <leek> <ai>', 'Set ai', {}, function (argv) {
commands.set_ai(argv);
})
.command('ab-test <leek> <target> <ai1> <ai2>', 'Set ai', {
number: {
alias: 'n',
describe: 'Number of fights',
}
}, function (argv) {
commands.ab_test(argv);
})
.help('help')
.argv