sounds
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
local Sound = require('sound')
|
||||||
local Util = require('util')
|
local Util = require('util')
|
||||||
|
|
||||||
local fs = _G.fs
|
local fs = _G.fs
|
||||||
@@ -11,12 +12,27 @@ if not fs.exists(STARTUP_FILE) then
|
|||||||
shell.openForegroundTab('packages/milo/apps/water')]])
|
shell.openForegroundTab('packages/milo/apps/water')]])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local played = false
|
||||||
|
|
||||||
|
local function play(sound)
|
||||||
|
if not played then
|
||||||
|
--played = true
|
||||||
|
Sound.play(sound)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
turtle.placeDown('minecraft:bucket:0')
|
if turtle.placeDown('minecraft:bucket:0') then
|
||||||
turtle.placeDown('minecraft:glass_bottle:0')
|
play('item.bucket.fill')
|
||||||
|
end
|
||||||
|
if turtle.placeDown('minecraft:glass_bottle:0') then
|
||||||
|
play('item.bottle.fill')
|
||||||
|
end
|
||||||
|
|
||||||
for k,v in pairs(turtle.getInventory()) do
|
for k,v in pairs(turtle.getInventory()) do
|
||||||
if v.name == 'minecraft:concrete_powder' or v.name == 'minecraft:gravel' then
|
if v.name == 'minecraft:concrete_powder' or v.name == 'minecraft:gravel' then
|
||||||
turtle.select(k)
|
turtle.select(k)
|
||||||
|
play('block.gravel.break')
|
||||||
for _ = 1, v.count do
|
for _ = 1, v.count do
|
||||||
turtle.placeDown()
|
turtle.placeDown()
|
||||||
turtle.digDown()
|
turtle.digDown()
|
||||||
@@ -24,4 +40,5 @@ while true do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
os.pullEvent('turtle_inventory')
|
os.pullEvent('turtle_inventory')
|
||||||
|
played = false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user