norway240

Computer Craft: Fax Server

Sep 25th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. rednet.open("top") -- Change to the side of your modem
  2. printer = peripheral.wrap("right") -- Change to the side of your printer
  3. while true do
  4.  sleep(0.5)
  5.  
  6.  x,title,z = rednet.receive() -- Receives the title from the client
  7.  print("Title: "..title)
  8.  
  9.  printer.newPage()
  10.  
  11.  printer.setPageTitle(title)
  12.  
  13.  x,lines,z = rednet.receive() -- Receives the amount of lines to print
  14.  print("Lines to write: "..lines)
  15.  
  16.  for i = 1, lines do -- Does this for the amount of lines you told it
  17.   x,linetext,z = rednet.receive() -- Receives the linetext
  18.   printer.setCursorPos(1,i) -- Sets the cursor position to the correct line
  19.   printer.write(linetext) -- Writes the text to the page
  20.   print("Line"..i..": "..linetext)
  21.  end
  22.  printer.endPage()
  23. end
Advertisement
Add Comment
Please, Sign In to add comment