Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- peripheral.find("modem", rednet.open)
- local monitor = peripheral.find("monitor")
- monitor.setCursorPos(1,1)
- function check_if_disk()
- if disk.isPresent("bottom") == true then
- if disk.hasData("bottom") == true then
- print("has data")
- return true
- elseif disk.hasData("bottom") == false then
- monitor.clear()
- monitor.write("Plese insert correct disk")
- end
- elseif disk.isPresent("bottom") == false then
- monitor.clear()
- monitor.write("Please insert disk")
- end
- end
- function conformation(N)
- local event, side, x, y = os.pullEvent("monitor_touch")
- print("The monitor on side " .. side .. " was touched at (" .. x .. ", " .. y .. ")")
- if y == N then
- print("yes")
- return true
- else
- print("mo")
- return false
- end
- end
- function get_disk_data()
- if check_if_disk() == true then
- local file = fs.open("disk/data.lua", "r")
- print(file)
- if file == nil then
- local Num = 3
- monitor.write("no data")
- monitor.setCursorPos(1,2)
- monitor.write("Create account?")
- monitor.setCursorPos(1,3)
- monitor.write("YES")
- conformation(Num)
- if conformation() == true then
- elseif conformation() == false then
- end
- else
- print("has data")
- end
- end
- end
- get_disk_data()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement