Advertisement
Devocity

[ComputerCraft / Powah] Terribly Inefficient Automated Charging Orb

Sep 21st, 2021
1,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.17 KB | None | 0 0
  1. local station = peripheral.find("powah:energizing_orb")
  2. local recipe = {}
  3. local stationlist = {}
  4. local slot1 = ""
  5. local slot2 = ""
  6. local slot3 = ""
  7. local slot4 = ""
  8.  
  9. local stationslot1 = ""
  10. local stationslot2 = ""
  11. local stationslot3 = ""
  12. local stationslot4 = ""
  13.  
  14. local firstLoop = true
  15. while true do
  16.     if not (turtle.getSelectedSlot() == 5) then
  17.         turtle.select(5)
  18.     end
  19.    
  20.    
  21.     if turtle.getItemDetail(5) then
  22.         slot1 = turtle.getItemDetail(5).name
  23.     else
  24.         slot1 = ""
  25.     end
  26.     if turtle.getItemDetail(6) then
  27.         slot2 = turtle.getItemDetail(6).name
  28.     else
  29.         slot2 = ""
  30.     end
  31.     if turtle.getItemDetail(7) then
  32.         slot3 = turtle.getItemDetail(7).name
  33.     else
  34.         slot3 = ""
  35.     end
  36.     if turtle.getItemDetail(8) then
  37.         slot4 = turtle.getItemDetail(8).name
  38.     else
  39.         slot4 = ""
  40.     end
  41.    
  42.     recipe = {slot1, slot2, slot3, slot4}
  43.    
  44.     for i=5,8 do
  45.         turtle.select(i)
  46.         if turtle.getItemDetail(turtle.getSelectedSlot()) then
  47.             turtle.drop(1)
  48.         end
  49.     end
  50.    
  51.     if station.getItemDetail(2) then
  52.         stationslot1 = station.getItemDetail(2).name
  53.     else
  54.         stationslot1 = ""
  55.     end
  56.     if station.getItemDetail(3) then
  57.         stationslot2 = station.getItemDetail(3).name
  58.     else
  59.         stationslot2 = ""
  60.     end
  61.     if station.getItemDetail(4) then
  62.         stationslot3 = station.getItemDetail(4).name
  63.     else
  64.         stationslot3 = ""
  65.     end
  66.     if station.getItemDetail(5) then
  67.         stationslot4 = station.getItemDetail(5).name
  68.     else
  69.         stationslot4 = ""
  70.     end
  71.     stationlist = {stationslot1, stationslot2, stationslot3, stationslot4}
  72.  
  73.     while stationlist[1] == recipe[1] do
  74.         if station.getItemDetail(2) then
  75.             stationslot1 = station.getItemDetail(2).name
  76.         else
  77.             stationslot1 = ""
  78.         end
  79.         if station.getItemDetail(3) then
  80.             stationslot2 = station.getItemDetail(3).name
  81.         else
  82.             stationslot2 = ""
  83.         end
  84.         if station.getItemDetail(4) then
  85.             stationslot3 = station.getItemDetail(4).name
  86.         else
  87.             stationslot3 = ""
  88.         end
  89.         if station.getItemDetail(5) then
  90.             stationslot4 = station.getItemDetail(5).name
  91.         else
  92.             stationslot4 = ""
  93.         end
  94.         stationlist = {stationslot1, stationslot2, stationslot3, stationslot4}
  95.         sleep(0.5)
  96.         print("Not Ready")
  97.     end
  98.     print("Ready")
  99.     turtle.select(1)
  100.     turtle.suck(1)
  101.     recipe = {}
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement