1
Can some one fix my Computer craft mainframe?
Started by Nom, Dec 14 2013 03:06 AM
10 replies to this topic
#1
Posted 14 December 2013 - 03:06 AM
Hi im new to lua,
But I just spent 1 hour trying to make this advanced door system with a main frame (NMF) which has its own api!
The problem is I can't get the program to work properly.
Please can some one help fix the issues in the coding.
Here is the link to files: https://www.mediafir...m8978z91ed54r38
Thanks,
Nom
But I just spent 1 hour trying to make this advanced door system with a main frame (NMF) which has its own api!
The problem is I can't get the program to work properly.
Please can some one help fix the issues in the coding.
Here is the link to files: https://www.mediafir...m8978z91ed54r38
Thanks,
Nom
#3
Posted 14 December 2013 - 09:54 AM
Alright. Let's see if I can help.
When you call
Also, after you call NFS.Start(), you have no way of seeing if the user typed either login or admin_login. I would suggest something like this:
When you call
read("*")it should be
read()
Also, after you call NFS.Start(), you have no way of seeing if the user typed either login or admin_login. I would suggest something like this:
i = 1 while i == 1 do input = read() if input == "login" then i = 0 --code here elseif input == "admin_login" then i = 0 --code here else print("Invalid input!") end end
#5
Posted 14 December 2013 - 10:08 AM
Aha! That's what it does! I've tried that so many times, and gotten an error each time though...
#6
Posted 14 December 2013 - 01:39 PM
Castform, on 14 December 2013 - 09:54 AM, said:
Alright. Let's see if I can help.
When you call
Also, after you call NFS.Start(), you have no way of seeing if the user typed either login or admin_login. I would suggest something like this:
When you call
read("*")it should be
read()
Also, after you call NFS.Start(), you have no way of seeing if the user typed either login or admin_login. I would suggest something like this:
i = 1 while i == 1 do input = read() if input == "login" then i = 0 --code here elseif input == "admin_login" then i = 0 --code here else print("Invalid input!") end end
#7
Posted 14 December 2013 - 03:59 PM
Didnt realize that was the API. Can you post the errors you are getting?
#8
Posted 14 December 2013 - 04:15 PM
Castform, on 14 December 2013 - 03:59 PM, said:
Didnt realize that was the API. Can you post the errors you are getting?
Snakybo, on 14 December 2013 - 04:41 AM, said:
You should really use Pastebin to upload your scripts. No one is going to download it from Mediafire.
#9
Posted 14 December 2013 - 05:28 PM
Well the thing is, you're not doing anything.
you load the NMF API,
and call the function "start", which does
print some options on the screen.
that's all.
I think you wanted, that the user chooses an option now, but you're not doing it.
You're missing something like
Same inside your Admin_Login function:
you only define to functions there, you give your user no chance to choose what function he wants to choose.
Also, in your startup file, if the user doesn't enter start, he will get to the shell. you should add an else, which reboots the pc. You could make a while loop too - if you know how to.
you load the NMF API,
and call the function "start", which does
print some options on the screen.
that's all.
I think you wanted, that the user chooses an option now, but you're not doing it.
You're missing something like
print("Enter either login or admin login:") local whichlogin = read() if whichlogin == "login" then NMF.Login() elseif whichlogin == "admin login" then NMF.Admin_Login() endin your NMF.start function.
Same inside your Admin_Login function:
you only define to functions there, you give your user no chance to choose what function he wants to choose.
Also, in your startup file, if the user doesn't enter start, he will get to the shell. you should add an else, which reboots the pc. You could make a while loop too - if you know how to.
#10
Posted 15 December 2013 - 02:29 PM
ardera, on 14 December 2013 - 05:28 PM, said:
Well the thing is, you're not doing anything.
you load the NMF API,
and call the function "start", which does
print some options on the screen.
that's all.
I think you wanted, that the user chooses an option now, but you're not doing it.
You're missing something like
Same inside your Admin_Login function:
you only define to functions there, you give your user no chance to choose what function he wants to choose.
Also, in your startup file, if the user doesn't enter start, he will get to the shell. you should add an else, which reboots the pc. You could make a while loop too - if you know how to.
you load the NMF API,
and call the function "start", which does
print some options on the screen.
that's all.
I think you wanted, that the user chooses an option now, but you're not doing it.
You're missing something like
print("Enter either login or admin login:") local whichlogin = read() if whichlogin == "login" then NMF.Login() elseif whichlogin == "admin login" then NMF.Admin_Login() endin your NMF.start function.
Same inside your Admin_Login function:
you only define to functions there, you give your user no chance to choose what function he wants to choose.
Also, in your startup file, if the user doesn't enter start, he will get to the shell. you should add an else, which reboots the pc. You could make a while loop too - if you know how to.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users