Advertisement
Applepirate

Test

Aug 11th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. os.loadAPI('ocs/apis/sensor')
  2.  
  3. modem = peripheral.wrap('top')
  4. scan = sensor.wrap('front')
  5.  
  6. local channel = {11,21,31,  12,22,32,   13,23,33,   14,24,34}
  7. local coords = {'2,-8,2','2,-7,2','2,-6,2', '1,-8,4','1,-7,4','1,-6,4', '-2,-8,4','-2,-7,4','-2,-6,4',  '-3,-8,2','-3,-7,2','-3,-6,2',}
  8. while rs.getInput('right') == false do
  9.     for i = 1, 12 do
  10.         local stackSum = 0
  11.         chest = chest.getTargetDetails(coords[i])
  12.         for slotNumber = 0,27 do
  13.             local slot = chest.Slots[slotNumber]
  14.             if slot ~= nil then
  15.                 stackSum = stackSum + (slot.Size)
  16.             end
  17.         end
  18.         modem.transmit(channel[i], 1, stackSum)
  19.         print('Sent Data to Channel '..channel[i] .. "Amount: " ..stackSum)
  20.     end
  21.     print('Completed Round. Waiting 5 Seconds')
  22.     sleep(5)
  23.     term.clear()
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement