Skip to content

Instantly share code, notes, and snippets.

@bananasov
Last active August 11, 2023 19:47
Show Gist options
  • Save bananasov/ddf26176d8227cf8ec0bd711dc25cc90 to your computer and use it in GitHub Desktop.
Save bananasov/ddf26176d8227cf8ec0bd711dc25cc90 to your computer and use it in GitHub Desktop.
Create powah! charged snowballs using turtles and UPW
local ball_side = "top"
local orb_side = "front"
local orb = peripheral.wrap(orb_side) or error("Guh")
---@return number
local function get_orb_item_amount()
return #orb.items()
end
while true do
local items = get_orb_item_amount()
if items and items == 0 then
--- pullItem(from: string, itemQuery: ItemQuery?, limit: number?):number
orb.pullItem(ball_side, {
name = "minecraft:snowball",
}, 1)
print("[+] We inserted le ball")
else
if items > 1 then
print("[!] UH OH")
end
end
sleep(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment