Advertisement
Guest User

startup

a guest
Sep 1st, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.98 KB | None | 0 0
  1. local reactor = peripheral.wrap("bottom")
  2. local rsetup = {0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,2,1,1,1,0,0,1,1,1,2,1,1,1,0,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0}
  3. local objn = {[0]="ic2.reactorVentGold",[1]="ic2.reactorCoolantSix",[2]="ic2.reactorUraniumQuad"}
  4.  
  5. function checkSetupSlot(slot)
  6.      for k,v in pairs(rsetup)do
  7.           if(k==slot)then
  8.               local itm = reactor.getStackInSlot(slot)
  9.                   if(itm~=nil)then
  10.                         if(itm.name==objn[rsetup[slot]])then
  11.                             if(rsetup[slot]==2)then
  12.                                --CONTROLL F壟F½R URANIUM ENERGIE ZUM ERSETZN
  13.                                return true;
  14.                             else
  15.                                return true;  
  16.                             end
  17.                         else
  18.                            reactor.pushItem("down",slot)
  19.                            return false;
  20.                         end
  21.                    else
  22.                       return false;
  23.                    end
  24.           end
  25.       end
  26. end
  27.  
  28. function lookingForSlot()
  29.  
  30. end
  31.  
  32. while true do
  33.   for slot=1,54 do
  34.       while checkSetupSlot(slot)==false do
  35.          local sl = 1
  36.          rs.setOutput("top",true)
  37.          if(rsetup[slot]==0)then
  38.             print("Slot: "..slot.." added new vent..")
  39.             while reactor.pullItem("west",sl,1)==0 do
  40.                if(sl<27)then sl=sl+1 else sl=1; end
  41.             end
  42.          elseif(rsetup[slot]==1)then
  43.             print("Slot: "..slot.." added new coolant..")
  44.             while reactor.pullItem("north",sl,1)==0 do
  45.                if(sl<27)then sl=sl+1 else sl=1; end
  46.             end            
  47.          elseif(rsetup[slot]==2)then
  48.             print("Slot: "..slot.." added new uranium..")
  49.             rs.setOutput("right",true)
  50.             sleep(0.25)
  51.             rs.setOutput("right",false)          
  52.          end
  53.          sleep(0.025)
  54.       end  
  55.       rs.setOutput("top",false)
  56.   end
  57. sleep(0.025)
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement