-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode.gs
More file actions
65 lines (59 loc) · 1.97 KB
/
Code.gs
File metadata and controls
65 lines (59 loc) · 1.97 KB
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
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [];
menuEntries.push({name: "Pridėti taškų", functionName: "loadUi"});
menuEntries.push(null);
menuEntries.push({name: "Formatuoti foną", functionName: "formatBackground"});
menuEntries.push({name: "Pridėti mokinius", functionName: "fill"});
ss.addMenu("Patirtis", menuEntries);
};
function add(e) {
var app = UiApp.getActiveApplication();
var sk = parseInt(e.parameter.value);
var row = UserProperties.getProperty('name');
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var cell = sheet.getRange(row,7,1,1);
var current = parseInt(cell.getValue());
cell.setValue(current+sk);
};
function gyvybe() {
var app = UiApp.getActiveApplication();
var row = UserProperties.getProperty('name');
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var cell = sheet.getRange(row,16,1,1);
var current = parseInt(cell.getValue());
cell.setValue(current-1);
};
function electron(e) {
var app = UiApp.getActiveApplication();
var sk = parseInt(e.parameter.value);
var row = UserProperties.getProperty('name');
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var cell = sheet.getRange(row,6,1,1);
var current = parseInt(cell.getValue());
cell.setValue(current+sk);
};
function vardas(e){
var sprsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = sprsheet.getActiveSheet();
var authrange;
var rows = sheet.getLastRow()+1;
var range;
var name = e.parameter.vardas;
for (var a=2; a<rows; a++) {
range = sheet.getRange("A"+a).getValue();
if (range == name) {
UserProperties.setProperty('name', a);
};
};
};
function goto() {
var row = UserProperties.getProperty('name');
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getRange(row,1,1,8);
sheet.setActiveSelection(range);
};