Anyone know computercraft programming?
12 years ago
I need some programming help with a crazy silly tekkit minecraft project I'm working on, a lot of it is just programming frame doors with forcefields so I can open and close them from a password controlled interface, I would also want a few other nice things like, a security program that automatically locks down all doors sets off alarms and releases golems, also I want a basic Intranet where the buildings computers can communicate with eachother for basic messaging and maybe executing commands, if at all possible a nice basic GUI for this would be a massive plus.
So anyone who is interested let me know how much this kind of work costs and we shall see how it goes! Thanks!
So anyone who is interested let me know how much this kind of work costs and we shall see how it goes! Thanks!
It's p easy to learn, so I hope that helps!
Apart from that I don't know anyone who takes programming commissions, but that would be awesome.
if it can be done naturally with redstone, then I think you have a good chance of doing it with the scripts
I don't mess around with the computer mods and stuff though xD
been trying to get the sun and water shaders to work for a while now, but I still have not managed to get it working (they just simply do not function, or are full of stupid looking features that I cant disable, like those wavy tree leaves)
What do you mean by programming frame doors with force fields? Do you mean frame doors that have force fields attached to them?
Locking down all doors, if you just mean frame doors, is fairly easy, but time consuming. Lifting this lock and returning all doors to their previous state though, would make for a considerably harder challenge. Actual minecraft doors (as in the iron ones) is very difficult without some Minecraft logic trickery.
Releasing golems, again, easy enough. Putting them back would be near impossible without manually doing so.
An intranet to chat between computers... I can see how to do it, but I think it'd be a bit of a challenge. You'd need to install a RedNet wireless tower high enough up to encompass the whole area.
Now, to note, this is coming from a person who doesn't actually USE ComputerCraft (I find it incredibly overpowered, especially the turtles.), but I do have a couple years of java programming under my belt, and LUA doesn't look too hard to use from videos I've seen that include it. Maybe I'll take a look at this stuff in a test world.
You've got a base model done, now refine it until it's satisfactory.
To only enter the password once you might want to do a limited loop within the infinite loop, then have a "Exit" option that'll just set the parameter the current loop checks to false. Then once it's out of that loop, it sets that parameter back to true.
So like this:
While1 (true)
While2 (notexit == true)
Option 1. Stuff
Option 2. Stuff
Option 3. Etc.
Option 4. Exit
-- Option 4 sets notexit to false
While2 should exit if you select option 4
notexit should be set back to true here
While1 should repeat its loop here.
print ("Enter Password")
input = io.read()
if input == "zhoffa99" then
print("Select Disengage/ Secure")
else
print ("Incorrect")
os.shutdown()
end
input = io.read()
if input == "Disengage" then
redstone.setBundledOutput ("back", colors.white)
end
if input == "Secure" then
redstone.setBundledOutput ("back", colors.purple)
term.clear()
end
So how do I implement this "while" option that you suggest? Thanks a ton for the help by the way I am totally helpless with this stuff.
it would also be nice to allow multiple users to set their own passwords but I expect that would be crazy complicated :)
While1 (true) {
print ("Enter Password")
input = io.read()
if input == "zhoffa99" then
print("Select Disengage/ Secure")
else
print ("Incorrect")
os.shutdown()
end
While2 (exit == false)
input = io.read()
if input == "Disengage" then
redstone.setBundledOutput ("back", colors.white)
end
if input == "Secure" then
redstone.setBundledOutput ("back", colors.purple)
if input == "Exit" then
exit = true; (or however you change variables)
term.clear()
end
While2 ends here, and should repeat if exit is still equal to false.
exit = false; (Should be set here after leaving the while2 loop (AKA: Selecting Exit from the menu.))
While1 ends here, and should repeat for infinity.
So I had a look here http://computercraft.info/wiki/inde.....The_While_loop and I have to be honest, I don't understand any of it :)
You don't need those it looks like. Seems as though lua automatically opens brackets with certain keywords and then closes them up with end.
For your infinite loop you want:
while true do
(the code you gave me goes here)
end
For the conditional-based one you'll want to change that "true" to either a variable or a conditional check. I'll have to look into that one a bit later, leaving now though.
local Answer, Correct = "", "2"
while Answer~=Correct do
write("What is the sum of 1 and 1 (1+1)? ")
Answer = read()
if Answer == Correct then print("Correct!") else print("Incorrect!") end
end
That's the sample given on that website you linked me to.
You'll want to make something like this (I believe, again, this is untested.):
---Rest of the code before this point goes here
local DoingStuff, Done = "", "1"
while DoingStuff~=Done do
input = io.read()
if input == "Disengage" then
redstone.setBundledOutput ("back", colors.white)
end
if input == "Secure" then
redstone.setBundledOutput ("back", colors.purple)
end
if input == "Exit" then
Done = 1 ((You'll need to figure out how to change the variable Done to 1, it SEEMS like this is the proper method but yeah...))
end
end ((Don't forget this end, it's the end of this while loop))
---Rest of the code below this point goes here.
I'd need to be physichally shown how to useit
=^.,.^=
1- You need to make a program named "password" or whatever you want to type in for the password box to open.
2- Add a input
3- Make a condition:
If input == "your pass here"
then redstone 1 "side the door is. Ex: left";
else printf("Wrong password")
return 0;
end
That shall do it.
You should have this:
1-You enter password program
2-You enter the password
3-The door opens
4-5secs later the door closes and the computer restarts, so it can be used again.
I hope that's what you're looking for.
PS: I have a tekkit server full of furries. As of yet we do not have any deer. Note me for the IP. Running Tekkit Lite.