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

TV Show "LOST" Countdown Timer

Started by MG42MG34, 17 December 2012 - 05:22 PM
MG42MG34 #1
Posted 17 December 2012 - 06:22 PM
Hello! I've just made the hatch from "LOST" and am looking for some help with a countdown timer setup similar to that in the show.
For those who are not familiar with it:
It's a 108 minute countdown timer.
The code " 4 8 15 16 23 42" has to be entered in the last 4 minutes of the timer otherwise, well, something bad happens.
More info: http://lostpedia.wik...Countdown_timer


I have a single monitor setup connected to a single monitor via Redpower wire and regular redstone at the moment.


Looking forward to replies! Thx,
MG42MG34
Dlcruz129 #2
Posted 17 December 2012 - 06:23 PM
Umm… What exactly is the problem?
MG42MG34 #3
Posted 17 December 2012 - 06:26 PM
Umm… What exactly is the problem?

I only know how to make a password door.
Dlcruz129 #4
Posted 17 December 2012 - 06:27 PM
Umm… What exactly is the problem?

I only know how to make a password door.

Please give more info. Post your current code, and any problems you are having.
MG42MG34 #5
Posted 17 December 2012 - 06:29 PM
Umm… What exactly is the problem?

I only know how to make a password door.

Please give more info. Post your current code, and any problems you are having.

I currently have nothing, and am just looking for some way to do it / trying to find out if it's possible. No errors atm.
Dlcruz129 #6
Posted 17 December 2012 - 06:32 PM
Umm… What exactly is the problem?

I only know how to make a password door.

Please give more info. Post your current code, and any problems you are having.

I currently have nothing, and am just looking for some way to do it / trying to find out if it's possible. No errors atm.

Look into timers on the wiki, then use coroutines to run the timer and wait for user input.
MG42MG34 #7
Posted 17 December 2012 - 06:35 PM
Umm… What exactly is the problem?


How would I make user input only available during the last 4 mins of the 108 mins?

I only know how to make a password door.

Please give more info. Post your current code, and any problems you are having.

I currently have nothing, and am just looking for some way to do it / trying to find out if it's possible. No errors atm.

Look into timers on the wiki, then use coroutines to run the timer and wait for user input.
MG42MG34 #8
Posted 17 December 2012 - 06:37 PM
Oops! bad post. Was saying….how would i make user input only available during the last 4 mins of the 108 mins. :)/>
theoriginalbit #9
Posted 17 December 2012 - 06:37 PM
Umm… What exactly is the problem?

I only know how to make a password door.

Please give more info. Post your current code, and any problems you are having.

I currently have nothing, and am just looking for some way to do it / trying to find out if it's possible. No errors atm.

Look into timers on the wiki, then use coroutines to run the timer and wait for user input.

You love your coroutines don't you. You know that they aren't the solution to everything right?
MG42MG34 #10
Posted 17 December 2012 - 06:43 PM
What I'm thinking is to have a 108 min countdown timer going at all times (on loop). Then have to input the code which is going to be a program that reset the 108 min timer (only available during the last 4 mins.)
theoriginalbit #11
Posted 17 December 2012 - 06:51 PM
do what Dlcruz129 said and use a timer. I would have 2, one that times 104 mins, then the last one that times the 4 mins is triggered when the 104 one is done.
MG42MG34 #12
Posted 17 December 2012 - 06:53 PM
do what Dlcruz129 said and use a timer. I would have 2, one that times 104 mins, then the last one that times the 4 mins is triggered when the 104 one is done.

This is all they have on timers on the wiki:
Event timer Fired when a timer completes. Returned Object 1 The timer's numerical representation value (returned when os.startTimer() is initially called).
Function os.startTimer Adds a timer which will fire a "timer" event once after time seconds have passed. It returns a table which acts as a unique ID for the timer. Syntax os.startTimer(float time) Returns Table timerID Part of ComputerCraft API OS
Event timer Fired when a timer completes. Returned Object 1 The timer's numerical representation value (returned when os.startTimer() is initially called).

Also, how will I display the min&sec countdown timer (xxx:xx) on the monitor? Is it possible to connect a monitor and a Computer using redstone at all? lol
Probably not even possible, but It would be cool to have a alarm (http://thetekkit.wik...ki/Howler_Alarm) start when the 4 min timer starts.
This all seems like Greek to me D:
theoriginalbit #13
Posted 17 December 2012 - 07:09 PM
this is the basics of what they meant

when you start a timer like this

longTimer = os.startTimer(6) -- 6 seconds

and then it finishes it will trigger a system event which needs to be captured using

event, param = os.pullEvent()
or


event, param = os.pullEventRaw()

where event is "timer", "rednet_message", "key", "char" or a few others and the parameters are other things it returns like which timer was triggered, or what key was pressed etc.

Making a little more sense now?
MG42MG34 #14
Posted 17 December 2012 - 07:21 PM
this is the basics of what they meant

when you start a timer like this

longTimer = os.startTimer(6) -- 6 seconds

and then it finishes it will trigger a system event which needs to be captured using

event, param = os.pullEvent()
or


event, param = os.pullEventRaw()

where event is "timer", "rednet_message", "key", "char" or a few others and the parameters are other things it returns like which timer was triggered, or what key was pressed etc.

Making a little more sense now?

Seems like I'm a bit over my head here lol.
I've decided just to go for a cosmetic look, that being just a timer (this format: 000:00 [108:00]) on a monitor that counts down and restarts with no user input. Is there anywhere I can find the code for that?
ChunLing #15
Posted 17 December 2012 - 11:18 PM
I'm positive that someone already wrote a "LOST Countdown Clock" somewhere. Let's see…Here it is.
Dlcruz129 #16
Posted 18 December 2012 - 04:36 AM
Umm… What exactly is the problem?

I only know how to make a password door.

Please give more info. Post your current code, and any problems you are having.

I currently have nothing, and am just looking for some way to do it / trying to find out if it's possible. No errors atm.

Look into timers on the wiki, then use coroutines to run the timer and wait for user input.

You love your coroutines don't you. You know that they aren't the solution to everything right?

When you need to check time and get input, they're easier to use then os.pullEvent()