+ Reply to Thread
Results 1 to 8 of 8

Thread: Current Time Gate

  1. #1
    Wire Amateur yaworski's Avatar
    Join Date
    Feb 2007
    Location
    Poland
    Posts
    81

    Default

    Hi.

    This would be cool to have a gate that would be simply returning the current time (if it is not cut from gmod's lua, then os.time should be enough as it return the number of seconds from epoch). This should be a timed gate since it wouldn't have any inputs to trigger it.

    Possible applications? In connection with expression evaluator or cpu chip this could create a very precise countdown timers (for example you press the button, the cpu remembers the current time and then in loop it checks if 30 seconds has left since then and triggers its output - this is just a example). Of course there are now other ways to do counters, but anyway current time gate would be good to have.

  2. #2
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    Hi.

    This would be cool to have a gate that would be simply returning the current time (if it is not cut from gmod's lua, then os.time should be enough as it return the number of seconds from epoch). This should be a timed gate since it wouldn't have any inputs to trigger it.

    Possible applications? In connection with expression evaluator or cpu chip this could create a very precise countdown timers (for example you press the button, the cpu remembers the current time and then in loop it checks if 30 seconds has left since then and triggers its output - this is just a example). Of course there are now other ways to do counters, but anyway current time gate would be good to have.[/b]
    Well I can't see any other use for it other than to easily get the current time?
    You already have gates that can count time, but they measure from the time they was created.

  3. #3
    Wire Amateur Yerocrg's Avatar
    Join Date
    Mar 2007
    Location
    New Jersey, U.S.A.
    Posts
    89

    Default

    Hi.

    This would be cool to have a gate that would be simply returning the current time (if it is not cut from gmod's lua, then os.time should be enough as it return the number of seconds from epoch). This should be a timed gate since it wouldn't have any inputs to trigger it.

    Possible applications? In connection with expression evaluator or cpu chip this could create a very precise countdown timers (for example you press the button, the cpu remembers the current time and then in loop it checks if 30 seconds has left since then and triggers its output - this is just a example). Of course there are now other ways to do counters, but anyway current time gate would be good to have.[/b]
    So essentially you are describing a device similar to the GPS and gyroscope, but for time rather than position or angle? That could actually be pretty useful. Other possible applications would be in precisely synchronizing transmitting and receiving stations.
    <div class='quotetop'>QUOTE(Infinity) <{POST_SNAPBACK}></div>
    Wire igniter? I think it&#39;ll turn to hell...
    <div class='quotetop'>QUOTE(TAD2020) <{POST_SNAPBACK}></div>
    Would only require a heavenly modified wire stool to do this.

  4. #4
    Wire Amateur yaworski's Avatar
    Join Date
    Feb 2007
    Location
    Poland
    Posts
    81

    Default

    Do you mean, for example, doing multiplexing/demultiplexing the "signal" that is sent through the radio, don&#39;t you? It could be really easily done.

    For example: spawn 2 radios, spawn 2 current time gates (if they would be available ), spawn 1 router gate and one choice gate. We will also need some logic that would calculate a integer value in range [1,8] (2 sets of such logic, they must work exactly the same way). Lets name this logic "selector".

    Then on transmitting station connect choice to radio, current time to "selector" and "selector" to the choice input in choice gate. On the receiving station (can be more of them) connect radio to router, current time to "selector" and "selector" to route input of the router.

    Then you can connect some values to the choice gate&#39;s inputs and receive them on the receiving stations on the same output on the router. Of course there would be a need to hold the value on each output of router until the next value will be sent (depending on how fast the "selector" changes the path for (de)multiplexing).

    Yay for current time gate . Hehe.

  5. #5
    Wire Sofaking tomb332's Avatar
    Join Date
    Mar 2007
    Location
    Birmigham,UK
    Posts
    1,377

    Default

    i can make a gate that outputs the time i think so il look at it today if i have time.
    EDIT made the gate just testing it
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

    Super Easy Wire Download

  6. #6
    Wire Amateur yaworski's Avatar
    Join Date
    Feb 2007
    Location
    Poland
    Posts
    81

    Default

    This gate is not hard to code because it should be only one line in output function: return CurTime()

  7. #7
    Wire Sofaking tomb332's Avatar
    Join Date
    Mar 2007
    Location
    Birmigham,UK
    Posts
    1,377

    Default

    i know i have that but it outputs 1.08e3 or something and i cant work out how to get this into a current time. Any help?
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

    Super Easy Wire Download

  8. #8
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Done, it&#39;s already in SVN. Look in change log to see in what format there is output (there is OS Date and OS Time)
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

+ Reply to Thread

Similar Threads

  1. More time() help
    By somone77 in forum Installation and Malfunctions Support
    Replies: 16
    Last Post: 01-30-2010, 02:13 PM
  2. How do I make Random Chip stop on the current number it's at?
    By Sixers2329 in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 09-20-2008, 05:10 PM
  3. Time in expression gate
    By Dark_Hero in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 08-29-2008, 11:54 AM
  4. Current Big Project?
    By Eagleguy125 in forum Wiremod General Chat
    Replies: 55
    Last Post: 01-06-2008, 02:29 AM
  5. How to get the current Z position of a player?
    By Beer in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 07-25-2007, 01:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots