Posted 07 August 2013 - 10:53 AM
Hi,
Im on ComputerCraft 1.5 in the Direwolf20 1.4.7 Pack.
And my ingame name is "dennis190090"
I made a program with a door and a Player Detector for multiple users.
What happens is if the user, who is listed in the program presses the player detector, the door opens.
And if the user isnt listed, it should not open (is does now.., let me explain):
Picture in spoiler how the setup is:
3 Monitors
1 Computer
1 alarm
1 Iron door
1 Player Detector
And the complete code:
The Apass is just a "password" just like pass.
The Rpass is for our friend (Who we call retard).
The "or" between the "(Apass) or (pass)" is there because otherwise it wouldnt work somehow with multiple "local pass" (if the "(Apass)" was just a "(pass)" and there wasnt a "or")
e.g:
But now i ran into a problem: The computer always tells me "Acces deniedAcces Granted" and opens the door and rings the Alarm.. (No matter what, if the user is and isnt listed in the code)
What i want is when the user IS listed in the program, he can open the door.
When the user ISNT listed in the program, he wont be able to open the door and the alarm starts making noice)
Thanks!
Dennis.
Im on ComputerCraft 1.5 in the Direwolf20 1.4.7 Pack.
And my ingame name is "dennis190090"
I made a program with a door and a Player Detector for multiple users.
What happens is if the user, who is listed in the program presses the player detector, the door opens.
And if the user isnt listed, it should not open (is does now.., let me explain):
Picture in spoiler how the setup is:
Spoiler
3 Monitors
1 Computer
1 alarm
1 Iron door
1 Player Detector
And the complete code:
Spoiler
local Apass = "dennis190090"
local pass = "zorro132"
local pass = "aXed"
local pass = "lethal34"
local pass = "Gobblemewl"
local pass = "1mD4M14N"
local pass = "CrystalShotz"
local Rpass = "maartenT"
local monitor = peripheral.wrap("top")
local playerD = os.pullEventRaw("player")
if playerD ~= (Apass) or (pass) or (Rpass) then
monitor.write("Acces Denied")
rs.setOutput("back", true)
end
if playerD == (Apass) or (pass) then
monitor.write("Acces Granted")
rs.setOutput("right", true)
end
if playerD == (Rpass) then
monitor.write("Ring the bells")
rs.setOutput("right", true)
rs.setOutput("back", true)
end
sleep(3)
rs.setOutput("right", false)
rs.setOutput("back", false)
os.reboot()
http://pastebin.com/V5KpuMu0The Apass is just a "password" just like pass.
The Rpass is for our friend (Who we call retard).
The "or" between the "(Apass) or (pass)" is there because otherwise it wouldnt work somehow with multiple "local pass" (if the "(Apass)" was just a "(pass)" and there wasnt a "or")
e.g:
local pass = "name1"
local pass = "name2"
if playerD == (pass) then
monitor.write("Acces Granted")
rs.setOutput("right", true)
end
(This wont work somehow)But now i ran into a problem: The computer always tells me "Acces deniedAcces Granted" and opens the door and rings the Alarm.. (No matter what, if the user is and isnt listed in the code)
What i want is when the user IS listed in the program, he can open the door.
When the user ISNT listed in the program, he wont be able to open the door and the alarm starts making noice)
Thanks!
Dennis.