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!

DOWNLOAD
 Full Scripts
 Addons
 Snippets
 DLLs
 MTS Themes
 Tutorials
 Misc.
 File Queue
 Download mIRC
INTERACT
 Screenshots
 Challenge
 Top Downloads
 Submit Form
 Forums

SEARCH
Site Search

FRIENDS
Link to us!
PhotoShelf

Home | Comments:
Average Rating:   9   /sleep by Online
Description:
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.
Screenshot:
No
Screenshot
Available

Comments:

  Mode:    Create New Post

DorDec 11, 2006 3:47PM
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 15, 2005 3:10AM
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 wscript.shell
  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 @ 4:56PM




Create New Post

You must be logged in to post messages.