Posted 13 July 2012 - 07:55 AM
okay this is a cool program i use for my world(survival) and i find it very useful
for controling the light around my house the code is this
term.clear()
term.setCursorPos()
textutils.slowPrint("|—————————-|")
textutils.slowPrint("| Light System Pro V 2.4 |")
textutils.slowPrint("|—————————-|")
numb = math.random(1, 50)
numb2 = math.random(51, 99)
rest = math.random(1, 7)
lighton = "ON"
lightoff = "OFF"
out = "EXIT"
print("\nAcheiving Light Speed")
print("Progress "..numb.."%")
sleep(rest)
print("Progress "..numb2.."%")
sleep(rest)
textutils.slowPrint("100% Light Speed Acheived")
sleep(2)
term.clear()
term.setCursorPos(1,1)
while true do
print("|—————————-|")
print("| Light System Pro V 2.4 |")
print("|—————————-|")
print("\n Do You Want Lights ON or OFF or Type EXIT To Leave")
print("\nPlease Type How You See It Above")
input = read()
if input == lighton then
print("Lights On")
rs.setOutput("back",true)
sleep(2)
term.clear()
term.setCursorPos(1,1)
elseif input == lightoff then
print("Lights Off")
rs.setOutput("back",false)
sleep(2)
term.clear()
term.setCursorPos(1,1)
elseif input == out then
print("Bye")
sleep(1)
exit() – dont now how to get this to work? if i put break i get errors that continue forever please
– help
term.clear()
term.setCursorPos(1,1)
end
elseif
print("I Didn't Get You Try Again") then
sleep(1.5)
term.clear()
term.setCursorPos(1,1)
end
end
please help me fix this it works fine just doing ON?OFF commands
for controling the light around my house the code is this
term.clear()
term.setCursorPos()
textutils.slowPrint("|—————————-|")
textutils.slowPrint("| Light System Pro V 2.4 |")
textutils.slowPrint("|—————————-|")
numb = math.random(1, 50)
numb2 = math.random(51, 99)
rest = math.random(1, 7)
lighton = "ON"
lightoff = "OFF"
out = "EXIT"
print("\nAcheiving Light Speed")
print("Progress "..numb.."%")
sleep(rest)
print("Progress "..numb2.."%")
sleep(rest)
textutils.slowPrint("100% Light Speed Acheived")
sleep(2)
term.clear()
term.setCursorPos(1,1)
while true do
print("|—————————-|")
print("| Light System Pro V 2.4 |")
print("|—————————-|")
print("\n Do You Want Lights ON or OFF or Type EXIT To Leave")
print("\nPlease Type How You See It Above")
input = read()
if input == lighton then
print("Lights On")
rs.setOutput("back",true)
sleep(2)
term.clear()
term.setCursorPos(1,1)
elseif input == lightoff then
print("Lights Off")
rs.setOutput("back",false)
sleep(2)
term.clear()
term.setCursorPos(1,1)
elseif input == out then
print("Bye")
sleep(1)
exit() – dont now how to get this to work? if i put break i get errors that continue forever please
– help
term.clear()
term.setCursorPos(1,1)
end
elseif
print("I Didn't Get You Try Again") then
sleep(1.5)
term.clear()
term.setCursorPos(1,1)
end
end
please help me fix this it works fine just doing ON?OFF commands