Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local component = require("component")
- local sides = require("sides")
- local inventory = component.inventory_controller
- local WAND_NAME = "Thaumcraft:WandCasting"
- function equipItem(nameItem)
- if nameItem ~= nil then
- for i = 1, robot.inventorySize() do
- local item = inventory.getStackInInternalSlot(i)
- if item and item.name and item.name == nameItem then
- robot.select(i)
- inventory.equip()
- print(1)
- end
- end
- else
- robot.select(1)
- inventory.equip()
- print(2)
- end
- end
- while true do
- equipItem(WAND_NAME)
- print(robot.use(sides.front))
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement