6 posts
Posted 20 June 2014 - 02:04 AM
I'm trying to make a 5 second timer on a monitor to the right.I am very bad(don't know a single thing) at programming.I want the number in the monitor pretty big.the timer will start with a redstone signal to the front and when it ends give a redstone signal to the back.If anyone can help i'd appreciate it.I don't know if this is possible but iv'e seen a lot of crazy programs from computercraft.
259 posts
Posted 20 June 2014 - 05:32 AM
pretty simple stuff. Look on the forums for some tutorials that will help you out greatly.
mon = peripheral.wrap("right") -- wrap the monitor
mon.setTextScale(5)
while true do
evt, p1, p2 = os.pullEvent()
if evt == "redstone" then
if rs.getInput("front") == true then
rs.setOutput("back", false) -- note that this might not be when you want it to turn off.
for i = 5, 0, -1 do
mon.clear()
mon.setCursorPos(1, 1)
mon.write(i)
sleep(1)
end
mon.clear()
rs.setOutput("back", true)
end
end
end
that should mostly do it.
6 posts
Posted 20 June 2014 - 08:33 AM
pretty simple stuff. Look on the forums for some tutorials that will help you out greatly.
mon = peripheral.wrap("right") -- wrap the monitor
mon.setTextScale(5)
while true do
evt, p1, p2 = os.pullEvent()
if evt == "redstone" then
if rs.getInput("front") == true then
rs.setOutput("back", false) -- note that this might not be when you want it to turn off.
for i = 5, 0, -1 do
mon.clear()
mon.setCursorPos(1, 1)
mon.write(i)
sleep(1)
end
mon.clear()
rs.setOutput("back", true)
end
end
end
that should mostly do it.
Thanks's so much for this!!!Your awesome.Now I can finally do what I want to.