Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("back")
- m.open(1)
- mon = peripheral.wrap("monitor_2")
- mon.clear()
- mon2 = peripheral.wrap("monitor_3")
- mon2.clear()
- p = peripheral.wrap("printer_0")
- d = peripheral.wrap("drive_0")
- d2 = peripheral.wrap("drive_5")
- if d.isDiskPresent() or d2.isDiskPresent() do
- d.ejectDisk()
- d2.ejectDisk()
- m.transmit(1,1,"Ejecting disks...")
- end
- dvar = false
- dvar2 = false
- while true do
- mon.setTextColor(colors.green)
- mon2.setTextColor(colors.green)
- mon.setCursorPos(1,1)
- mon.write("Drive 1:")
- mon.setCursorPos(1,3)
- mon.write("Path:")
- mon.setCursorPos(1,5)
- mon.write("Files: ")
- mon2.setCursorPos(1,1)
- mon2.write("Drive 2:")
- mon2.setCursorPos(1,3)
- mon2.write("Path:")
- mon2.setCursorPos(1,5)
- mon2.write("Files: ")
- mon.setTextColor(colors.red)
- mon2.setTextColor(colors.red)
- sleep(0.2)
- if dvar == false then
- if d.isDiskPresent() then
- m.transmit(1,1,"Reading disk on drive: 1")
- dvar = true
- dname = d.getDiskLabel()
- path = d.getMountPath()
- dfiles = fs.list(path)
- mon.clear()
- mon.setCursorPos(1,2)
- mon.write(dname)
- mon.setCursorPos(1,4)
- mon.write(path.."/")
- for i = 1,#dfiles do
- y = i + 5
- mon.setCursorPos(1,y)
- mon.write(dfiles[i])
- sleep(0.5)
- end
- m.transmit(1,1,"Finished reading disk on drive: 1")
- end
- else
- if not d.isDiskPresent() then
- dvar = false
- mon.clear()
- m.transmit(1,1,"Disk removed from drive: 1")
- end
- end
- if dvar2 == false then
- if d2.isDiskPresent() then
- m.transmit(1,1,"Reading disk on drive: 2")
- dvar2 = true
- dname2 = d2.getDiskLabel()
- path2 = d2.getMountPath()
- dfiles2 = fs.list(path2)
- mon2.clear()
- mon2.setCursorPos(1,2)
- mon2.write(dname2)
- mon2.setCursorPos(1,4)
- mon2.write(path2.."/")
- for i = 1,#dfiles2 do
- y = i + 5
- mon2.setCursorPos(1,y)
- mon2.write(dfiles2[i])
- sleep(0.5)
- end
- m.transmit(1,1,"Finished reading disk on drive: 2")
- end
- else
- if not d2.isDiskPresent() then
- dvar2 = false
- mon2.clear()
- m.transmit(1,1,"Disk removed from drive: 2")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment