Advertisement
SirBaconBitz

Glass Input Computer

May 25th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. rednet.open("right")
  2. redstone.setOutput("left", false)
  3. while true do
  4.   words = {}
  5.   e, msg, d, b, c = os.pullEvent("chat_command")
  6.   for word in msg:gmatch('%S+') do
  7.     table.insert(words, word)
  8.   end
  9.   if words[1] ~= "goto" then
  10.     print("Invalid command")
  11.   else
  12.     x = words[2]
  13.     y = words[3]
  14.     z = words[4]
  15.     rednet.broadcast("incoming")
  16.     if not rednet.receive(2) then
  17.       print("Something went wrong!")
  18.     end
  19.     rednet.broadcast(x)
  20.     rednet.broadcast(y)
  21.     rednet.broadcast(z)
  22.     id, msg = rednet.receive(2)
  23.     if msg == "complete" then
  24.       print("Successfully sent!")
  25.     else
  26.       print("Coords not received")
  27.     end
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement