Advertisement
Guest User

startup

a guest
Apr 22nd, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local modem = peripheral.wrap("left")
  2. local monitor = peripheral.wrap("right")
  3. local positions = {[1]= {[1]="spawn", [2]=856, [3]=21, [4]=-567,},}
  4. monitor.clear()
  5. monitor.setCursorPos(1,1)
  6. modem.open(1)
  7. while true do
  8.     input = {os.pullEvent("modem_message")}
  9.     if type(input[4]) == "number" or type(input[4]) == "string" then
  10.         if type(input[5]) == "string" then
  11.             print(input[4]..":"..input[5])  
  12.             x,y = monitor.getCursorPos()
  13.             monitor.setCursorPos(1,y+1)
  14.             monitor.write(os.time()..":"..os.day()..":"..input[4]..":"..input[5])
  15.             if y == 25 then
  16.                 y = 1
  17.                 monitor.clear()
  18.                 monitor.setCursorPos(1,y)
  19.             end
  20.             if input[5] == "positions" then
  21.                 modem.transmit(1, input[4], textutils.serialise(positions))
  22.             end
  23.         end
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement