Last active
August 11, 2023 19:47
-
-
Save bananasov/ddf26176d8227cf8ec0bd711dc25cc90 to your computer and use it in GitHub Desktop.
Create powah! charged snowballs using turtles and UPW
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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