Advertisement
Guest User

Untitled

a guest
May 9th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local inventory = require("component").inventory_controller
  2. local side = require("sides").front
  3.  
  4. local fuel_names = { ["minecraft:coal"] = true, ["minecraft:planks"] = true, ["minecraft:log"] = true, ["minecraft:blaze_rod"] = true, ["minecraft:lava_bucket"] = true}
  5.  
  6. local function getCoal(stack_info)
  7.     if computer.energy() <= 200 then
  8.         robot.select(5); robot.drop(); robot.select(16); robot.drop()
  9.         robot.select(14); robot.place(); robot.select(15)
  10.         return fuel_names[stack_info]
  11.     end
  12.    
  13.     for slot=1,27 do
  14.         local item = inventory.getStackInSlot(side, slot)
  15.         if item and fuel_names[item.id] then
  16.             inventory.suckFromSlot(sides.front, slot)
  17.             break
  18.         end
  19.     end
  20.     robot.select(16); inventory.dropIntoSlot(side, 1); robot.select(5); robot.swing(); robot.transferTo(14)
  21. end
  22.  
  23. getCoal("minecraft:planks")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement