NLBlackEagle Posted January 9, 2013 Posted January 9, 2013 Hello, I like to keep this short and clear so its easy readable. We experience a problem with craftOS on our multplayer server, this problem does not occur on singleplayer where everything works as it should work. I've followed a bunch of tutorials (craftos1.3) to set up diffrent programs, none with succes. I either tried tutorials listed on wikicraft wich should work, and as far i've searched on the internet, posts and topics I didnt found the problem. Thats why I think the problem lies in the root of the mod. Here a screen of the program I created, the tutorial i've followed and the error which keeps showing up. Tutorial: http://www.youtube.com/watch?v=dp-adiB2aaY Thanks for your patience reading this and (maybe) the help you are providing me.
Teraku Posted January 9, 2013 Posted January 9, 2013 Seems like you're trying to loop incorrectly. Basically, you're trying to call the function lock(), INSIDE lock(). That's not going to work. You'll need a while loop. Here's the code I used. It does hide your input while typing, though. You can input "Maintenance" as password if you need to access the PC for some reason. os.pullEvent = os.pullEventRaw local loop = true while loop == true do term.clear() term.setCursorPos(1, 1) print("Password?") local input = read("*") if input == "password" then redstone.setOutput("left", true) sleep(3) redstone.setOutput("left", false) elseif input == "Maintenance" then print("Maintenance Mode activated.") loop = false else print("Wrong password.") sleep(2) end end
NLBlackEagle Posted January 9, 2013 Author Posted January 9, 2013 Seems like you're trying to loop incorrectly. Basically, you're trying to call the function lock(), INSIDE lock(). That's not going to work. You'll need a while loop. Here's the code I used. It does hide your input while typing, though. You can input "Maintenance" as password if you need to access the PC for some reason. os.pullEvent = os.pullEventRaw local loop = true while loop == true do term.clear() term.setCursorPos(1, 1) print("Password?") local input = read("*") if input == "password" then redstone.setOutput("left", true) sleep(3) redstone.setOutput("left", false) elseif input == "Maintenance" then print("Maintenance Mode activated.") loop = false else print("Wrong password.") sleep(2) end end Verry same error, Well in another way but it still gives an error, here the screens:
NLBlackEagle Posted January 9, 2013 Author Posted January 9, 2013 Whoops! Oh totaly missed that, what a fail, thanks Anyway, now it displays this error... (didnt changed anything except white to while
Portablejim Posted January 9, 2013 Posted January 9, 2013 Change "else if" to "elseif" (remove the space)
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 Wow, finaly... Thats wierd so it actualy works. Thanks man Do you have an advice where i could see up to date codes? Seems like the ones i've been using where out of date. Thanks anyway!
Portablejim Posted January 10, 2013 Posted January 10, 2013 Wow, finaly... Thats wierd so it actualy works. Thanks man Do you have an advice where i could see up to date codes? Seems like the ones i've been using where out of date. The "else if" was not wrong (or "out of date"), it was just doing something you did not expect. To see the difference, have a look at the code below (what you had) os.pullEvent = os.pullEventRaw local loop = true while loop == true do term.clear() term.setCursorPos(1, 1) print("Password?") local input = read("*") if input == "password" then redstone.setOutput("left", true) sleep(3) redstone.setOutput("left", false) else if input == "Maintenance" then print("Maintenance Mode activated.") loop = false else print("Wrong password.") sleep(2) end end end -- Extra end included compared to the following code(uses "elseif"). Hint: Look at the indentation. os.pullEvent = os.pullEventRaw local loop = true while loop == true do term.clear() term.setCursorPos(1, 1) print("Password?") local input = read("*") if input == "password" then redstone.setOutput("left", true) sleep(3) redstone.setOutput("left", false) elseif input == "Maintenance" then print("Maintenance Mode activated.") loop = false else print("Wrong password.") sleep(2) end end If you notice, thh code Teraku quoted was using "elseif" and not "else if".
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 Hmm, this will do then, i will also try to set up a reactor control room with this, Kinda maxed out my reactor skills except for CCsensors with Computercraft. That would be nice but it will be hard compared to this code
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 Oh by the way, I logged out and in while having all the programs on a floppy, so everything had been reset, how do i instal a floppy into a computer so the floppy is not needed anymore and everything is in the startup?
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 Well, after messing a bit around trying to figure out how it works I came up with this for the reactor, and it keeps working after log out-in
Teraku Posted January 10, 2013 Posted January 10, 2013 Oh by the way, I logged out and in while having all the programs on a floppy, so everything had been reset, how do i instal a floppy into a computer so the floppy is not needed anymore and everything is in the startup? To copy the startup file to a floppy disk, simply type "copy startup disk". To copy the startup file from a floppy disk to the computer, type "copy disk/startup //". I'm not sure, but that should work. And Logging out and in shouldn't reset your floppies, you probably made a mistake.
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 It's quite logic, but yes i've explained it wrong. I ment the computer resetting because i didnt had a floppy in the drive and nothing was saved in the startup. Thats why i've asked how to copy a floppy to the computer startup. Anyway thanks guys! im finaly getting started off learning about computer craft. Soon I will be making my own programs Dont even need to read the codes anymore, remember how to do it. All I need was a good start and thats exacly what you guys provided me :D
Teraku Posted January 10, 2013 Posted January 10, 2013 I just explained how to copy a floppy's contents. ...
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 I ment all of you ''guys'' not guy I had some problems with programming because I monsly saw the wrong ways to do it. So it was kinda hard to figure out whats correct, now i have a straight line to follow
Portablejim Posted January 10, 2013 Posted January 10, 2013 To have your turtle keep it's programs and fuel when it is moved, you need to give it a label. First, come up with a label. Lets go with "boringname". Then type into the turtle "label set boringname". The turtle will now keep its programs.
Teraku Posted January 10, 2013 Posted January 10, 2013 I thought turtles and PC's never reset unless you broke them?
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 They do after you log out and in (multiplayer) and when you restart the server :P
Teraku Posted January 10, 2013 Posted January 10, 2013 Weird. My programs and files always stay put, I can even stop the server and edit one of my own programs with a text editor. Perhaps one of your directories is read-only or something.
Portablejim Posted January 10, 2013 Posted January 10, 2013 I thought turtles and PC's never reset unless you broke them? That is why I said "when moved". In my understanding the turtle's programs should stay on the turtle until it is broken if it is not named. The turtle however, will stop running any programs when it is unloaded. This occurs when nobody is nearby and there is not a chunk-loader nearby, or the server shuts down.
NLBlackEagle Posted January 10, 2013 Author Posted January 10, 2013 @Teraku, I guess we are mis understanding each other, If i write the programs on the computer in the startup they stay, but if i put in a floppy into the disk drive, put an monitor next to it and open it up the program is loaded without any commands needed. If i put out the floppy and log in whereafter logout all the data on the computer is gone because it has not been saved on the computer but start up from the floppy as soon as someone load the chunk where the computer is in. Anyway, made quite some progress do you know anything fun left to do? or some codes to control my reactor even better. Might make a topic about it and a tut how to build a reactor like mine (can leave it alone, provides 2030EU/t is fully ''noob'' failsave except for a highly secured computer program to take out 64 ICE if there is a mallfunction. and is fully protected with everything possibile attatched without any wireless redstone signals so no one can do harm from the outside. And im pretty proud about it :)
Portablejim Posted January 11, 2013 Posted January 11, 2013 Might make a topic about it and a tut how to build a reactor like mine (can leave it alone, provides 2030EU/t is fully ''noob'' failsave except for a highly secured computer program to take out 64 ICE if there is a mallfunction. and is fully protected with everything possibile attatched without any wireless redstone signals so no one can do harm from the outside. And im pretty proud about it This talk of ice in the reactor... are you using tekkit lite? The reactor stuff has changed lots between tekkit classic and tekkit lite.
NLBlackEagle Posted January 11, 2013 Author Posted January 11, 2013 Im using tekkit Lite yes What did changed then? Im using retrievers with pneumatic pipes to do the job
NLBlackEagle Posted January 11, 2013 Author Posted January 11, 2013 Just finished with an awesome creation, going to Manual build ''rare'' verry nice looking regions, second one is done and it looks awesome Getting kinda messy in this topic but why not for once? So, here take a look if you like, godda make 20 biomes like this one (serval on floating isle`s, huge caverns and in the middle of the sea like here) Oh, take a look.. Cant find spoilers
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now