Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs < 1 then
- print("Usage: reader <side>")
- return
- end
- side = tArgs[1]
- print("Ender device on the "..side)
- c = peripheral.wrap(side)
- print(e)
- print("Which file shall I read ?")
- f = fs.open(io.read(), "r")
- assert(f)
- line = ""
- j = 0
- k = 0
- color = {}
- while true do
- line = f.readLine()
- if line == nil then
- break
- end
- j = j+1
- color[j] = {}
- for i,v in string.gmatch(line, "%d+") do
- table.insert(color[j], i)
- -- k = k+1
- -- color[j][(k%3)+1] = i
- end
- table.insert(color[j], line)
- print(2^color[j][1], 2^color[j][2], 2^color[j][3])
- end
- for i=1,#color do
- c.setColors(2^color[i][1], 2^color[i][2], 2^color[i][3])
- print(color[i][4])
- os.pullEvent()
- while rs.getInput("front") == false do
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement