-
Notifications
You must be signed in to change notification settings - Fork 3
/
com.js
46 lines (40 loc) · 1.34 KB
/
com.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
class comCommand {
constructor() {
this.comrow = undefined;
this.comlist = "com";
this.commassiv = undefined;
this.message = "";
this.status = "выкл";
}
comCheck() {
if (this.status == "вкл") {
this.message = this.message.toLowerCase();
let massiv = this.message.split(';');
let dictCommandCom = new Map();
for (let index in massiv) {
dictCommandCom[massiv[index].split('=')[0]] = massiv[index].split('=')[1];
}
if (dictCommandCom['comrow'] != undefined) {
this.comrow = dictCommandCom['comrow'].toUpperCase();
}
if (dictCommandCom['comlist'] != undefined) {
this.comlist = dictCommandCom['comlist'].toLowerCase();
}
if (dictCommandCom['commassiv'] != undefined) {
this.commassiv = dictCommandCom['commassiv'].toUpperCase();
}
if (this.comrow != undefined) {
this.message = ss.getSheetByName(this.comlist).getRange(this.comrow).getValue();
} else if (this.commassiv != undefined) {
let t = ss.getSheetByName(this.comlist).getRange(this.commassiv).getValues();
this.message = '';
for (let mes in t) {
this.message = this.message + t[mes] + "::";
}
}
}
}
}
////// com
var comCommands = new comCommand();
comCommands.status = settingSheet.getRange("B2").getValue();