View difference between Paste ID: prC3cm9w and dY8jqpuR
SHOW: | | - or go back to the newest paste.
1
--AREA OF ADJUSTMENTS
2
3
monitor = 1000
4
sorter = 1001
5
 
6
switch = "right"
7
signal_out = "front"
8
wireless = "top"
9
 
10
reverse = "n"
11
 
12
rednet.open(wireless)
13
 
14
--DETERMINING WEITHER ITS ALREADY ON--
15
16
if redstone.getInput(switch) == true and reverse == "n" then
17-
  status = "activated"
17+
  if redstone.getInput(switch) == true then
18-
else
18+
    status = "activated"
19-
  status = "deactivated"
19+
  else
20
    status = "deactivated"
21
  end
22
  else
23
  if redstone.getInput(switch) == false then
24
    status = "activated"
25
  else
26
    status = "deactivated"
27
  end
28
end
29
 
30
while true do
31
32
  print("receiving... currently " .. status)
33
34
  event, id, text = os.pullEvent()
35
36
  if event == "rednet_message" then
37
    print("received " .. text)
38-
    if redstone.getInput(switch) == true and reverse == "n" then
38+
39-
      status = "activated"
39+
40-
    else
40+
41-
      status = "deactivated"
41+
42-
    end    
42+
43
      sleep(0.5)
44
    end
45
46
47
if redstone.getInput(switch) == true and reverse == "n" then
48
  if redstone.getInput(switch) == true then
49
    status = "activated"
50
  else
51
    status = "deactivated"
52
  end
53
  else
54
  if redstone.getInput(switch) == false then
55
    status = "activated"
56
  else
57
    status = "deactivated"
58
  end
59
end   
60
61
    print(status)
62
63
    if text == "status update" and id == monitor then
64
      print(status)
65
      rednet.send(monitor, status)
66
    end
67
  end
68
end