Advertisement
FERROUSSAGE

matrica robot

Sep 27th, 2021 (edited)
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. local robot = require("robot")
  2. local component = require("component")
  3. local sides = require("sides")
  4. local inventory = component.inventory_controller
  5.  
  6. local WAND_NAME = "Thaumcraft:WandCasting"
  7.  
  8. function equipItem(nameItem)
  9.     if nameItem ~= nil then
  10.         for i = 1, robot.inventorySize() do
  11.             local item = inventory.getStackInInternalSlot(i)
  12.             if item and item.name and item.name == nameItem then
  13.                 robot.select(i)
  14.                 inventory.equip()
  15.                 print(1)
  16.             end
  17.         end
  18.     else
  19.         robot.select(1)
  20.         inventory.equip()
  21.         print(2)
  22.     end
  23. end
  24.  
  25. while true do
  26.     equipItem(WAND_NAME)
  27.  
  28.     print(robot.use(sides.front))
  29.  
  30.     os.sleep(1)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement