Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: E2 - Simple Timer

  1. #1
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Lightbulb E2 - Simple Timer

    Hello.

    the thing im trying to suggest is a in-build simple timer in the E2.
    currently we only have the timer(S,N) function, which is more like an interval.
    what im thinking off is something like the actual timer you can spawn.
    so here is the features i would suggest:

    varTimer(S,N) # This will create timer S, where S is the name, and N the interval, returns nothing.
    varTimerStop(S,N) # This will stop timer S if N is true, while N is true it will remain at the value it reached before the Stop, returns nothing.
    varTimerReset(S,N) # This will reset timer S if N is true, while N is true it will remain zero, returns nothing.
    varTime(S) # This will read a timer, returns the value of the timer.

    The reason for the varTimer(S,N) not returning anything is because you would then have to create a variable containing the timer, but if you use varTimer(S) you dont have to create that variable.

    I have been thinking of doing this project myself, but since my Lua knowledge is little to nothing, it won't give any good results

    Creator of the Unofficial servers

  2. #2
    Wirererer MixZim's Avatar
    Join Date
    Jul 2008
    Posts
    157

    Default Re: E2 - Simple Timer

    This is a timer, a normal timer

    What I am searching for is:

    if (A == 1) {B += 1} (this will NOT be updated by an interval)

    if (C == 1) {D += 1} (I want this to be updated by an interval)



    each time you MANUALLY press the button A, it will +=
    and the OTHER one B, will update it when you hold it
    Last edited by MixZim; 05-10-2009 at 03:21 AM.

  3. #3
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: E2 - Simple Timer

    Uhm, sir.
    What your searching for is easy?

    Code:
    @name Changer
    @inputs BA BB
    @outputs VA VB
    @persist 
    @trigger all
    interval(10)
    if (BA) {VA += 1}
    if (~BB & BB) {VB += 1}
    Took me 2 minutes to make

    Creator of the Unofficial servers

  4. #4
    Wire Sofaking Echo51's Avatar
    Join Date
    Feb 2009
    Location
    Denmark
    Posts
    1,489

    Default Re: E2 - Simple Timer

    I dont quite get what your trying to bring into E2, and i doubt i will without explanation.


    ah, og velkommen til forummet :P
    Proud of my non-existant life...
    In russia, Expression 2 codes you!
    Quote Originally Posted by Snowden42 View Post
    Nooblishious? That's a signature keeper.

  5. #5
    Bug Buster TomyLobo's Avatar
    Join Date
    Feb 2009
    Posts
    2,796

    Default Re: E2 - Simple Timer

    he wants to make "simple" timers that are more complicated than the ones we have now
    and also more useless
    "It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup

    Lífið læðist lúmskt áfram

  6. #6
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: E2 - Simple Timer

    Well, if you could explain to me exactly how the current timer works.
    Because my experiences with it aint good, i dont really see any use for it(i DID look on the wiki..).
    Im trying to implent a "Timer" in Expression 2, like this:
    varTimer("Lol",10) this will make a timer with interval 10, this timer will count like a normal timer does, so for reading it i use varTime("Lol").
    You get it now?

    Mange tak

    Creator of the Unofficial servers

  7. #7
    Bug Buster TomyLobo's Avatar
    Join Date
    Feb 2009
    Posts
    2,796

    Default Re: E2 - Simple Timer

    read the manual...

    timer("foo", 10) will execute the expression again in 10 milliseconds (more or less)
    during that execution, clk("foo") will return 1

    interval(10) will execute the expression again in 10 milliseconds (more or less)
    during that execution, clk() will return 1
    "It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup

    Lífið læðist lúmskt áfram

  8. #8
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: E2 - Simple Timer

    Tomy I think he wants:
    Code:
    timer("Tits",10)
    if ( clk("Tits") ) {
        Timer+=0.01
    }
    With his suggestion there is no need to have a Timer variable.

    Which is pointless because:
    Timer
    Is the same as:
    Timer=varTimer("Tits")
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  9. #9
    Wire Sofaking ahref's Avatar
    Join Date
    Jul 2008
    Posts
    520

    Default Re: E2 - Simple Timer

    It becomes depressing when people do not read the documentation.
    A-Z Materials - Released!!!!!!!

  10. #10
    Bug Buster TomyLobo's Avatar
    Join Date
    Feb 2009
    Posts
    2,796

    Default Re: E2 - Simple Timer

    ahref is right:
    step 1: try it for yourself
    step 2: read the manual
    step 3: ask in the help forum
    step 4: post a suggestion here if you think it should be added

    you somehow thought it's a good idea to skip most of those steps
    "It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup

    Lífið læðist lúmskt áfram

Closed Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Help with simple timer mechanism
    By rawn in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 03-06-2009, 07:39 PM
  2. Two Quite Simple Timer Uses
    By thedood in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 3
    Last Post: 08-26-2007, 03:14 AM
  3. Simple 7-Segment working timer (2 digit)
    By Mr. Brightside in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 2
    Last Post: 08-15-2007, 04:09 PM
  4. Pretty Simple Question for a very simple Expression
    By ckyfan2k in forum Installation and Malfunctions Support
    Replies: 8
    Last Post: 07-29-2007, 10:41 AM
  5. simple colour indicator timer thing
    By rh26 in forum Finished contraptions
    Replies: 2
    Last Post: 06-28-2007, 02:06 PM

Tags for this Thread

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