Shoutbox

script sleep command - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: script sleep command (/showthread.php?tid=72387)

script sleep command by Gareth_2007 on 03-07-2007 at 01:09 AM

im looking for a script wait command! any ideas? cheers


RE: script sleep command by Voldemort on 03-07-2007 at 01:11 AM

Can you elaborate as to what a 'wait command' is?


RE: script sleep command by Gareth_2007 on 03-07-2007 at 01:12 AM

well i need to pause the code for a few second to let merlin finish what he is saying be for the action it completed

on java forums i have seen Thread.sleep(1000);  but that does not work :( any ideas? cheers


RE: script sleep command by Dennis Mike on 03-07-2007 at 02:47 AM

MsgPlus.AddTimer("time",1000)     
this is what you want?


RE: script sleep command by Felu on 03-07-2007 at 03:15 AM

code:
Interop.Call("Kernel32", "Sleep", 100);
That what you looking for?
RE: RE: script sleep command by felipEx on 03-07-2007 at 05:16 AM

quote:
Originally posted by Felu
code:
Interop.Call("Kernel32", "Sleep", 100);
That what you looking for?

100 or another value represents the milliseconds ;)
RE: script sleep command by -dt- on 03-07-2007 at 06:07 AM

quote:
Originally posted by Felu
code:
Interop.Call("Kernel32", "Sleep", 100);
That what you looking for?
never use that : <, it freezes messenger which is a evil thing to do, use timers instead
RE: script sleep command by Volv on 03-07-2007 at 08:31 AM

You should never use sleep in any program (not just scripts), including VB6 (which is probably where you got the idea from).


RE: script sleep command by CookieRevised on 03-07-2007 at 10:58 AM

Also, there are especially commands and methods to instructs MS Agent to wait and do other stuff.

http://msdn.microsoft.com/library/default.asp?url...pacontrol_7qng.asp

Also, if you use the speak commad, it already should say the entire text before it does anything else.


----------

As said before, never ever use a sleep command in code.

;)


---------

Here is a script I've made for someone. It was originally posted in another thread with much more detailed explanation, but unfortunatly the guy who requested this has removed that thread...

PS: there are also some other scripts on the forums which use MS Agent, so you could search for those too and take a look at them (search on "agent").


RE: script sleep command by Gareth_2007 on 03-07-2007 at 12:57 PM

just been looking at that merlin script! what does merlin do its not in english cheers


quote:
Originally posted by Felu
code:
Interop.Call("Kernel32", "Sleep", 100);
That what you looking for?



cheers that what i wanted
RE: RE: RE: script sleep command by CookieRevised on 03-07-2007 at 03:31 PM

quote:
Originally posted by Gareth_2007
quote:
Originally posted by Felu
code:
Interop.Call("Kernel32", "Sleep", 100);
That what you looking for?

cheers that what i wanted

I'm sorry but that is not what you wanted... please do not ever use that...

It will effectivly halt everything on Messenger, not just your script. See all the posts above...
RE: script sleep command by Matti on 03-07-2007 at 05:33 PM

The best thing you could do is to use the MsgPlus timers, which was also mentioned earlier in this thread (therefore, always read the whole topic ;)). An example would look like this:

code:
function OnEvent_SignIn(Email) {
   if(Email == "someone@hotmail.com") {
      MsgPlus.DisplayToast("Welcome", "Hello there!");
      MsgPlus.AddTimer("SignIn_Sleep", 1000); //1000 milliseconds = 1 second
   }
}

function OnEvent_Timer(TimerId) {
   if(TimerId == "SignIn_Sleep") {
      MsgPlus.DisplayToast("Welcome", "How are you today?");
   }
}

RE: script sleep command by CookieRevised on 03-07-2007 at 05:38 PM

quote:
Originally posted by Mattike
The best thing you could do is to use the MsgPlus timers, which was also mentioned earlier in this thread (therefore, always read the whole topic ;)).
Actually no, the best thing todo is use the already available properties and methods for the MS Agent object. With those you can control everything, including a delay and/or waiting until something is finished, etc.

quote:
Originally posted by CookieRevised
Also, there are especially commands and methods to instructs MS Agent to wait and do other stuff.

http://msdn.microsoft.com/library/default.asp?url...pacontrol_7qng.asp

Also, if you use the speak commad, it already should say the entire text before it does anything else.