Hello, Here i'm going to put all my programs.
Table Of Contents:[anchor='Computer']
You all know the main item of computercraft, the computer. Here's my programs to those
Programs:[Anchor='PassLock']
Spoiler
Contents:[anchor='PLIntro'][anchor='PLCode']
>lock
Spoiler
--[[ PassLock v.2.2 by tonkku107 ]]--
os.pullEvent = os.pullEventRaw
rednet.open("top")
local password = "Pass"
local opentime = 5
local myId = os.computerID()
local done = false
local serverId = 7
local ver = 2.2
function gui()
term.clear()
term.setCursorPos(1,1)
print("PassLock v."..ver)
term.setCursorPos(1,3)
end
while done == false do
gui()
write("Password: ")
local input = read("*")
if input == "AdminPass" then
gui()
textutils.slowPrint("Access Granted!")
sleep(2)
rednet.close("top")
term.clear()
term.setCursorPos(1,1)
print("CraftOS 1.5")
done = true
else
rednet.send(serverId,input)
senderId,message,distance = rednet.receive(5)
if senderId == serverId then
if message == "Valid" then
gui()
print("Password Correct!")
rs.setOutput("back",true)
sleep(5)
rs.setOutput("back",false)
os.shutdown()
else
gui()
print("Password Incorrect!")
sleep(2)
os.shutdown()
end
end
end
end
>Lock without rednet
Spoiler
os.pullEvent = os.pullEventRaw
local password = "Pass"
local opentime = 5
local done = false
local ver = 2.0
function gui()
term.clear()
term.setCursorPos(1,1)
print("PassLock v."..ver)
term.setCursorPos(1,3)
end
while done == false do
gui()
write("Password: ")
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
print("PassLock v. 2,0")
term.setCursorPos(1,3)
print("Password Correct!")
rs.setOutput("back",true)
sleep(opentime)
rs.setOutput("back",false)
os.shutdown()
elseif input == "AdminPass" then
gui()
print("Access Granted!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
done = true
else
gui()
print("Password Incorrect!")
sleep(2)
os.shutdown()
end
end
>Exit
Spoiler
os.pullEvent = os.pullEventRaw
local door = "exit"
local serverId = 7
local myId = os.computerID()
local ver = 2.2
local done = false
function gui()
term.clear()
term.setCursorPos(1,1)
print("PassLock v."..ver)
term.setCursorPos(1,3)
end
rednet.open("top")
while done == false do
gui()
write("Press enter to open the door...")
io.read()
rednet.send(serverId,door)
senderId,message,distance = rednet.receive(5)
if senderId == serverId then
if message == "Valid" then
gui()
write("Door open!")
rs.setOutput("back",true)
sleep(5)
rs.setOutput("back",false)
os.shutdown()
else
os.shutdown()
end
end
end
>Exit without Rednet
Spoiler
os.pullEvent = os.pullEventRaw
local ver = 2.0
local done = false
function gui()
term.clear()
term.setCursorPos(1,1)
print("PassLock v."..ver)
term.setCursorPos(1,3)
end
while done == false do
gui()
write("Press enter to open the door...")
io.read()
gui()
write("Door open!")
rs.setOutput("back",true)
sleep(5)
rs.setOutput("back",false)
os.shutdown()
else
os.shutdown()
end
end
end
[Anchor='PLVideo']
No videos available
[Anchor='PLScreen']
Spoiler
>Starting Screen>No one will see your input
>Correct screen
>Local / Admin Password Correct
>Incorrect
[anchor='PLDL']
Pastebin:
PassLock, PassLock without rednet, PassLock exit, PassLock exit without rednet
In Game:
PassLock:
pastebin get xqnd5Jg2 lock
PassLock without rednet:
pastebin get 4P78Gf8c lock
PassLock exit:
pastebin get VMR0bxk1 exit
PassLock exit without rednet:
pastebin get gsR45nzu exit
[anchor='PLCredits']
Me - for doing the code, all myself (and with alot of youtube tutorials of CCLua)
[Anchor='Turtle']
Turtle Programs
Here is the programs for these nice little moving turtles
Programs:[anchor='Cobble_Turtle']
Spoiler
Contents:[anchor='CBIntro'][anchor='CBCode']
>cobble
Spoiler
--[[ Cobble Turtle by Tonkku107 ]]--
local mined = 0
local amount = false
function dropItems()
turtle.turnRight()
turtle.turnRight()
print("Dropping Items...")
for i = 1, 16 do
turtle.select(i)
turtle.drop()
end
turtle.select(1)
print("Dropped!")
turtle.turnRight()
turtle.turnRight()
end
write("Amount of cobblestone: ")
repeat
amount = tonumber(read())
if not amount then
write("I need a number: ")
end
until amount
print("Amount set to " .. tostring(amount))
repeat
if turtle.dig() then
print("Mined!")
mined = mined + 1
end
sleep(0.2)
local full = true
for i = 1, 16 do
full = (turtle.getItemSpace(i) == 0) and full
end
if full then
print("Inventory is full!")
dropItems()
end
until amount == mined
print("Successfully mined "..mined.." cobblestone!")
dropItems()
[anchor='CBVideos']
Coming Soon!
[anchor='CBScreen']
Spoiler
>Starting>It doing it's job
>After it's done
>Dropping items to the chest behind it
[anchor='CBDL']
Pastebin:
Cobble Turtle
In Game:
Cobble Turtle:
Pastebin get gCmW5pS9 cobble
[anchor='CBCredits']
Me - The Code… Atleast a little bit, idea
LBPHacker - Helping alot!
[anchor='Ideas']
Have any ideas for programs i could make? Tell me! Post into this topic, or Contact me other ways, such as skype.
I'm such a noob in coding, but it would be great if new ideas make me learn :)/>/>