Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- * BII_C Weichenmanager
- * Personen-Cargo-Verteil-Programm
- * FOR Minecraft-Mod: cc-tweaked-1.18.2-1.100.4
- * in LUA
- * © Robin Nahrstedt 2022
- ]]
- -- ##### Variablen #####
- strecke_sc = 0
- strecke_af = 0
- strecke_ef = 0
- -- ##### Funktionen #####
- -- ##### Hauptprogramm #####
- rednet.open("top")
- while true do
- id, message = rednet.receive(nil,1)
- if not id then
- sleep(0.1)
- else
- print("ID: ", id)
- print("Nachricht", message)
- end
- if redstone.getInput("right") and strecke_af == 0 then
- strecke_af = 1
- print("right, 0")
- -- rednet.send(PC, "0")
- elseif redstone.getInput("right") and strecke_af == 1 then
- strecke_af = 0
- print("right, 1")
- -- rednet.send(PC, "1")
- end
- if redstone.getInput("back") and strecke_sc == 0 then
- strecke_sc = 1
- print("left, 0")
- elseif redstone.getInput("back") and strecke_sc == 1 then
- strecke_sc = 0
- print("left, 1")
- end
- if strecke_sc == 1 then
- redstone.setOutput("left", false)
- elseif strecke_sc == 0 then
- redstone.setOutput("left", true)
- end
- if message == 1 then
- redstone.setOutput("bottom", false)
- elseif message == 0 then
- redstone.setOutput("bottom", true)
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment