Advertisement
Guest User

startup

a guest
Oct 2nd, 2021
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. term.redirect(peripheral.wrap("left"))
  2. term.clear()
  3.  
  4. local ss = fs.open("ss","r")
  5. local data = ss.readAll()
  6. ss.close()
  7. textutils.unserialise(data)
  8. local stacker = {data}
  9. rednet.open("top")
  10. print("Stacker:")
  11.  
  12. while true do
  13.   senderId, message, protocol = rednet.receive()
  14.         if protocol == "stacker" and senderId == 144 then
  15.      term.clear()
  16.      print("Stacker:")
  17.      table.insert(stacker, message)
  18.      table.sort(stacker, function (a, b)
  19.        return #b < #a
  20.        end)
  21.     local ss = fs.open("ss","w")
  22.     ss.write(table.concat(stacker,'\n'))
  23.     ss.close()
  24.     write(table.concat(stacker,'\n'))
  25.    
  26.  
  27.    
  28. end
  29. end
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement