Advertisement
natie3

Displaytext

Oct 31st, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. cb = peripheral.wrap("left")
  2. sm = peripheral.wrap("right")
  3. sp = peripheral.wrap("back")
  4. mon = peripheral.wrap("top")
  5. a = {"","","","","","","","","","","","","","","","","","","","","","","","","",""}
  6. x = 0
  7.  
  8. local function display()
  9.   mon.clear()
  10.   for i = 1 , 26 do
  11.     mon.setCursorPos(1,i)
  12.     mon.write(a[i])
  13.   end
  14. end
  15.  
  16. local function move(message)
  17.   for i = 2, 26 do
  18.     a[i-1] = a[i]
  19.   end
  20.   a[26] = message
  21. end
  22.  
  23. while rs.getInput("bottom", true) do
  24.   e,player,message = os.pullEvent("chat")
  25.   print(e)
  26.   sp.speak(message)
  27.   sm.send("smarthelmet",player..": "..message, 10000000)
  28.   if x == 26 then
  29.     move(player..": "..message)
  30.   else
  31.     x = x + 1
  32.   end
  33.   a[x] = player..": "..message
  34.   display()
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement