-
Notifications
You must be signed in to change notification settings - Fork 194
Expand file tree
/
Copy pathdance.lua
More file actions
111 lines (105 loc) · 2.29 KB
/
dance.lua
File metadata and controls
111 lines (105 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
local tMoves = {
function()
turtle.up()
turtle.down()
end,
function()
turtle.up()
turtle.turnLeft()
turtle.turnLeft()
turtle.turnLeft()
turtle.turnLeft()
turtle.down()
end,
function()
turtle.up()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.down()
end,
function()
turtle.turnLeft()
turtle.turnLeft()
turtle.turnLeft()
turtle.turnLeft()
end,
function()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
turtle.turnRight()
end,
function()
turtle.turnLeft()
turtle.back()
turtle.back()
turtle.turnRight()
turtle.turnRight()
turtle.back()
turtle.back()
turtle.turnLeft()
end,
function()
turtle.turnRight()
turtle.back()
turtle.back()
turtle.turnLeft()
turtle.turnLeft()
turtle.back()
turtle.back()
turtle.turnRight()
end,
function()
turtle.back()
turtle.turnLeft()
turtle.back()
turtle.turnLeft()
turtle.back()
turtle.turnLeft()
turtle.back()
turtle.turnLeft()
end,
function()
turtle.back()
turtle.turnRight()
turtle.back()
turtle.turnRight()
turtle.back()
turtle.turnRight()
turtle.back()
turtle.turnRight()
end,
}
textutils.slowWrite( "Preparing to get down." )
textutils.slowPrint( "..", 0.75 )
local sAudio = nil
for n,sName in pairs( peripheral.getNames() ) do
if disk.hasAudio( sName ) then
disk.playAudio( sName )
print( "Jamming to "..disk.getAudioTitle( sName ) )
sAudio = sName
break
end
end
print( "Press any key to stop the groove" )
parallel.waitForAny(
function()
while not bEnd do
local event, key = os.pullEvent("key")
if key ~= keys.escape then
return
end
end
end,
function()
while true do
local fnMove = tMoves[math.random(1,#tMoves)]
fnMove()
end
end
)
if sAudio then
disk.stopAudio( sAudio )
end