SHOW:
|
|
- or go back to the newest paste.
1 | --Befehle | |
2 | - | -- Normal Light on [Zone] |
2 | + | -- Red Light on [Zone] |
3 | - | -- Normal Light off [Zone] |
3 | + | -- Red Light off [Zone] |
4 | ||
5 | --Variablen | |
6 | - | wModul = "left" --Angabe fΓΌr die Position des Wirless Modems |
6 | + | wModul = "bottom" --Angabe fΓΌr die Position des Wirless Modems |
7 | - | Zone = "Gang-Zentrale" |
7 | + | Zone = "Aussenlampen" |
8 | NormalLight = true | |
9 | RedLight = false | |
10 | ||
11 | --Code | |
12 | function Command() | |
13 | senderId, message, protocol = rednet.receive("1900Light") | |
14 | - | if (message == "Normal Light on " .. Zone or message == "Normal Light on ALL") then |
14 | + | if (message == "Red Light on " .. Zone or message == "Red Light on ALL") then |
15 | RedLight = true | |
16 | - | redstone.setOutput("front", NormalLight) |
16 | + | redstone.setOutput("top", RedLight) |
17 | - | rednet.send(senderId, NormalLight, "1900Light") |
17 | + | rednet.send(senderId, RedLight, "1900Light") |
18 | ||
19 | - | elseif (message == "Normal Light off " .. Zone or message == "Normal Light off ALL") then |
19 | + | elseif (message == "Red Light off " .. Zone or message == "Red Light off ALL") then |
20 | - | NormalLight = false |
20 | + | |
21 | - | redstone.setOutput("front", NormalLight) |
21 | + | redstone.setOutput("top", RedLight) |
22 | - | rednet.send(senderId, NormalLight, "1900Light") |
22 | + | rednet.send(senderId, RedLight, "1900Light") |
23 | end | |
24 | Dashboard() | |
25 | end | |
26 | ||
27 | function Dashboard() | |
28 | shell.run("clear") | |
29 | print("Lichtkontroll Einheit") | |
30 | print("FΓΌr die Zone: " .. Zone) | |
31 | print() | |
32 | - | print("Normales Licht: " .. tostring(NormalLight)) |
32 | + | print("Normales Licht: " .. "Wurde komplett deaktiviert!") |
33 | - | print("Rotes Licht: " .. "Wurde komplett deaktiviert!") |
33 | + | print("Rotes Licht: " .. tostring(RedLight)) |
34 | end | |
35 | ||
36 | --Einmal Code | |
37 | rednet.open(wModul) | |
38 | Dashboard() | |
39 | ||
40 | - | if NormalLight == true then |
40 | + | if RedLight == true then |
41 | - | redstone.setOutput("front", true) |
41 | + | redstone.setOutput("top", true) |
42 | else | |
43 | - | redstone.setOutput("front", false) |
43 | + | redstone.setOutput("top", false) |
44 | end | |
45 | ||
46 | while true do | |
47 | Command() | |
48 | end |