Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local idChannel = 126
- local numdigit = 0
- local correspondance = {}
- correspondance[0] = { 0,0,0,0,0,0,0 }
- correspondance[1] = { 0,0,0,0,0,0,0 }
- correspondance[2] = { 0,0,0,0,0,0,0 }
- correspondance[3] = { 0,0,0,0,0,0,0 }
- correspondance[4] = { 0,0,0,0,0,0,0 }
- correspondance[5] = { 0,0,0,0,0,0,0 }
- correspondance[6] = { 0,0,0,0,0,0,0 }
- correspondance[7] = { 0,0,0,0,0,0,0 }
- correspondance[8] = { 0,0,0,0,0,0,0 }
- correspondance[9] = { 0,0,0,0,0,0,0 }
- correspondance[10] = { 1,1,1,0,1,1,1 }
- correspondance[11] = { 0,0,1,0,0,1,0 }
- correspondance[12] = { 1,1,0,1,0,1,1 }
- correspondance[13] = { 1,0,1,1,0,1,1 }
- correspondance[14] = { 0,0,1,1,1,1,0 }
- correspondance[15] = { 1,0,1,1,1,0,1 }
- correspondance[16] = { 1,1,1,1,1,0,1 }
- correspondance[17] = { 0,0,1,0,0,1,1 }
- correspondance[18] = { 1,1,1,1,1,1,1 }
- correspondance[19] = { 1,0,1,1,1,1,1 }
- correspondance[20] = { 1,1,0,1,0,1,1 }
- if fs.exists("digit.ini") then
- h = fs.open("digit.ini", "r")
- numdigit = h.readAll()
- h.close()
- else
- h = fs.open("digit.ini", "w")
- print("1er demarrage, indiquer num digit :")
- numdigit = read()
- h.write(numdigit)
- h.close()
- end
- modem = peripheral.wrap("bottom")
- while true do
- modem.open(idChannel)
- event, modemSide, senderChannel, replyChannel, text, senderDistance = os.pullEvent("modem_message")
- if correspondance[text][tonumber(numdigit)] == 1 then
- redstone.setOutput("back", true)
- else
- redstone.setOutput("back", false)
- end
- modem.close(idChannel)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement