I can NOT guarantee responses or being able to help with each individual question, but there is always someone there willing to help (including myself).
ComputerCraft Locked Door Tutorial
for CC 1.2+
I see a lot of requests in ComputerCraft's thread about how to make a locked door so I decided to make this my next tutorial. If you do not have ComputerCraft then go hereto get it and check out my introductory tutorial on ComputerCraft and Lua here.If you are coming from that tutorial, then great! You are about to learn a bunch of new things that can help expand your scripting possibilities!
A locked door? Finally! I've been requesting this for a while! Well we're all busy with our own lives. Dan is busy working on the mod and adding awesomeness while the rest of us are supporting and giving ideas and helping however we can while working on our own projects. Reading scripts and doing your own research is key to learning how to script, or even program! I myself am still a beginner with programming and scripting and I teach what I learn, although now I am farther ahead than a simple door-locking script. A big tip I can give is that you can't always learn just by doing some tutorials; look atthe language's reference sheets and manuals, go see more than one tutorial. Just a tip to help learn, but enough of this. Let's get started!
Yay! Indeed!
First I have to explain a few things; let's start with strings. We're used to working with just numbers from our last tutorial and just numbers, nothing about letters or anything else. So what is a string? A string is variable that can hold information other than just numbers such as symbols and letters, but remember it can hold numbers as well (anything, really).
Let's look at a new function: read() 'read()' lets the user make inputs and whatever is inputted is a string, so if I wanted have the user input a name to be printed on the screen, I'd write:
write("Enter your name: ")
name = read()
print("Hello "..name.."!")
What's that 'write' function you just put there? 'write()' is a function that means the same as 'print()' except 'write()' doesn't put put a blank line after it. I didn't mention this before but 'print()' means "put this text on the screen and end it by starting a blank line". Open your Lua command prompt in Minecraft and enter 'print("Hello")'. Notice how the terminal goes to the next line after the printed text? Now try 'write("Hello")'. This time it printed (or wrote) the text on the screen but after the text it didn't start a new line, it just continued on the same line. The usefulness of this is to make inputs look nicer so if you have “Enter a number: “ followed by a 'read()', it will all be on the same line. Pretty nice, isn't it?There are many other ways to make the terminal look nicer for your programs. For example, let's say you wanted to have two or more inputs but you wanted to ask for the inputs on the same line. This brings up 'term.setCursorPos(<position on screen>)'. Just as it says, it sets the typing cursor's position on the terminal. The terminal works with X/Y axis just like how you learned in Algebra/Geometry in school except imagine the Y axis mirrored; 8 on the Y is a lower line than 3 on the Y. The top-left corner of the terminal is 1,1 (the CC terminal doesn't do zeros or negatives) and it's 18 lines tall and 50 spaces wide. Where you set the cursor is where the beginning of the text you're writing or printing will be.What if we wanted to start printing something again at the top after we already printed some text? How to do that would be 'term.setCursorPos(1,1)' which sets the cursor back to the top-left corner. After this we can print some more text.
Butwait, the text we're writing is overwriting the text that wasalreadythere and is mixing and it's all weird and stuff! That's because we didn't clear the terminal yet. All we did was set the cursor's position and that's all that function does. Clearing the terminal is very easy, though, so don't fret! The function for clearing the terminal is 'term.clear()'. Running this clears the entire terminalof all text but does NOT move the cursor back to 1,1. If we wanted to do both we would writethis:
term.clear()
term.setCursorPos(1,1)
Why did you put 'term.clear()' first? When you run 'term.clear()', it runs just like print and ends by starting on a new line, so whenever we want to clear the screen and put the cursor back at the top we must clear first and then set the cursor's position (remember, programs read from top to bottom just like how we would read it!).
I get all that, but what about the locking door? That's next! This is a little something that'll be part of the program andit can also help you make better things for the user to look at likewhat you see here:
So you've got this nice little building full of diamond you wish to protect, right? All the noobs running around, stealing and griefing, you don't want your Diamond stash to just disappear, right?
Create a small building like you see above (no, you don't need the in there) or even just a small entrance shape in some way, or just simply put a door next to a computer.
Let's get into the actual scripting now! Remember how we created that emptyfile in /.minecraft/mods/Computercraft? Let's go there again and makeanother file and name it 'lock.lua'. Open it in your IDE (Notepad++,gedit, etc.) and copy/paste this into it, but read through it after pasting it! This is exactly what I mean by reading scripts and code,read it yourself and try to get an understanding of what it's doing before reading the explanation. Trust me, it helps learn a lot. Enough of that, here's the script:
term.clear()
term.setCursorPos(1,1)
password = "cheese" --Sets the password
debug = "applesareyummm" --Sets debugging password
write("Enter your password: ")
input = read() --Input the password
term.clear() --Clearing the terminal, and...
term.setCursorPos(1,1) --...THEN setting the cursor position
if input == password then
print("Password Correct!") --If the input is correct!
rs.setOutput("left",true) --Change this and the setOutput to the side the door is on
sleep(2) --Pause for 2 seconds
rs.setOutput("left",false)
os.shutdown() --Shut down the computer
elseif input == debug then
exit() --Exits the program
else
print("Password Incorrect!") --If the input is incorrect! (Oh Noes!)
sleep(2)
os.shutdown() --Shut down the computer
end --Ends the 'if' block
Now the fun part of learning what the heck is going on. Feel free to try running it and see what you can make of it.
First a few potentially confusing things such as the 'rs' in front of 'setOuput'. It means the same as redstone, just shorter. It's just much easier and more productive than typing redstone every time. There are many other things that can be made simpler, such as the 'write' and 'print' functions; you actually don't need the parentheses for them but it really comes down to personal preference, same to redstone functions.
What's that 'elseif' thing? Think about 'if' and 'else', 'if' means "if this is true then do this", 'else' means "if none of the above is true then do this". 'elseif' means almost the same as 'if' except think of it like "if 'if' isn't true, then check if this is true, and if it is then do this". It lets you check multiple things (yes, that means you can have multiple 'elseif's in it) and in that order. Just remember that once something is true in an entire 'if' block that will then move on past the rest of the entire block, so if I have an 'if' with 3 'elseif' and an 'else' and the first 'elseif' is true, it will skip past the last 'else'. I really shouldn't have to explain it this much and you should have gotten exactly what it meant at first because, remember, IT'S LOGICAL! So to explain how I'm using it here, if the input is equal to the debug string, then it will exit the program and go to the computer's shell. This is just a little bypass in case you wanted to access the computer
The comments explain 'os.shutdown()'. It shuts the computer down, of course! Why do I shut down the computer? Because if you don't shutdown the computer, it will go to the command prompt which means whoever is at the computer can simply go to the Lua terminal and turn on a redstone output (Oh Noes, your :Diamond:!)!
Wait, but what if someone goes up to the computer and starts it up, wouldn't that have it go to its command prompt thingie? Don't worry, as there's a good workaround for that! Each computer has an ID and that ID is assigned a folder in your world's save folder. Yes, that means a computer can have a file but no other will (the same applies to floppies)!
So how can that help? We're going to set the computer up so that everytime it starts up it'll run the lock program. To do this, we will copy our lock.lua program and paste it 4 directories up. We'll do this in the computer we'll be using as the lock, so enter that computer and use 'ls' and 'cd' to get to the directory with the lock.lua file (cd 'rom/programs/custom'?). Verify you're in the right folder with the files with 'ls'. Now we'll use the 'cp' program, which is short for copy (yes, we're copying the file). However, there is a startup file there already that we must first remove because the copy command only copies a file and does not overwrite. To delete a file is 'rm <file>' and to copy a file is 'cp <file being copied> <location and filename of new file>'
Enter this into your terminal: rm ../../../startup And this: cp lock.lua ../../../startup
How this works is first there's the program, cp, then the name of the file you want to copy, then the paste save location and filename. Note how it's copying it as a file named startup and it doesn't have the .lua at the end. CC will only startup a file if its name is exactly 'startup'. Also, if you go to your Lua folder you will notice the startup file is not there. In your computer, enter 'id' and it'll tell you the computer's ID number. Now go to '/.minecraft/saves/<world name>/computers' and you should see some folders with numbers as their titles (and if you have played with floppies yet, another folder titled that with the ID's of those disks inside that). If you look in the folder with the ID as the computer gave you, you should see the startup file that you copied in your computer. Whenever you start your computer it will start that file and then shutdown when it's done running.
Enough boring reading, I don't pay you to type, let's run this thing! Hey, you're not paying me, but I'll gladly take donations ! But I'm tired of the constant typing anyways, let's get this thing running!
Go to your computer and enter 'reboot' (this, of course, reboots it, silly!). If it was all done correctly then the computer should load your program. Test it out, enter a password and make sure the door opens and closes correctly, enter an incorrect password and make sure it shuts back down.
All working? Great! Now it's your turn to add stuff! Change it, edit it, be creative and even try to re-script the whole thing.
Please give reviews and your thoughts and suggestions! There are many little changes and additions I'd like to make but cannot fit in at this time. I shall update A.S.A.P to make it as clear and understandable as possible!
Thanks for the support and for all the help from the guys on the IRC! I'm already thinking of ideas for future tutorials!
Check out this program for easy mass-production of floppies on a MP server: Link Removed
Oh wow, I never received a notification I had replies! Excuse me, I'll reply to the questions tomorrow! Thanks for the thanks! Encourages me to make more! :tongue.gif:
after i try to initiate the "cp lock.lua ../../../startup" command, i get an "access denied" message. why is that?
I was not able to copy the file over either but there is a somewhat easier way to do this go to the computer and type "edit startup" then the code we are using from this forum has to be typed in (I know its kinda hard I like to copy paste lol) Be sure to press ctrl and then save the changes then reboot the PC and it will ask for your password like it should! Also dont worry it only applies to the PC you edited the startup all others will still work the same. Hope this helps!
I was not able to copy the file over either but there is a somewhat easier way to do this go to the computer and type "edit startup" then the code we are using from this forum has to be typed in (I know its kinda hard I like to copy paste lol) Be sure to press ctrl and then save the changes then reboot the PC and it will ask for your password like it should! Also dont worry it only applies to the PC you edited the startup all others will still work the same. Hope this helps!
Oh jeez, forgive me please, I forgot something you have to do before you copy and that's to remove the first startup file because cp can't overwrite existing files.
Before you copy, run 'rm ../../../startup' and then you run the copy command. I'll add this to the tut asap once I'm home!
i have a question. i'm trying to make a script to lock my computer unless i type the right password, but i need to know some kind of command of something to close the program and continue on with using the computer normally.
i have a question. i'm trying to make a script to lock my computer unless i type the right password, but i need to know some kind of command of something to close the program and continue on with using the computer normally.
The problem is the program to lock the door replaces the startup for that particular PC. If you want you can set the PC to not shut down if the correct pass is typed
if input == password then
print("Password Correct!") --If the input is correct!
rs.setOutput("left",true) --Change this and the setOutput to the side the door is on
sleep(2) --Pause for 2 seconds
rs.setOutput("left",false)
os.shutdown() --Shut down the computer
Note: This is only part of the code for this program the rest is on the 1st post of course :smile.gif:
Just remove the os.shutdown() from the code shown here and after the pause period (might be good to extend it to 5)The PC will allow you to do everything else that you normally do on the PC.
i have a question. i'm trying to make a script to lock my computer unless i type the right password, but i need to know some kind of command of something to close the program and continue on with using the computer normally.
The problem is the program to lock the door replaces the startup for that particular PC. If you want you can set the PC to not shut down if the correct pass is typed
if input == password then
print("Password Correct!") --If the input is correct!
rs.setOutput("left",true) --Change this and the setOutput to the side the door is on
sleep(2) --Pause for 2 seconds
rs.setOutput("left",false)
os.shutdown() --Shut down the computer
Note: This is only part of the code for this program the rest is on the 1st post of course :smile.gif:
Just remove the os.shutdown() from the code shown here and after the pause period (might be good to extend it to 5)The PC will allow you to do everything else that you normally do on the PC.
There is a way to do this and I will add it to the tutorial, and that's the 'elseif' statement.
ive been messing around with this mod and trying to impliment some sort of loop such a s afor loop and also a repeat statement. I get it to work no problem however eventually after running for maybe 3 seconds or soy an error comes up saying "Too long without yielding",
it seems the mod can only handle a repeating statement iterating only so many times before it has to close the program. Does anyone know how to fix this.
Id like to make it so that the program can be waiting for input indefinitely.
ive been messing around with this mod and trying to impliment some sort of loop such a s afor loop and also a repeat statement. I get it to work no problem however eventually after running for maybe 3 seconds or soy an error comes up saying "Too long without yielding",
it seems the mod can only handle a repeating statement iterating only so many times before it has to close the program. Does anyone know how to fix this.
Id like to make it so that the program can be waiting for input indefinitely.
I think i know what you're talking about. That's easily doable with something called passEvent which is run inside a while true loop. Try looking it up in the help files for now and I'll check to see if there's been documentation on it yet or not. If not I'll produce some because it is an excellent tool.
is there any way to copy paste or anything for fast production?
To copy files? cp <file being copied> <location and name of new file>
To do this faster and with great production rate like if you were mass-producing floppies? Make a script that, whenever a disk is inserted, automatically copies the file to it. This is possible with the pullEvent function.
Here's a short program I wrote that copies the file to a disk when inserted and then ejects it. I also challenge anyone seeing this to increase its user friendliness and usefulness . Try things like checking if fileIn is actually there to be copied or user input for fileIn and fileOut.
local side = "left" -- side disk drive is on
local fileIn = "tocopy.txt" -- input file
local fileOut = "/disk/copied.txt" -- output file
local numberMade = 0 -- keeps track of how many were made
--Make lines 6-9 a function!-- -- it's a good idea to keep comments orderly like this
term.clear() -- clears terminal
term.setCursorPos(1,1) -- sets cursor position
print("Copies made: "..tostring(numberMade)) -- prints number of copies made
print("Press Q to quit.") --You may want to try clearing the screen at the start, too!
while true do
event, param = os.pullEvent()
if event == "disk" then
shell.run("/rom/programs/copy", fileIn, fileOut) -- runs 'copy' (copy) with the variables
numberMade = numberMade + 1 -- add one to the count
disk.eject(side)
term.clear() --You can call function you can make above here
term.setCursorPos(1,1)
print(numberMade)
print("Press Q to quit")
end
if event == "char" and param == "q" then -- if Q is pushed
break -- 'break' is an automatic and sudden exit for loops (will exit the while loop)
end
end
--Make a nicer exit!--
Here's my beefed-up version of this: Link Removed
Made a video of it here: Link Removed
2 questions,
Trying to rm startup gives me access denied (on my server, if that helps). How do I get it done?
How do I get the computer to detect disks I put into a drive, determine if the password is written there and opens the door accordingly?
I see a lot of requests in ComputerCraft's thread about how to make a locked door so I decided to make this my next tutorial. If you do not have ComputerCraft then go here to get it and check out my introductory tutorial on ComputerCraft and Lua here. If you are coming from that tutorial, then great! You are about to learn a bunch of new things that can help expand your scripting possibilities!
A locked door? Finally! I've been requesting this for a while!
Well we're all busy with our own lives. Dan is busy working on the mod and adding awesomeness while the rest of us are supporting and giving ideas and helping however we can while working on our own projects. Reading scripts and doing your own research is key to learning how to script, or even program! I myself am still a beginner with programming and scripting and I teach what I learn, although now I am farther ahead than a simple door-locking script. A big tip I can give is that you can't always learn just by doing some tutorials; look atthe language's reference sheets and manuals, go see more than one tutorial. Just a tip to help learn, but enough of this. Let's get started!
Yay!
Indeed!
First I have to explain a few things; let's start with strings. We're used to working with just numbers from our last tutorial and just numbers, nothing about letters or anything else. So what is a string? A string is variable that can hold information other than just numbers such as symbols and letters, but remember it can hold numbers as well (anything, really).
Let's look at a new function: read()
'read()' lets the user make inputs and whatever is inputted is a string, so if I wanted have the user input a name to be printed on the screen, I'd write:
What's that 'write' function you just put there?
'write()' is a function that means the same as 'print()' except 'write()' doesn't put put a blank line after it. I didn't mention this before but 'print()' means "put this text on the screen and end it by starting a blank line". Open your Lua command prompt in Minecraft and enter 'print("Hello")'. Notice how the terminal goes to the next line after the printed text? Now try 'write("Hello")'. This time it printed (or wrote) the text on the screen but after the text it didn't start a new line, it just continued on the same line.
The usefulness of this is to make inputs look nicer so if you have “Enter a number: “ followed by a 'read()', it will all be on the same line. Pretty nice, isn't it? There are many other ways to make the terminal look nicer for your programs. For example, let's say you wanted to have two or more inputs but you wanted to ask for the inputs on the same line. This brings up 'term.setCursorPos(<position on screen>)'. Just as it says, it sets the typing cursor's position on the terminal. The terminal works with X/Y axis just like how you learned in Algebra/Geometry in school except imagine the Y axis mirrored; 8 on the Y is a lower line than 3 on the Y. The top-left corner of the terminal is 1,1 (the CC terminal doesn't do zeros or negatives) and it's 18 lines tall and 50 spaces wide. Where you set the cursor is where the beginning of the text you're writing or printing will be. What if we wanted to start printing something again at the top after we already printed some text? How to do that would be 'term.setCursorPos(1,1)' which sets the cursor back to the top-left corner. After this we can print some more text.
Butwait, the text we're writing is overwriting the text that wasalreadythere and is mixing and it's all weird and stuff!
That's because we didn't clear the terminal yet. All we did was set the cursor's position and that's all that function does. Clearing the terminal is very easy, though, so don't fret! The function for clearing the terminal is 'term.clear()'. Running this clears the entire terminalof all text but does NOT move the cursor back to 1,1. If we wanted to do both we would writethis:
Why did you put 'term.clear()' first?
When you run 'term.clear()', it runs just like print and ends by starting on a new line, so whenever we want to clear the screen and put the cursor back at the top we must clear first and then set the cursor's position (remember, programs read from top to bottom just like how we would read it!).
I get all that, but what about the locking door?
That's next! This is a little something that'll be part of the program andit can also help you make better things for the user to look at likewhat you see here:
--------------------------------------------------------------------------------------------------
So you've got this nice little building full of diamond you wish to protect, right? All the noobs running around, stealing and griefing, you don't want your Diamond stash to just disappear, right?
Create a small building like you see above (no, you don't need the in there) or even just a small entrance shape in some way, or just simply put a door next to a computer.
Let's get into the actual scripting now! Remember how we created that emptyfile in /.minecraft/mods/Computercraft? Let's go there again and makeanother file and name it 'lock.lua'. Open it in your IDE (Notepad++,gedit, etc.) and copy/paste this into it, but read through it after pasting it! This is exactly what I mean by reading scripts and code,read it yourself and try to get an understanding of what it's doing before reading the explanation. Trust me, it helps learn a lot.
Enough of that, here's the script:
Now the fun part of learning what the heck is going on. Feel free to try running it and see what you can make of it.
First a few potentially confusing things such as the 'rs' in front of 'setOuput'. It means the same as redstone, just shorter. It's just much easier and more productive than typing redstone every time. There are many other things that can be made simpler, such as the 'write' and 'print' functions; you actually don't need the parentheses for them but it really comes down to personal preference, same to redstone functions.
What's that 'elseif' thing?
Think about 'if' and 'else', 'if' means "if this is true then do this", 'else' means "if none of the above is true then do this". 'elseif' means almost the same as 'if' except think of it like "if 'if' isn't true, then check if this is true, and if it is then do this". It lets you check multiple things (yes, that means you can have multiple 'elseif's in it) and in that order. Just remember that once something is true in an entire 'if' block that will then move on past the rest of the entire block, so if I have an 'if' with 3 'elseif' and an 'else' and the first 'elseif' is true, it will skip past the last 'else'. I really shouldn't have to explain it this much and you should have gotten exactly what it meant at first because, remember, IT'S LOGICAL! So to explain how I'm using it here, if the input is equal to the debug string, then it will exit the program and go to the computer's shell. This is just a little bypass in case you wanted to access the computer
The comments explain 'os.shutdown()'. It shuts the computer down, of course! Why do I shut down the computer? Because if you don't shutdown the computer, it will go to the command prompt which means whoever is at the computer can simply go to the Lua terminal and turn on a redstone output (Oh Noes, your :Diamond:!)!
Wait, but what if someone goes up to the computer and starts it up, wouldn't that have it go to its command prompt thingie?
Don't worry, as there's a good workaround for that! Each computer has an ID and that ID is assigned a folder in your world's save folder. Yes, that means a computer can have a file but no other will (the same applies to floppies)!
So how can that help?
We're going to set the computer up so that everytime it starts up it'll run the lock program. To do this, we will copy our lock.lua program and paste it 4 directories up. We'll do this in the computer we'll be using as the lock, so enter that computer and use 'ls' and 'cd' to get to the directory with the lock.lua file (cd 'rom/programs/custom'?). Verify you're in the right folder with the files with 'ls'. Now we'll use the 'cp' program, which is short for copy (yes, we're copying the file). However, there is a startup file there already that we must first remove because the copy command only copies a file and does not overwrite. To delete a file is 'rm <file>' and to copy a file is 'cp <file being copied> <location and filename of new file>'
Enter this into your terminal: rm ../../../startup
And this: cp lock.lua ../../../startup
How this works is first there's the program, cp, then the name of the file you want to copy, then the paste save location and filename. Note how it's copying it as a file named startup and it doesn't have the .lua at the end. CC will only startup a file if its name is exactly 'startup'.
Also, if you go to your Lua folder you will notice the startup file is not there. In your computer, enter 'id' and it'll tell you the computer's ID number. Now go to '/.minecraft/saves/<world name>/computers' and you should see some folders with numbers as their titles (and if you have played with floppies yet, another folder titled that with the ID's of those disks inside that). If you look in the folder with the ID as the computer gave you, you should see the startup file that you copied in your computer. Whenever you start your computer it will start that file and then shutdown when it's done running.
Enough boring reading, I don't pay you to type, let's run this thing!
Hey, you're not paying me, but I'll gladly take donations ! But I'm tired of the constant typing anyways, let's get this thing running!
Go to your computer and enter 'reboot' (this, of course, reboots it, silly!). If it was all done correctly then the computer should load your program. Test it out, enter a password and make sure the door opens and closes correctly, enter an incorrect password and make sure it shuts back down.
All working? Great! Now it's your turn to add stuff! Change it, edit it, be creative and even try to re-script the whole thing.
-----------------------------------------------------------------------------------------------
Please give reviews and your thoughts and suggestions! There are many little changes and additions I'd like to make but cannot fit in at this time. I shall update A.S.A.P to make it as clear and understandable as possible!
Thanks for the support and for all the help from the guys on the IRC! I'm already thinking of ideas for future tutorials!
Check out this program for easy mass-production of floppies on a MP server: Link Removed
How can we read on a floppy disk with the computer ?
I was not able to copy the file over either but there is a somewhat easier way to do this go to the computer and type "edit startup" then the code we are using from this forum has to be typed in (I know its kinda hard I like to copy paste lol) Be sure to press ctrl and then save the changes then reboot the PC and it will ask for your password like it should! Also dont worry it only applies to the PC you edited the startup all others will still work the same. Hope this helps!
Oh jeez, forgive me please, I forgot something you have to do before you copy and that's to remove the first startup file because cp can't overwrite existing files.
Before you copy, run 'rm ../../../startup' and then you run the copy command. I'll add this to the tut asap once I'm home!
The problem is the program to lock the door replaces the startup for that particular PC. If you want you can set the PC to not shut down if the correct pass is typed
if input == password then
print("Password Correct!") --If the input is correct!
rs.setOutput("left",true) --Change this and the setOutput to the side the door is on
sleep(2) --Pause for 2 seconds
rs.setOutput("left",false)
os.shutdown() --Shut down the computer
Note: This is only part of the code for this program the rest is on the 1st post of course :smile.gif:
Just remove the os.shutdown() from the code shown here and after the pause period (might be good to extend it to 5)The PC will allow you to do everything else that you normally do on the PC.
There is a way to do this and I will add it to the tutorial, and that's the 'elseif' statement.
it seems the mod can only handle a repeating statement iterating only so many times before it has to close the program. Does anyone know how to fix this.
Id like to make it so that the program can be waiting for input indefinitely.
I think i know what you're talking about. That's easily doable with something called passEvent which is run inside a while true loop. Try looking it up in the help files for now and I'll check to see if there's been documentation on it yet or not. If not I'll produce some because it is an excellent tool.
You typed the code yourself, aside from that I release this and all scripts with Creative Commons. Use it however you wish!
To copy files? cp <file being copied> <location and name of new file>
To do this faster and with great production rate like if you were mass-producing floppies? Make a script that, whenever a disk is inserted, automatically copies the file to it. This is possible with the pullEvent function.
Here's a short program I wrote that copies the file to a disk when inserted and then ejects it. I also challenge anyone seeing this to increase its user friendliness and usefulness . Try things like checking if fileIn is actually there to be copied or user input for fileIn and fileOut.
Here's my beefed-up version of this: Link Removed
Made a video of it here: Link Removed
Trying to rm startup gives me access denied (on my server, if that helps). How do I get it done?
How do I get the computer to detect disks I put into a drive, determine if the password is written there and opens the door accordingly?