Fast Lua Timer

  • dom2mom
    2nd Feb 2013 Member 0 Permalink

    A fast lua timer that... well... times.

     

    http://pastebin.com/dYqGkj0M

     

    Also, how do I put a window showing code? (like the gray box)

  • boxmein
    2nd Feb 2013 Former Staff 0 Permalink
    @dom2mom (View Post)
    You have to use a sort of tool kit to create such windows. For Lua you could use http://www.tecgraf.puc-rio.br/~celes/tklua/ for example. Those toolkits are usually quite hard to master.
  • Box-Poorsoft
    2nd Feb 2013 Banned 1 Permalink
    This post is hidden because the user is banned
  • boxmein
    2nd Feb 2013 Former Staff 1 Permalink
    @dom2mom (View Post)
    Ah, that one is just
    <code>
    code goes inside
    </code>

    code goes inside
  • dom2mom
    2nd Feb 2013 Member 0 Permalink
    Ooh. Let me try.

    --Lua Timer made by dom2mom
    local time = os.date("*t")
    delay = PUT DELAY HERE
    timer = time.PUT HOUR, MIN, OR SEC HERE
    print (string.format("The start time is %d:%d:%d",time.hour, time.min, time.sec))
    local isTimerUp = false
    while isTimerUp == false do
    time = os.date("*t")
    if time.PUT HOUR, MIN, OR SEC HERE == timer + delay then
    print (string.format("The end time is %d:%d:%d",time.hour, time.min, time.sec))
    isTimerUp = true
    end
    end

    EDIT: Why is it seperated by lines instead of one big thing?
    Edit-jacob1: fixed it
  • jacob1
    2nd Feb 2013 Developer 0 Permalink
    @dom2mom (View Post)
    you put each line in a separate <code>. You just need one <code> at the beginning and one </code> at the end of everything.
  • dom2mom
    3rd Feb 2013 Member 0 Permalink

    @jacob1, thats what I did :/

  • Sergeant_Starfruit
    3rd Feb 2013 Member 0 Permalink

    Yay. I've wanted to know how to do that. I'm going to try.

    <code>

    Beep

    </code>

  • dom2mom
    3rd Feb 2013 Member 0 Permalink

    no, in the HTML editor

    hi there this is a test

    see? if I don't put separete <code> then it goes into one line

  • jacob1
    3rd Feb 2013 Developer 0 Permalink
    I don't use the fancy html editor, it makes the format of posts ugly and hard to edit. And adds useless <p>'s everywhere. Also a few other random things. I'll try editing yours though, I know how to fix it. (and i'll delete the <p>'s, if not it destroys the formatting of your post if I save)

    I'm not sure how to do it correctly with the html editor then. (I have use WYSIWYG turned off in profile settings)