Advertisement
MrBarry

clockSlave

Sep 22nd, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --[[
  2.     clockSlave
  3.     Written for dan200's ComputerCraft 1.41
  4.     Written by MrBarry Sept. 2012
  5.     Requires: clockWriter, numbers
  6. ]]--
  7. os.loadAPI("clockWriter")
  8. mon = peripheral.wrap("back")
  9. rednet.open("top")
  10. mon.setTextScale(3.5)
  11. tmX, tmY = term.getSize()
  12. tClockX = tmX - 5
  13. fnt = clockWriter.readFont(7, 4, 10, "numbers")
  14. ------------------
  15.  
  16. while true do
  17.   evt, id, msg = os.pullEvent("rednet_message")
  18.  if msg:find("^!time%d.*") then
  19.     clockWriter.printTime(msg:sub(6), fnt, mon)
  20.     term.setCursorPos(tClockX,1)
  21.     print(msg:sub(6))
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement