1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-07-02 01:52:55 +00:00
Jonathan Coates 8fac68386e
Fix usages of global variables
- Lint references to unknown fields of modules, excluding the keys and
   colours modules. This caught several silly errors in our stub files,
   but nothing else.
 - Lint on using unknown globals. This highlighted a couple of really
   silly mistakes. Fixes #427.
 - Add documentation for fs.attributes, fs.getCapacity and pocket, as
   they were not defined before.

Co-authored-by: JackMacWindows <jackmacwindowslinux@gmail.com>
2020-04-28 09:42:34 +01:00

115 lines
2.3 KiB
Lua

if not turtle then
printError("Requires a Turtle")
end
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 _, 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 true do
local _, 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