I need a code so that a computer will activate when I press a button or pull a lever
I will later make a code on a different computer to activate tis terminal
redstone activated terminal
Started by Darth_Ben17, Sep 25 2013 08:46 PM
5 replies to this topic
#1
Posted 25 September 2013 - 08:46 PM
#2
Posted 25 September 2013 - 10:35 PM
Split into new topic.
Please post your current code.
Please post your current code.
#3
Posted 25 September 2013 - 10:47 PM
I just want it to activate with/without redstone signal so I can have some standard programs but there will be nothing else in startup
#5
Posted 25 September 2013 - 10:55 PM
if not I would have this is startup:
sorry typo I meant have it in startup
Ive already checked out that and im new to CC so I don't really get it
I found this code but it only activates not deactivate
function os.pullEvent()
local event, p1, p2, p3, p4, p5
if event == "terminal" then
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1, 1)
print "Enter Password"
print " "
write("Password:")
correctpass = "123" -- not the actual password
pass = read("*")
if pass == (correcrpass) then
term.clear()
term.setCursorPos(1, 1)
write("Correct")
sleep(2)
term.clear()
term.setCursorPos(1, 1)
print "Welcome"
term.setCursorPos(1, 3)
else
print " "
write("Incorrect")
sleep(2)
shell.run("startup")
end
sorry typo I meant have it in startup
Ive already checked out that and im new to CC so I don't really get it
I found this code but it only activates not deactivate
while true do
os.pullEvent("redstone")
if rs.getInput("back") then
break
end
end
#6
Posted 26 September 2013 - 04:23 PM
You are incredibly unclear about what you mean by "activate". Do you want it to run a program when a redstone signal is applied, and then stop that program when the redstone signal goes away? If so, then the "deactivation" would need to be part of the program that runs.
startup:
prog:
startup:
while true do
_,side = os.pullEvent("redston")
if side == "back" then
shell.run("prog")
end
end
prog:
begin
-- Do stuff
-- Kick dog
-- Make fun of Lyqyd
-- Get banned from CC forum
until not rs.getInput("back")
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











