Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Wait 1 second then do action?

jabyfish
Registered User
Quote
2020-10-20 00:29:38

How can I script a behavior plugin for coppercube wait 1 second then do action? Does anyone know it?


just_in_case
Moderator
Quote
2020-10-20 08:21:03

There is a n extension named Do something Later , you can specify time in that action and then after that time your desired action will be executed. You can download the extension from Coppercube extensions download page.


cao.branco666
Guest
Quote
2020-10-22 02:46:15




frostline-et
Registered User
Quote
2020-11-17 16:56:57

If you want to use JavaScript...

Make a variable that records the current time.

var currentTime = timeMS;


Then, make a variable that measures how much time has passed since the current time.

var passedTime = timeMS - currentTime;


Finally, create an if-statement where if the time passed is a second, the action is executed. Remember that 1 millisecond = 1000 seconds (milli = 1/1000) so multiply the time you need by 1000.

if (passedTime == 1 * 1000)
{
//statements
}


When you put it all together:

var currentTime = timeMS;
var passedTime = timeMS - currentTime;

if (passedTime == 1 * 1000)
{
//statements
}



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact