MagmaLP

Ghast Counter

Mar 21st, 2021 (edited)
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mon = peripheral.wrap("back")
  2. mon.setBackgroundColor(colors.lime)
  3. mon.setTextScale(5)
  4. mon.clear()
  5.  
  6. file = fs.open("Count", "r")
  7. x = file.readLine()
  8. file.close()
  9.  
  10. mon.setCursorPos(1,2)
  11. mon.setTextColor(colors.black)
  12. mon.write(" Ghast Count: ")
  13. mon.setCursorPos(1,3)
  14. mon.write("    "..x.."       ")
  15.  
  16. while true do
  17.     if rs.getInput("left") then
  18.         x = x + 1
  19.         file = fs.open("Count", "w")
  20.         file.write(x)
  21.         file.close()
  22.         mon.setCursorPos(1,3)
  23.         mon.write("    "..x.."       ")
  24.         sleep(3)
  25.     end
  26. sleep(0.5)
  27. end
  28.  
Add Comment
Please, Sign In to add comment