Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local event,param1,param2,param3
- local monitorSide = "left"
- local redstoneInputSide = "right"
- local itemCount = itemCount
- local function color()
- end
- if not fs.exists(".itemCount") then
- file = fs.open(".itemCount","w")
- file.write(itemCount)
- file.close()
- else
- file = fs.open(".itemCount","r")
- itemCount = tonumber(file.readLine())
- file.close()
- end
- monitor = peripheral.wrap(monitorSide)
- term.redirect(monitor)
- monitor.setTextScale(1)
- while true do
- event,param1,param2,param3 = os.pullEvent()
- if event == "redstone" then
- if rs.getInput(redstoneInputSide) == true then
- itemCount = itemCount + 1
- file = fs.open(".itemCount","w")
- file.write(itemCount)
- file.close()
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- print("TubeStats")
- print("")
- print("Items passed:")
- if itemCount > 10 then
- term.setTextColor(colors.black)
- elseif itemCount > 100 then
- term.setTextColor(colors.blue)
- elseif itemCount > 1000 then
- term.setTextColor(colors.lightBlue)
- elseif itemCount > 10000 then
- term.setTextColor(colors.green)
- elseif itemCount > 100000 then
- term.setTextColor(colors.yellow)
- elseif itemCount > 1000000 then
- term.setTextColor(colors.pink)
- elseif itemCount > 10000000 then
- term.setTextColor(colors.red)
- end
- print(" "..itemCount)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment