View difference between Paste ID: ueyFQbaA and hNLPzf0i
SHOW: | | - or go back to the newest paste.
1
-- FUNCTIONS
2-
print (" 1 - slit' vodu ")
2+
function signal()
3
    rs.setOutput("back",true)
4
    sleep(1)
5
    rs.setOutput("back",false)
6
end
7-
rs.setOutput("back",true)
7+
8-
sleep(1)
8+
function checkWater()
9-
rs.setOutput("back",false)
9+
  rednet.open('bottom')
10
  rednet.broadcast('check_water')
11
  id, result = rednet.receive()
12-
if text == '2' then
12+
13-
rs.setOutput("back",true)
13+
14-
sleep(1)
14+
15-
rs.setOutput("back",false)
15+
16
function slitVodu()
17-
function NAME()
17+
   if checkWater()
18-
rednet.open('bottom')
18+
      signal()
19-
rednet.broadcast('check_water')
19+
      print('Voda slita')
20
   else
21
      print('Voda uzhe slita')
22
   end
23
end
24-
if checkWater() then
24+
25-
  print('Water is running')
25+
-- PROGRAM
26
print ("Dobro pozhalovat")
27-
  print('No water')
27+
print ("1 - slit' vodu ")
28
print ("2 - napolnit' vodoy ")
29
30
text = read()
31
if text == '1' then
32
    slitVodu()
33
elseif text == '2' then
34
    --
35
else
36
    print('Nepravilnaya komanda')
37
end
38
39
40