View difference between Paste ID: t9JKyHF2 and L6WxA20g
SHOW: | | - or go back to the newest paste.
1
while true do
2
    -- Wait for disk
3
    while not fs.exists("/disk/startup") do 
4
        os.pullEvent("disk")
5
        -- might cause problems, maybe use os.pullEvent() without arguments
6
    end
7
8
    -- Launch disk
9
    shell.run("/disk/startup")
10
11
    -- Wait for disk ejection and clear
12
    while fs.exists("/disk/startup") do
13
        os.pullEvent("disk_eject") 
14
        -- might cause problems, maybe use os.pullEvent() without arguments
15
        term.clear()
16
        term.setCursorPos(1, 1)
17
        -- os.reboot() works too to clear the screen
18
    end
19
end