MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 430 forks source link

Suggestion: Custom floppy disks and components.floppydisk API #2240

Closed SinaMegapolis closed 7 years ago

SinaMegapolis commented 7 years ago

Lets make components.floppydisk API 😃

we can create empty writable floppy disks with paper and iron then we can label it with the GUI #1340 suggested *then we can use a computer to write the code we want in it or download the code from internet for write in it: fd = require("components").floppydisk if fd.exist and fd.getLabel = "My floppy" then --is any floppy disk labeled "My Floppy" in the case? fd.addFile("hello") --creates file named hello.lua in the floppy disk --code for writing on hello.lua ..... fd.downloadFile("The url") --returns false if download wasn't successful or an internet card isn't in the case end

*and we can make the writable floppy disks read-only by running this code on a computer: if not fd.isFloppyDiskReadOnly() then --returns false if floppy disk is writable fd.makeFloppyDiskReadOnly("Password") --sets a password for when you want to set floppy disk writable else fd.makeFloppyDiskWritable("Password") --if password isn't correct you will got an error: incorrect password end

*we can get our new floppy disk colored using dye 😄

*we can go to "internet trading center" using internet card and trade our new floppy disks with other floppy disks (the people buys our floppy disks can use floppy disks only in read-only mode but they can copy the contents of floppy disks using fd.copyContents("Directory on hdd") )

So, "open-for-adoption" or "feature-accepted"?

magik6k commented 7 years ago

B.. bu... but writable flopies are already a thing, by inserting a flopy you get filesystem component(http://ocdoc.cil.li/api:filesystem?s[]=filesystem), so floppy disk component doesn't seem too useful. As for making floppies R/O, I think there was some issue about that. Password protection for switching modes doesn't really make sense (What checks/enforces it? Smart magnetic nano-surface?).

SinaMegapolis commented 7 years ago

O_o do you mean we can craft writable floppy disks? o_O (What a noob i am :D ) But.... you know, floppy disk API makes using of floppy disks more noob-friendly :D and for password protection: you're right, it makes no sense. but in "OC Online trading Center" (OTC) the people can use licenses and say that the floppy disk they published is open-source or not :D (use google translate to translate your sentences to "persian" if you can because im not professional at English)

SinaMegapolis commented 7 years ago

and hey, colored floppy disk are fun. aren't they? XD

NickNackGus commented 7 years ago

Try using the filesystem API for reading and writing to the floppy - that API works with any filesystem, including hard disks and floppies. I don't see anything about dying floppies in the documentation, but I believe you can already dye them. If you have Not Enough Items, Just Enough Items, or another mod that reveals item recipes, I would recommend checking them. If I remember right, you just craft a floppy disk with a vanilla dye.

SinaMegapolis commented 7 years ago

yeah you are right image image but my suggestion about OTC is good for accept right? :D

magik6k commented 7 years ago

For OTC there is a package manager called OPPM(http://ocdoc.cil.li/tutorial:program:oppm?s[]=oppm), you can get many cool programs from it, list is at http://openprograms.github.io/, you also have the forum(https://oc.cil.li/index.php?/forum/34-programs/).