SHOW:
|
|
- or go back to the newest paste.
1 | API = require("buttonAPI") | |
2 | local event = require("event") | |
3 | local computer = require("computer") | |
4 | local term = require("term") | |
5 | local component = require("component") | |
6 | local gpu = component.gpu | |
7 | ||
8 | local rs = component.redstone | |
9 | local colors = require("colors") | |
10 | local sides = require("sides") | |
11 | ||
12 | function API.fillTable() | |
13 | - | API.setTable("Gen 1", test1, 10,20,3,5) |
13 | + | API.setTable("Start", test1, 10,32,3,15) |
14 | - | API.setTable("Gen 2", test2, 22,32,3,5) |
14 | + | API.setTable("Exit", test5, 34,50,3,15) |
15 | - | API.setTable("Gen 3", test3, 10,20,8,10) |
15 | + | |
16 | - | API.setTable("Gen 4", test4, 22,32,8,10) |
16 | + | |
17 | - | API.setTable("Exit", test5, 10,32,13,15) |
17 | + | |
18 | - | API.setTable("Emergency stop", test6, 34,62,3,15) |
18 | + | |
19 | local _, _, x, y = event.pull(1,touch) | |
20 | if x == nil or y == nil then | |
21 | local h, w = gpu.getResolution() | |
22 | gpu.set(h, w, ".") | |
23 | gpu.set(h, w, " ") | |
24 | else | |
25 | API.checkxy(x,y) | |
26 | end | |
27 | end | |
28 | ||
29 | function test1() | |
30 | API.toggleButton("Start") | |
31 | term.setCursor(1,25) | |
32 | term.write("Active ") | |
33 | rs.setOutput(sides.up,15) | |
34 | - | API.toggleButton("Gen 1") |
34 | + | os.sleep(2500) |
35 | - | if buttonStatus == true then |
35 | + | |
36 | - | term.setCursor(1,25) |
36 | + | term.write("Check core to start ") |
37 | - | term.write("Working... ") |
37 | + | rs.setOutput(sides.up,0) |
38 | - | rs.setOutput(sides.right,15) |
38 | + | API.toggleButton("Start") |
39 | - | os.sleep(3) |
39 | + | |
40 | - | term.setCursor(1,25) |
40 | + | |
41 | - | term.write("System ready ") |
41 | + | |
42 | - | else |
42 | + | |
43 | - | term.setCursor(1,25) |
43 | + | |
44 | - | term.write("Working... ") |
44 | + | |
45 | - | rs.setOutput(sides.right,0) |
45 | + | |
46 | - | os.sleep(3) |
46 | + | |
47 | - | term.setCursor(1,25) |
47 | + | |
48 | - | term.write("System ready ") |
48 | + | |
49 | API.clear() | |
50 | API.fillTable() | |
51 | API.heading("Nuclear generator control system") | |
52 | - | function test2() |
52 | + | |
53 | - | API.toggleButton("Gen 2") |
53 | + | |
54 | - | if buttonStatus == true then |
54 | + | |
55 | - | term.setCursor(1,25) |
55 | + | |
56 | - | term.write("Working... ") |
56 | + | |
57 | - | rs.setOutput(sides.left,15) |
57 | + | |
58 | - | os.sleep(3) |
58 | + | |
59 | - | term.setCursor(1,25) |
59 | + | |
60 | - | term.write("System ready ") |
60 | + |