Advertisement
LDDestroier

Floppynet Chatroom

Aug 25th, 2014
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. term.clear()
  2. if disk.isPresent("left")==true then
  3.   side = "left"
  4. end
  5. if disk.isPresent("right")==true then
  6.   side = "right"
  7. end
  8. if disk.isPresent("top")==true then
  9.   side = "top"
  10. end
  11. if disk.isPresent("bottom")==true then
  12.   side = "bottom"
  13. end
  14. print(side)
  15. if disk.getLabel(side)==nil then
  16.   print("There is an invalid disk/object in the " .. side .. "disk drive. Put a valid disk with a label into it.")
  17.   sleep(5)
  18.   os.reboot()
  19. end
  20. local log = fs.open("disk/chatlog", "a")
  21. while true do
  22.   local event, key = os.pullEvent("char")
  23.   key = keys.getName(key)
  24.   print(log.readAll)
  25.   if key == "enter" then
  26.     log.writeLine("")
  27.   else
  28.     log.write(key)
  29.   end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement