Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lastvalue = {}
- count = {}
- color = {}
- color[1]=" |White | "
- color[2]=" |Orange | "
- color[3]=" |Magenta | "
- color[4]=" |LightBlue | "
- color[5]=" |Yellow | "
- color[6]=" |Lime | "
- color[7]=" |Pink | "
- color[8]=" |Rrey | "
- color[9]=" |LightGrey | "
- color[10]=" |Gyan | "
- color[11]=" |Purple | "
- color[12]=" |Blue | "
- color[13]=" |Brown | "
- color[14]=" |Green | "
- color[15]=" |Red | "
- for i = 1, 15 do
- lastvalue[i] = false
- count[i] = 0
- end
- while x ~= "end" do
- for i = 1, 15 do
- y = rs.getBundledInput("back")
- if lastvalue[i] == false and colors.test(y, 2^(i-1)) then
- count[i] = count[i] +1
- lastvalue[i] = true
- end
- if lastvalue[i] == true and colors.test(y, 2^(i-1)) == false then
- lastvalue[i] = false
- end
- end
- sleep (0.01)
- term.clear()
- print("|Detector |Input |Item |Number of |Signal")
- print("|-----------|-------------|------------|--------------|---------")
- for i = 1, 15 do
- y = rs.getBundledInput("back")
- print("|", i," ", color[i], " ","|",count[i]," ", " "," |",colors.test(y, 2^(i-1)))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment