Posted 08 February 2013 - 11:49 AM
I am building a theme park in Tekkit, and I want to make it so the ticket is made so that the computer check the label. I know what the disk API is, but how do I use it?
local handle = fs.open("disk/myfile", "r")
disk.getMountPath(side)
where side is the side where the disk drive you want to use is.What do you mean by how to use it?
OK. In a nutshell…
When you insert a disk, CC mounts it. YOu can reach its data in disk/ directory, or disk2/ if that's the second mounted disk, or disk3/, etc.
So opening a file from a disk is likelocal handle = fs.open("disk/myfile", "r")
When you have only one disk drive, that's easy like that. But what's up with multiple disk drives?
You can get the path ("disk" or "disk2" etc.) usingwhere side is the side where the disk drive you want to use is.disk.getMountPath(side)
EDIT: Sorry, I misunderstood - I thought you haven't ever used disk API.
if disk.getLabel("top") == "SFTTicket" then
blah blah blah code
end