SHOW:
|
|
- or go back to the newest paste.
1 | - | -- REDBoardControl ver 1.2 |
1 | + | -- REDBoardControl ver 1.2 ENG by Laine_prikol |
2 | forms=require("forms") | |
3 | local term = require("term") | |
4 | local sides = require("sides") | |
5 | local computer = require("computer") | |
6 | local component = require("component") | |
7 | local rs = component.redstone | |
8 | rs.setOutput(sides.south, 0) | |
9 | - | |
9 | + | |
10 | Form1=forms.addForm() | |
11 | Form1.border=2 | |
12 | term.setCursor(2,2) | |
13 | - | -- Авторы и название программы |
13 | + | -- authors |
14 | - | Label1=Form1:addLabel(30,25,"Автор прогаммы: Laine_prikol Автор API: Zer0Galaxy") |
14 | + | Label1=Form1:addLabel(30,25,"Program author: Laine_prikol Author API: Zer0Galaxy") |
15 | Label1=Form1:addLabel(2,1,"REDBOARD Control ver 1.2") | |
16 | - | -- Панель 1 |
16 | + | -- Panel 1 |
17 | - | Label1=Form1:addLabel(2,2,"Управление передней стороной:") |
17 | + | Label1=Form1:addLabel(2,2,"Contol front side:") |
18 | - | Btn1=Form1:addButton(2,3,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.south, 15) computer.beep(600,0.5) end) |
18 | + | Btn1=Form1:addButton(2,3,"ON",function() rs.setOutput(sides.south, 15) computer.beep(600,0.5) end) |
19 | Btn1.color=0xfffff | |
20 | - | Btn2=Form1:addButton(2,4,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.south, 0) computer.beep(100,0.8) end) |
20 | + | Btn2=Form1:addButton(2,4,"OFF",function() rs.setOutput(sides.south, 0) computer.beep(100,0.8) end) |
21 | Btn2.color=0xff0000 | |
22 | - | Btn3=Form1:addButton(2,5,"ЦИКЛ",function() while true do rs.setOutput(sides.south, 0) rs.setOutput(sides.south, 15) os.sleep(0.5) end end) |
22 | + | Btn3=Form1:addButton(2,5,"Cycle",function() while true do rs.setOutput(sides.south, 0) rs.setOutput(sides.south, 15) os.sleep(0.5) end end) |
23 | Btn3.color=0x505050 | |
24 | - | -- Панель 2 |
24 | + | -- Panel 2 |
25 | - | Label1=Form1:addLabel(2,6,"Управление левой стороной:") |
25 | + | Label1=Form1:addLabel(2,6,"Contol left side:") |
26 | - | Btn4=Form1:addButton(2,7,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.west, 15) computer.beep(600,0.5) end) |
26 | + | Btn4=Form1:addButton(2,7,"ON",function() rs.setOutput(sides.west, 15) computer.beep(600,0.5) end) |
27 | Btn4.color=0xfffff | |
28 | - | Btn5=Form1:addButton(2,8,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.west, 0) computer.beep(100,0.8) end) |
28 | + | Btn5=Form1:addButton(2,8,"OFF",function() rs.setOutput(sides.west, 0) computer.beep(100,0.8) end) |
29 | Btn5.color=0xff0000 | |
30 | - | Btn6=Form1:addButton(2,9,"ЦИКЛ",function() while true do rs.setOutput(sides.west, 0) rs.setOutput(sides.west, 15) end os.sleep(0.5) end) |
30 | + | Btn6=Form1:addButton(2,9,"Cycle",function() while true do rs.setOutput(sides.west, 0) rs.setOutput(sides.west, 15) end os.sleep(0.5) end) |
31 | Btn6.color=0x505050 | |
32 | - | -- Панель 3 |
32 | + | -- Panel 3 |
33 | - | Label1=Form1:addLabel(2,10,"Управление тыльной стороной:") |
33 | + | Label1=Form1:addLabel(2,10,"Control back side") |
34 | - | Btn7=Form1:addButton(2,11,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.north, 15) computer.beep(600,0.5) end) |
34 | + | Btn7=Form1:addButton(2,11,"ON ",function() rs.setOutput(sides.north, 15) computer.beep(600,0.5) end) |
35 | Btn7.color=0xfffff | |
36 | - | Btn8=Form1:addButton(2,12,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.north, 0) computer.beep(100,0.8) end) |
36 | + | Btn8=Form1:addButton(2,12,"OFF",function() rs.setOutput(sides.north, 0) computer.beep(100,0.8) end) |
37 | Btn8.color=0xff0000 | |
38 | - | Btn9=Form1:addButton(2,13,"ЦИКЛ",function() while true do rs.setOutput(sides.north, 0) rs.setOutput(sides.north, 15) os.sleep(0.5) end end) |
38 | + | Btn9=Form1:addButton(2,13,"Cycle",function() while true do rs.setOutput(sides.north, 0) rs.setOutput(sides.north, 15) os.sleep(0.5) end end) |
39 | Btn9.color=0x505050 | |
40 | - | -- Панель 4 |
40 | + | -- Panel 4 |
41 | - | Label1=Form1:addLabel(40,2,"Управление правой стороной:") |
41 | + | Label1=Form1:addLabel(40,2,"Contol right side") |
42 | - | Btn10=Form1:addButton(40,3,"РЫЧАГ ВКЛ ",function() rs.setOutput(sides.east, 15) computer.beep(600,0.5) end) |
42 | + | Btn10=Form1:addButton(40,3,"ON ",function() rs.setOutput(sides.east, 15) computer.beep(600,0.5) end) |
43 | Btn10.color=0xfffff | |
44 | - | Btn11=Form1:addButton(40,4,"РЫЧАГ ВЫКЛ",function() rs.setOutput(sides.east, 0) computer.beep(100,0.8) end) |
44 | + | Btn11=Form1:addButton(40,4,"OFF",function() rs.setOutput(sides.east, 0) computer.beep(100,0.8) end) |
45 | Btn11.color=0xff0000 | |
46 | - | Btn12=Form1:addButton(40,5,"ЦИКЛ",function() while true do rs.setOutput(sides.east, 0) rs.setOutput(sides.east, 15) end os.sleep(0.5) end) |
46 | + | Btn12=Form1:addButton(40,5,"Cycle",function() while true do rs.setOutput(sides.east, 0) rs.setOutput(sides.east, 15) end os.sleep(0.5) end) |
47 | Btn12.color=0x505050 | |
48 | - | -- Разное |
48 | + | Label1=Form1:addLabel(40,9,"Miscellaneous:") |
49 | - | Label1=Form1:addLabel(40,9,"Разное:") |
49 | + | Btn1=Form1:addButton(40,10,"ALARM",function() while true do computer.beep(775,0.5) end os.sleep(0.5) end) |
50 | - | Btn1=Form1:addButton(40,10,"СИГНАЛИЗАЦИЯ",function() while true do computer.beep(775,0.5) end os.sleep(0.5) end) |
50 | + | |
51 | Btn1=Form1:addButton(40,11,"EXIT",function() forms.stop() term.clear() end) | |
52 | - | Btn1=Form1:addButton(40,11,"Выход",function() forms.stop() term.clear() end) |
52 | + | |
53 | forms.run(Form1) -- Load Form1 |