What is the equivalent of JavaScript's setTimeout on qtScript?

Discussion in 'Server and Client Scripting' started by WindScar, Jun 28, 2012.

  1. WindScar

    WindScar New Member

    Joined:
    Jun 28, 2012
    Messages:
    1
    Likes Received:
    0
    What is it?
     
  2. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    There is none in Qt Script directly, but we have sys.delayedCall, which takes a function and mlliseconds.
     
  3. Stawbery Jam

    Stawbery Jam Banned

    Joined:
    Jun 21, 2012
    Messages:
    42
    Likes Received:
    0
    WindScar U can Download Lutra And Unknown Scripts these are cool especailly Lutra
    /tiersinstall po>For Tiers
    /Playerinfo name>For info
    /Owner name>For auth
    ETC
     
  4. Kalashnikov

    Kalashnikov Despite the code quality

    Joined:
    Apr 4, 2011
    Messages:
    434
    Likes Received:
    0
    Seconds, according to docs.
     
  5. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    You are right. Hopefully a resolution of one second will be enough.

    There is also sys.callQuickly(programstring, milliseconds) but as its name says, it takes a string which is a lot harder to code and less robust than a real function. I do not recommend using it at all.
     
  6. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    PO 2.0 will have:
    quickCall(function, milliseconds)
    intervalTimer(string, milliseconds)
    intervalCall(function, milliseconds)
    stopTimer(timerid)

    for both server and client scripts.

    All of the timer functions will return their id(int). You can store this in an array, for example.