Advertisement
fingercomp

ROBOT/autorun.lua

Oct 25th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local PORT = 666
  2. ---===---
  3. local com = require("component")
  4. local modem = com.modem
  5. local craft = com.crafting
  6. local inv = com.inventory_controller
  7. local robot = require("robot")
  8. local event = require("event")
  9. local comp = require("computer")
  10.  
  11. modem.open(PORT)
  12. robot.select(8)
  13. while true do
  14.   data={event.pull("modem_message")}
  15.   print(table.unpack(data))
  16.   if data[1] ~= nil then
  17.     if data[6] == "craft" then
  18.       print(data[6])
  19.       craft.craft()
  20.       robot.drop()
  21.     elseif data[6] == "clear" then
  22.       for i =1, 9, 1 do
  23.         local slot = i + math.floor((i - 1) / 3)
  24.         robot.select(slot)
  25.         robot.drop()
  26.       end
  27.       robot.select(8)
  28.       robot.drop()
  29.     end
  30.   end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement