Someone on the IRC channel asked if JS had a Sleep() function to pause the script for x milliseconds, and apparently it doesn't. I tried to make my own function, but the problem is since it's not multithreaded it causes everything to freeze for the duration that you pause the script.
My function is the following:
code:
function Sleep(ms)
{
var x = Interop.Call("Kernel32", "GetTickCount");
var y = x;
while (y + ms > x)
{
x = Interop.Call("Kernel32", "GetTickCount");
}
}
Calling the Sleep() API with Interop.Call does the same.
Is it possible?