Advertisement
Guest User

bios.lua

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