Advertisement
Guest User

bios.lua

a guest
Jul 4th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. computer.beep()
  2. drone = component.proxy(component.list("drone")())
  3. computer.beep()
  4. while true do
  5.  computer.beep()
  6.  evt,_,_,msgraw = computer.pullSignal()
  7.  if evt == "chat_message" then
  8.   words = {}
  9.   for word in msgraw:gmatch("%S+") do table.insert(words, word) end
  10.   msg = words[1]
  11.   n=tonumber(words[2])
  12.   if n == nil then n = 1 end
  13.   if msg == "y" then
  14.    drone.move(0,n,0)
  15.   elseif msg == "z" then
  16.    drone.move(0,0,n)
  17.   elseif msg == "x" then
  18.    drone.move(n,0,0)
  19.   end
  20.  end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement