Difference between revisions of "Talk:Making a Password Protected Door"

From ComputerCraft Wiki
Jump to: navigation, search
(New talk page + topic)
m (Reverted edits by 83.169.89.163 (talk) to last revision by Thesbros)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  
== While true loop instead of functions ==
+
== Rewriting Page ==
 +
This page needs a rewrite. I am currently working on one, you can see the progress [http://thesbros.koding.com/lua/cc.php here]. It may not be updated for a while since I am quite busy right now. If anyone could rewrite this page with pictures, better code, and clean it up a bit, then that would be awesome. --[[User:Thesbros|Thesbros]]
  
<!--
+
== Debug Password ==
Please use correct formatting when adding comments.
+
 
-->
+
If you still want to be able to edit the startup file after using "os.pullEvent = os.pullEventRaw", add near the top of your code, under your password:
We need a new picture tutorial, the current one should be using this code:
+
 
<pre>
+
local debug = "pass"
while true do
+
 
term.clear()
+
you can replace "pass" with whatever you want but keep the "s.
term.setCursorPos(1,1)
+
Now, after the first "os.reboot()", put an "end" there.
write("Password: ")
+
Below that put:
local t = read("*")
+
 
if t == "password" then
+
if input == (debug) then
rs.setOutput("back", true)
+
  term.clear()
sleep(2)
+
  term.setCursorPos(1,1)
rs.setOutput("back", false)
+
 
else
+
then put your "else" and everything where you need to put it.
end
+
 
end
+
Hope this helps
</pre>
+
(a few improvements, plus using a while true loop instead of calling a function over and over again (that crashes the computer after some time)
+

Latest revision as of 16:14, 4 December 2012

Rewriting Page

This page needs a rewrite. I am currently working on one, you can see the progress here. It may not be updated for a while since I am quite busy right now. If anyone could rewrite this page with pictures, better code, and clean it up a bit, then that would be awesome. --Thesbros

Debug Password

If you still want to be able to edit the startup file after using "os.pullEvent = os.pullEventRaw", add near the top of your code, under your password:

local debug = "pass"

you can replace "pass" with whatever you want but keep the "s. Now, after the first "os.reboot()", put an "end" there. Below that put:

if input == (debug) then

 term.clear()
 term.setCursorPos(1,1)

then put your "else" and everything where you need to put it.

Hope this helps