Posted 12 July 2012 - 05:41 PM
I made a redstone counter but i want it to excute a function after 10 counts.
after 10 coutns i want the computer to send off a signal to the left. Heres what i have so far:
local monitor = peripheral.wrap("right")
monitor.setTextScale(5)
term.redirect(peripheral.wrap("right"))
localcount = 0
local lastInput = rs.getInput("back")
while true do
term.clear()
term.setCursorPos(1, 1)
print(count)
os.pullEvent("redstone")
local input = rs.getInput("back")
if input ~= lastInput then
if input then
count = count + 1
when
count = 10
redstone.setOutput("left", true)
else
count = 11
redstone.setOutput("left", false)
end
lastInput = input
end
end
Note: This is not my script i got it from searching through other threads. Also i am very noobish and probably ruined it just by adding
when
count = 10
redstone.setOutput("left", true)
else
count = 11
redstone.setOutput("left", false)
Please help i am terrible at this
after 10 coutns i want the computer to send off a signal to the left. Heres what i have so far:
local monitor = peripheral.wrap("right")
monitor.setTextScale(5)
term.redirect(peripheral.wrap("right"))
localcount = 0
local lastInput = rs.getInput("back")
while true do
term.clear()
term.setCursorPos(1, 1)
print(count)
os.pullEvent("redstone")
local input = rs.getInput("back")
if input ~= lastInput then
if input then
count = count + 1
when
count = 10
redstone.setOutput("left", true)
else
count = 11
redstone.setOutput("left", false)
end
lastInput = input
end
end
Note: This is not my script i got it from searching through other threads. Also i am very noobish and probably ruined it just by adding
when
count = 10
redstone.setOutput("left", true)
else
count = 11
redstone.setOutput("left", false)
Please help i am terrible at this