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

Wolf's Computer programs

Started by Wolf, 10 August 2012 - 04:02 AM
Wolf #1
Posted 10 August 2012 - 06:02 AM
I've made theese myself, in my spare time. I will list them in the way they were made ;)/>/>
It was over a 8 day period of time, so i didn't get to make more.

If you guys want me to make a download for theese, just tell me.

(You may have to remove the the sentences after the –'s)

This was a script from a tutorial, with stuff added onto it.
Now, it can work in collaboration with another computer to make an alarm.
Most, if not all, of the options go first.


os.pullEvent = os.pullEventRaw --makes it impossible to Terminate.
rednet.open("top") --change to the side your wireless part is on
local side = "back" --Side power goes through.
local password = "password" -- change to desired password
local opentime = 3 --change to desired time you want the door open for
rs.setOutput (side,true)
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == (password) then
term.clear()
term.setCursorPos(1,1)
print("Correct")
rs.setOutput (side,false)
sleep(opentime)
os.reboot()
else
-- this part is the alarm piece
term.clear()
term.setCursorPos(1,1)
print("Password incorrect")
rednet.broadcast ("Security Alert!")
sleep(2)
os.reboot()
end


And this is the other side for the alarm.
NOTE~~~
Hook this computer up to note blocks set on a high note.
Use a repeater to make one noteblock go off later(I Believe its 3rd setting)


rednet.open("left") --change to side of the wireless part
term.clear()
term.setCursorPos(1,4)
write("Turn on the alarm? Y/N: ")
local input = read()
if input == "Y" then --You MUST say Y, case sensitive, change it to whatever you want
term.clear()
term.setCursorPos(1,4)
write("Armed")
sleep(2)
term.clear()
term.setCursorPos(1,1)
rednet.receive()
for i=0, 100, 1 do -- change 100 to how many times you want the alarm to beep before restarting
rs.setOutput ("back",true) --change to desired side of current
sleep(0.5)
rs.setOutput ("back",false) --change this too, same side
sleep(0.5)
end
os.reboot()
end

This is a non-password door, Simple and to the point.


write("Open door?: ")
local input = read()
if input == "Y" then -- case sensitive
rs.setOutput("back", true) -- change to desired side of power
os.reboot()
end


I lost a few, I was making a new world and forgot to backup the scripts, i found them but it was a old backup.
Link to Turtle scripts. (Though they are unfinished)

I am open to suggestions, for computers, and turtles alike!(I'd like them in a PM)
Throw 'em at me!
Wolf #2
Posted 05 October 2012 - 07:17 AM
Bump
stilldabomb #3
Posted 05 October 2012 - 08:42 AM
Bump
Bumping doesn't get you very far. It's more of an annoyance. Just FYI.
rokkwarr #4
Posted 05 October 2012 - 09:08 AM
a bump on a post from over a month ago is not annoying, now someone bumping a post that they made 15 minutes ago IS annoying.

Back to topic, I like the alarmed door. scares the crap out of people.
Wolf #5
Posted 05 October 2012 - 05:41 PM
Thanks, its only a 2 computer script because my password door couldn't reach the alarms, because it used a piston door.
Right now, its set to go off if you put one bad password in, i can change that if wanted. If you guys do want it to give chances, send me a PM or post on here saying so.
stilldabomb #6
Posted 06 October 2012 - 05:15 AM
a bump on a post from over a month ago is not annoying, now someone bumping a post that they made 15 minutes ago IS annoying.

Back to topic, I like the alarmed door. scares the crap out of people.
Oh whoops! I should probably read before posting that… T_T (Dumba*s me…)
Wolf #7
Posted 08 October 2012 - 06:34 AM
Forgiven.
I've also been thinking of somehow making a perimeter alarm, like if they get too close, it goes off… Not sure how it could be done.