init
This commit is contained in:
commit
12ffbdc45d
76 changed files with 79368 additions and 0 deletions
47
computer/0/startup.lua
Normal file
47
computer/0/startup.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
noteblock = peripheral.wrap("right")
|
||||
speaker = peripheral.wrap("left")
|
||||
instruments = {
|
||||
"harp",
|
||||
"bass",
|
||||
"didgeridoo",
|
||||
"xylophone",
|
||||
"iron_xylophone",
|
||||
"snare",
|
||||
"hat",
|
||||
"basedrum",
|
||||
"bit",
|
||||
"bit",
|
||||
"bit",
|
||||
"bit"
|
||||
}
|
||||
mobs = {
|
||||
"skeleton",
|
||||
"zombie",
|
||||
"pig",
|
||||
"cow",
|
||||
"spider"
|
||||
}
|
||||
function sound()
|
||||
while true do
|
||||
if math.random(10)>5 then
|
||||
speaker.playSound("entity."..mobs[math.random(#mobs)]..".ambient")
|
||||
elseif math.random(100) < 95 then
|
||||
noteblock.setInstrument(instruments[math.random(#instruments)])
|
||||
noteblock.play()
|
||||
noteblock.setNote(math.random(24))
|
||||
elseif math.random(100) < 50 then
|
||||
for i = 1,5 do
|
||||
speaker.playSound("entity.creeper.step")
|
||||
sleep(0.05)
|
||||
end
|
||||
speaker.playSound("entity.creeper.primed")
|
||||
else
|
||||
--speaker.playSound("BOOM")
|
||||
end
|
||||
sleep(math.random(1,20))
|
||||
--os.reboot()
|
||||
end
|
||||
end
|
||||
parallel.waitForAll(sound,sound,sound,sound,sound)
|
||||
peripheral.call("top","turnOn")
|
||||
-- os.reboot()
|
Loading…
Add table
Add a link
Reference in a new issue