8 posts
Posted 01 September 2012 - 11:35 PM
Having Problem with my Computer Password code.
Here's the code:
local side = "right"
print"==========================="
print"Crule.Co Mainframe Terminal"
print"==========================="
textutils.slowPrint"Please Type Clearance Code"
textutils.slowWrite"Code: "
correctpassword = "1212"
local input = read("*")
if input == "1212" then
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint"Welcome Emen8asuer"
textutils.slowPrint"Rememeber to type reboot to log off"
else
repeat
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint"Unauthorized Access, Fail Safe Activated"
rs.setOutput(side,true)
textutils.slowWrite"Fail safe Password: "
local input = read("*")
if input == "Enderman" then
textutils.slowPrint"Fail Safe Deactivated"
rs.setOutput(side,false)
end
until end sleep(2) os.reboot()
else textutils.slowPrint"Access Denied"
textutils.slowPrint"Seek Admin for help.
until i==3
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 01 September 2012 - 11:38 PM
whats the error?
8 posts
Posted 01 September 2012 - 11:41 PM
Its on the sleep(2) os.reboot() line, it wants me to have until and end on it but tehy wont work together
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 01 September 2012 - 11:42 PM
line 28 is
until end sleep(2) os.reboot()
I don't think this is proper code, I dont even know what you want it to do…Edit: sorry copying didn't work right, but I fixed it
8 posts
Posted 01 September 2012 - 11:44 PM
Its a Password system, u eneter wrong code and it turns on a failsafe hooked to a industrial alarm. i want it to continue if tehy dont put in right password for failsafe
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 01 September 2012 - 11:48 PM
I think your looking for "else"… if not, what do you want line 28 to do?
8 posts
Posted 01 September 2012 - 11:49 PM
It was ment to reboot if they got the password right but it said to but end and until in it but i dunno how
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 01 September 2012 - 11:51 PM
on lines 21 and 26 you put rs.setOutput(side,true), it has to be rs.setOutput("side you want", true)
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 01 September 2012 - 11:52 PM
so when they enter the password "enderman" you want it to restart after 2 seconds?
8 posts
Posted 01 September 2012 - 11:53 PM
Still doesent solve teh problem
8 posts
Posted 01 September 2012 - 11:54 PM
Yes and if tehy dont get it correct it will make the password message come up again
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 01 September 2012 - 11:54 PM
I don't think that the repeat command is in the current version of CC, but i'm not positive, are you using 1.4 or tekkit (1.3)?
8 posts
Posted 01 September 2012 - 11:55 PM
Tekkit 1.3.2
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 02 September 2012 - 12:03 AM
here I fixed the code:
local side = "right"
print"==========================="
print"Crule.Co Mainframe Terminal"
print"==========================="
function password()
textutils.slowPrint"Please Type Clearance Code"
textutils.slowWrite"Code: "
correctpassword = "1212"
local input = read("*")
if input == "1212" then
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint"Welcome Emen8asuer"
textutils.slowPrint"Rememeber to type reboot to log off"
else
while true do
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint"Unauthorized Access, Fail Safe Activated"
rs.setOutput(side,true)
textutils.slowWrite"Fail safe Password: "
local input = read("*")
if input == "Enderman" then
textutils.slowPrint"Fail Safe Deactivated"
rs.setOutput(side,false)
sleep(2)
os.restart()
else
textutils.slowPrint"Access Denied"
textutils.slowPrint"Seek Admin for help."
break
password()
end
end
password()
It should work, untested though
8 posts
Posted 02 September 2012 - 12:05 AM
Thank you
116 posts
Location
At my Computer coding for the Computer in my Computer
Posted 02 September 2012 - 12:06 AM
Your welcome!
1243 posts
Location
Indiana, United States
Posted 02 September 2012 - 12:06 AM
You mean Tekkit 3.1.2, so CC 1.33. Tekkit doesn't have support for 1.3.2 yet.
Edit: Damn, I've been ninja'd.