From e745f007648f54dd311f201c690371599b8738a1 Mon Sep 17 00:00:00 2001 From: mint Date: Thu, 6 May 2021 00:49:37 -0400 Subject: [PATCH] drive checking business --- neodj.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/neodj.lua b/neodj.lua index 2add82b..e8dba0a 100644 --- a/neodj.lua +++ b/neodj.lua @@ -1,9 +1,21 @@ accentColor = colors.gray buttonColor = colors.lightGray backgroundColor = colors.black -drive = peripheral.find("disk_drive") -if drive == nil then +peripherals = peripheral.getNames() +if #peripherals < 0 then print "No drive" +else + for n = 1, #peripherals do + local driveCheck = peripherals[n] + if peripheral.getType(driveCheck) == "drive" then + drive = driveCheck + driveCount = driveCount + 1 + end + end + if driveCount => 1 then + print("Too many disk drives. Please remove some and try again") + exit() + end end function playDisc()