Rev 2169 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2169 | Rev 2188 | ||
|---|---|---|---|
| Line 5... | Line 5... | ||
| 5 | Water_Intervals = function() { return [ 1, 5, 10, 15, 20 ]; }; |
5 | Water_Intervals = function() { return [ 1, 5, 10, 15, 20 ]; }; |
| 6 | Water_Volume = function() { return [ 0, 500, 1000, 5000, 10000 ]; }; |
6 | Water_Volume = function() { return [ 0, 500, 1000, 5000, 10000 ]; }; |
| 7 | Water_Aliases = function() { return Module_GetAliasNames(Water_ModuleNames); }; |
7 | Water_Aliases = function() { return Module_GetAliasNames(Water_ModuleNames); }; |
| 8 | Water_AvailableIds = function() { return Module_GetAvailableIds(Water_ModuleNames); }; |
8 | Water_AvailableIds = function() { return Module_GetAvailableIds(Water_ModuleNames); }; |
| 9 | 9 | ||
| 10 | /* |
10 | |
| 11 | function Water_SetVolume(alias_name, volume) |
11 | function Water_SetVolume(alias_name, volume) |
| 12 | { |
12 | { |
| 13 | if (arguments.length < 2) |
13 | if (arguments.length < 2) |
| 14 | { |
14 | { |
| 15 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
15 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
| Line 30... | Line 30... | ||
| 30 | else |
30 | else |
| 31 | { |
31 | { |
| 32 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
32 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
| 33 | } |
33 | } |
| 34 | |
34 | |
| 35 | found = true; |
35 | found = true; |
| 36 | } |
36 | } |
| 37 | |
37 | |
| 38 | if (!found) |
38 | if (!found) |
| 39 | { |
39 | { |
| 40 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
40 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
| 41 | return false; |
41 | return false; |
| 42 | } |
42 | } |
| 43 | |
43 | |
| 44 | return true; |
44 | return true; |
| 45 | } |
45 | } |
| 46 | Console_RegisterCommand(Water_SetVolume, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Water_Aliases(), Water_Volume()); }); |
46 | Console_RegisterCommand(Water_SetVolume, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Water_Aliases(), Water_Volume()); }); |
| 47 | */ |
47 | |
| 48 | /* |
48 | |
| 49 | function Water_SetReportInterval(alias_name, interval) |
49 | function Water_SetReportInterval(alias_name, interval) |
| 50 | { |
50 | { |
| 51 | if (arguments.length < 2) |
51 | if (arguments.length < 2) |
| 52 | { |
52 | { |
| 53 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
53 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
| Line 80... | Line 80... | ||
| 80 | } |
80 | } |
| 81 | |
81 | |
| 82 | return true; |
82 | return true; |
| 83 | } |
83 | } |
| 84 | Console_RegisterCommand(Water_SetReportInterval, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Water_Aliases(), Water_Intervals()); }); |
84 | Console_RegisterCommand(Water_SetReportInterval, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Water_Aliases(), Water_Intervals()); }); |
| 85 | */ |
- | |
| 86 | 85 | ||
| 87 | function Water_OnMessage(module_name, module_id, command, variables) |
86 | function Water_OnMessage(module_name, module_id, command, variables) |
| 88 | { |
87 | { |
| 89 | if (in_array(Water_ModuleNames, module_name)) |
88 | if (in_array(Water_ModuleNames, module_name)) |
| 90 | { |
89 | { |