Advertisement
maxtorcd55

Untitled

Jun 8th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. local p = peripheral.wrap("top")
  2.  
  3. while (true) do
  4.  
  5.     local t = p.getNamesRemote()
  6.  
  7.     for i = 1, #t do
  8.             if string.find(string.lower(t[i]), "reactor") then
  9.                     kern1 = peripheral.wrap(t[i])
  10.             end
  11.             if string.find(string.lower(t[i]), "ender") then
  12.                     ender = peripheral.wrap(t[i])
  13.             end
  14.  
  15.     end    
  16.  
  17.  
  18.    
  19.  
  20.     kern1stack = kern1.getAllStacks()
  21.     enderstack = ender.getAllStacks()
  22.     kern1inv = kern1.getInventorySize()
  23.     enderinv = ender.getInventorySize()
  24.  
  25.         for i=1, kern1inv do
  26.                 if kern1stack[i] ~= nil then
  27.  
  28.                         if kern1stack[i]["rawName"] == "ic2.reactorventgold" then
  29.                                 if kern1stack[i]["dmg"] <= 0 then
  30.                     local slot
  31.                     slot = 1
  32.                             while (not kern1.pushItem("up",i,1,slot)) and (slot < 10) do
  33.                         slot = slot + 1
  34.                         kern1.pushItem("up",i,1,slot)
  35.                             end
  36.  
  37.                                 end
  38.                         end
  39.                 end
  40.         end
  41.  
  42.         for i=1, enderinv do
  43.                 if enderstack[i] ~= nil then
  44.  
  45.                         if enderstack[i]["rawName"] == "ic2.reactorventgold" then
  46.                                 if enderstack[i]["dmg"] > 1 then
  47.                     ender.pushItem("down",i,1)
  48.                                 end
  49.                         end
  50.                 end
  51.         end
  52.  
  53.  
  54.  
  55.  
  56.     sleep(1)
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement