ChargedCreeperBrony Posted December 6, 2012 Posted December 6, 2012 this one is actialy for minecraft 1.4.2 i have created an password program in 1.2.5, but somehow in 1.4.2 it doesnt work. this is my program: computer 1 (input): edit startup: print("text") rednet.open("side") ctrl save ctrl exit edit password: print("text") rednet.send("computer 2's ID", password) os.reboot() ctrl save ctrl exit ---------------------------------------------------------------------------------------------------- computer 2 (output): edit startup: rednet.open("side") id, message = rednet.receive("computer 1's ID", password) if message == "password" then redstone.SetOutput("side", true) sleep(5) redstone.SetOutput("side", false) os.reboot() end ctrl save ctrl exit ---------------------------------------------------------------------------------------------------- when i start the 2nd computor it gives this error: rednet :400: number expected this is the error i et when i enter the password: bios:338: [string "password"] :4: '<eof>' expected i realy REALY need help -thanks Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 The function rednet.receive() doesn't need anything inside the brackets other than the timeout. Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 The function rednet.receive() doesn't need anything inside the brackets other than the timeout. and the timeout is...? the id? EDIT: yes Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 The timeout is optional, and only required if you want your program to stop receiving after a certain amount of time. Saying rednet.receive(5) will make your program stop receiving anything after 5 seconds and move on to the next line of code. Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 and how about computer 1? Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 The eof expected? That means that there is an end statement at line 4 which has no function to end. Remove it. Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 now i get this error in copmuter 1: rednet :347: positive number expected Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 Check that you haven't put a - in front of the 2nd computer's ID. It sounds like you entered a negative number instead of the real ID, so double check. Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 does there has to be a # before it? Quote
nedned2k Posted December 6, 2012 Posted December 6, 2012 If the ID is in quotation marks, it shouldn't be. Also, you might want to take a second look at the spelling of the title of this thread. Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 Nope, just the plain number. Eg: rednet.send(2,"Hi This Is My Password It Is Secret Honest") Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 Also, you might want to take a second look at the spelling of the title of this thread. wut? Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 Nope, just the plain number. Eg: rednet.send(2,"Hi This Is My Password It Is Secret Honest") ah so those '' '' arent supposed to be there Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 wut? Just leave it, and try copying the example I gave you to see if that works. Quote
nedned2k Posted December 6, 2012 Posted December 6, 2012 ah so those '' '' arent supposed to be there Not for numbers, no Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 "cumputercraft" OH GOD I CANT CHANGE IT XD and there is ''cum'' in it Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 rednet :3 5 0: string expected -_- Quote
theprolo Posted December 6, 2012 Posted December 6, 2012 Don't change it D: I was enjoying laughing at it! Did you try putting the password in speech marks? Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 oh wait those '' '' are now supposed for the password XD Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 computer 2: startup:4: attempt to call nill Quote
nedned2k Posted December 6, 2012 Posted December 6, 2012 the S in redstone.SetOutput(...) should be lower case Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 lol cant test it yet, night Quote
ChargedCreeperBrony Posted December 6, 2012 Author Posted December 6, 2012 YES IT WORKS, oh thank you 2 so much! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.