Please Disable Ad-Block To View This Website.

If you block ads, this site can not survive!

Ads are very minimal for registered users. If you don't have an account please register now!

 Full Scripts
 MTS Themes
 File Queue
 Download mIRC
 Top Downloads
 Submit Form

Site Search

Link to us!

Home | Comments:
Average Rating:   9   /sleep by Online
Author's description :
Command that suspends a script by the specified milliseconds. whilst the script is suspended mIRC doesn't freeze, ie you can run other commands and do general stuff.

This could be done by taking advantage of WScript's Run method, that allows you to even hide windows and wait for the running command to return. my snippet creates a simple .wsf script that is used to sleep, runs it and wait until it returns (more info can be found at Windows Scripting documentation - see qwerty's /sendkeys snippet comments).

thanks qwerty for the support :)

Last note: it looks like /sleep makes next events queued, like if you run it from an on TEXT for example, the next on TEXT will wait until /sleep finishes. It looks like putting /sleep on an signal and triggering it by /signal from the current event gets around it.

The code isn't perfect yet, if you have any improvement or debugging ideas please contact me.

Submitted Review Author's Updates

There is no review for this file yet.
There are no update notes.


  Mode:    Create New Post

DorDec 11, 2006 10:47AM
Rating:     9one of the more useful snippets :)
although it has a little inaccuaracy (it doesn't wait exactly N miliseconds) i'll find a good use of it.

well done :)

FiberOPticsOct 14, 2005 11:10PM
Small note regarding the usage of a wsf file in the way you did. I've found that using a vbs file with wscript.sleep <N> works as well, making the code somewhat shorter, although well, the size doesn't really matter anyway.

alias sleep {
  if ($1 !isnum 1-) return
  var %a = $ticks $+ .vbs
  write %a wscript.sleep $1
  .comopen %a
  if (!$comerr) .comclose %a $com(%a,Run,3,bstr,%a,uint,0,bool,true) 
  .remove %a

EDIT: Forgot to mention, very nice snippet :)

Text edited by author on Oct 15, 2005 @ 12:56PM

Create New Post

You must be logged in to post messages.