This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Thefdjurt's profile picture

[ATTENTION ChrisStar]Monitor-Door lock

Started by Thefdjurt, 26 May 2013 - 05:43 PM
Thefdjurt #1
Posted 26 May 2013 - 07:43 PM
So this is what you'd do
[Just so you know you'll need to use an advanced monitor and computer.]

event = os.pullEvent() --sets event to the events that occur around the computer
if event == "monitor_click" then --checks if the event is a monitor click
___event, player = os.pullEvent("player") --the underscore represents tab(I'm on mobile)
___if player == *insert name* then --checks to see if the player whom clicked the monitor is the player
______ rs.setOutput("*insertside*", true) --sends a redstone output out the computer
___else --does below if not the player written
______peripheral.warp("*insert monitor's side*").write("ACCESS DENIED") --sends text to monitor
end
end
If you don't understand or didn't work please write so.
(P.S this is completely from scratch, haven't tried it myself)
SuicidalSTDz #2
Posted 26 May 2013 - 07:48 PM
You should really test things before releasing them. The make-shift underscore indenting would break the code entirely. You are also using global variables which usually doesn't go well. You should wrap the peripheral at the beginning and should also define variables for the redstone output sides and monitor side.

EDIT: If this was meant to be viewed directly by a single person, PM them next time.
Thefdjurt #3
Posted 26 May 2013 - 08:06 PM
EDIT: If this was meant to be viewed directly by a single person, PM them next time.
I pm'd him the link to this.
And also when have a laptop that overheats after 30 min. then shuts-down its kind of hard to test some code and I'm guessing he'd understand to not actually write the underscores and click tab instead.

I don't want any staff on my case so, I going to "shutup".
ChrisStarr #4
Posted 26 May 2013 - 08:13 PM
Yes I Understand Almost everything about Computercraft just not something like this! lol
I Couldn't figure out a way to write this from scratch myself so THANK YOU!!
Thefdjurt #5
Posted 26 May 2013 - 08:17 PM
Yes I Understand Almost everything about Computercraft just not something like this! lol
I Couldn't figure out a way to write this from scratch myself so THANK YOU!!
No problem.Question, did it, the program, actually work?
Lyqyd #6
Posted 26 May 2013 - 08:23 PM
This is what PMs are for. Locked.