/pause

By FiberOPtics on Jan 14, 2006


Author: FiberOPtics



Email: mirc.fiberoptics@gmail.com



Usage: /pause <s|ms> <N>, where s stands for seconds, and ms for milliseconds.



Examples:



//echo -a hi | pause s 3 | echo -a sup

//echo -a 1 2 3... | pause ms 1500 | echo -a 4



Purpose: Will pause the script engine on the current thread from processing, until the specified interval in seconds "s" or milliseconds "ms" has passed.



Reqs:

mIRC 5.91

/pause with param 's' works on all Windows versions

/pause with param 'ms' works on Windows OS'es from Win2k and higher





Notes:

- If you want to use this in an event, use a signal, as otherwise it would pause the event,making successive triggerings of the event queued.



- The reason the millisecond property only works from Win2k on, is because pathping.exe only started to be shipped from that OS. So in theory, you could use this snippet on all Windows versions, as long as it has pathping.exe installed.



- Remember that mIRC has the functionality of timers (/help /timer), so look into using, timers before resorting to /pause.



- Online has already created a great /sleep snippet that works on all Windows OS'es that don't have Windows Scripting disabled, so why did I release this snippet?



<=> /pause doesn't have to do disk access in order to work, which makes it more efficient and less slow.



<=> /pause is more accurate in respecting the specified interval to pause (don't expect it to be right on the spot though, there will always be some variation)



<=> /pause doesn't trigger anti-spyware/anti-virus programs, something /sleep suffers from with for example MS Windows AntiSpyware, because it executes a Windows Scripting file, which is often seen as malicious. This was the primary reason to release /pause.

alias pause {
  var %e = !echo $color(info) -a * /pause:
  if ($version < 5.91) {
    %e this snippet requires atleast mIRC version 5.91
  }
  elseif ($isid) {
    %e this snippet can only be called as a command.
  }
  elseif (!$regex(pause,$1-,/^m?s \d+$/Si)) {
    %e incorrect/insufficient parameters. Syntax: /pause <s|ms> <N>
  }
  elseif ($1 == ms) && ($os isincs 9598ME) {
    %e cannot use milliseconds parameter on OS'es beneath Win2k
  }
  elseif ($2 !isnum 1-) {
    %e must specify a number within range 1-
  }
  else {
    var %wsh = $+(wsh,$ticks,$r(1111,9999)), %cmd
    if ($1 == s) %cmd = ping.exe -n $int($calc($2 + 1)) 127.0.0.1
    else %cmd = pathping.exe -n -w 1 -q 1 -h 1 -p $iif($2 > 40,$calc($2 - 40),$2) 127.0.0.1
    .comopen %wsh wscript.shell
    if ($comerr) %e unable to open Wscript.Shell
    else .comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c %cmd >nul,uint,0,bool,true)
  }
}

Comments

Sign in to comment.
FiberOPtics   -  Aug 10, 2015

Hey guys, sorry for that negative rant back there in January 2006, don't take it too seriously please :)

jaytea is right, I must have been ticked off that day, lol, embarrassing to read it in retrospect!

hixxy, I'm trying to remember your previous nickname, I've seen it in countless posts, and on the tip of my tongue, but can't quite get it.

What a great time it was in those years, back in university, all I did was go out and if i wasn't out, i was spending time on IRC. In the early years on Dalnet heavily into DBZ under the alias Perfecta_Cellka or later Cellka where I was a SOP on #dbzirc and co-founder of #dbzmedia.

FiberOPtics was my scripting alter ego that I used in the mirc.com message boards, already then I didn't chat much, but the scripting was too much fun. My education and jobs have no link to coding or anything like that, but 2 years ago, for fun, decided to learn python, I missed scripting. Made an IRC chat client, a webpage with python backend, and most recently I'm using it for home automation. Guess the tinkering with code will never die.

Some of my favourites and most memorable scripters were qwerty, Online, jaytea, Iori/Pai, myndzi, Hammer. In later generations I know myggan & hixxy were also very good. I'm sure there were so many more but those names I can remember easily!

jaytea, remember when qwerty was challenging us on the regex commatizer? Man those were the days!

Have fun :)

 Respond  
hixxy   -  Feb 24, 2011

FiberOPtics, qwerty and jaytea - the three scripters I respect the most and recognise as the best.

Shame FO quit a long time ago and I rarely see qwerty these days! :-(

But yeah, snippets on this website really do get lower scores than on other sites. I think it's because this site has more of a "social" feel to it.

 Respond  
jaytea   -  Feb 16, 2011

yes, i'm probably guilty of the same ;) when you spend innumerable hours over the years on something, you're bound to care about it perhaps a little more than you should!

if you're referring to Kall then yes, also excellent in his own right :P

 Respond  
MoshMage   -  Feb 16, 2011

OH!! Tottaly got the point of it now. And im not judging HIM like him alone i was pointing out a fact from us all that "we care too much" about mirc scripting.

I knew someone like that over PTnet, so hurray for FOPtics :)

 Respond  
jaytea   -  Feb 16, 2011

there is a key difference between mIRC's timers and the functionality offered by this snippet. timers operate asynchronously; you can't, for example, use a timer to pause and interrupt a custom alias to grab a value sent from the server.

and i wouldn't judge FOPtics by his monologue up there. he was a terrific coder (probably still is, though he left the mIRC scene a while ago :P) who devoted a lot of time to helping countless scripters and creating snippets that, for the most part, have stood the test of time. perhaps he was in a bad mood when he wrote that post.

 Respond  
MoshMage   -  Feb 16, 2011

erm, maybe i'm not vewy bright buut. why /pause when u can timer it? i mean, it's the exact same thing, except it uses a outside method.

Maybe that's why you got a 6, you just spawn this here. you make no pros and cons, you just hope people understand that that comopen thingy is 'hard' to do and therefore it's awesomesauce code and therefore great snippet..

Well, i'm not even going to rate it. As far as i'm concerned, rating a code over how good it is is shit if the codes accomplishes absolutly nothing new. as.. it is the case.

Also, this isn't a Iphone App or anyother important scripting thing. people will you realize that you're getting upset because of mIRC Scripting. MS is only good for training ur brain and having a good time other than that is.. utter sh+t so, why rate?


I just realized this threat has been dead for ages. -.-'

 Respond  
Sativo   -  Feb 16, 2011

very usefull for games

 Respond  
PATX   -  Apr 19, 2009

rating: 1 (bad)
reason: could use timer.

 Respond  
Eugenio   -  Jul 01, 2008

ROFL @ him getting angry coz someone rated 6 wtn

 Respond  
magoo   -  Jul 01, 2008

Thanks dude, very useful!
I was very surprised that since I haven`t used mIRC for some time that there is still no sleep or wait...

 Respond  
elle_mcpherson   -  Jun 17, 2007

great script if i was able to score it id give it a 10 ;)

 Respond  
bearruler   -  Jan 20, 2006

I go through and I see these script that have been done 100 times before, take up 10x the space of something I would make and never post.
I give them 1s or 2s and move on

Its great people are learning to script, but code that sucks and is useless doesnt deserve to get a 4 or a 5. I spend a very long time on snippets I upload. I make them for myself, then figure hell, why not post it. If it sucks, give it a 2.
I have posted bad scripts before, an looking back on it I know they should have gotten lower scores

You are one of the best scripters on here, Id hate to see you go.
This script is Very useful and deserves a 9.

Bear

 Respond  
hixxy   -  Jan 15, 2006

Btw.. your description is messed up because you have an [ s] in there (without the space.)

 Respond  
hixxy   -  Jan 15, 2006

I actually don\'t mind getting low scores. I think it\'s a refreshing change that a website has users who rate based on how useful they think the snippet is, rather than how well coded it is. Most communities use the latter method.

My snippet that reads audio information from files gets an 8.6 and my hotlink bans snippet gets a 6.5, while my snippet that plays audio streams only gets a 6. I think the stream playing snippet is by far the most useful but I respect and understand that not everyone shares my opinion.

Instead of getting angry about receiving low scores for an obviously well coded snippet, just accept that your snippet is being rated by users on how useful they think it is, rather than how well it is made, and judging by the amount of simple questions asked on the forum I\'d say not many users on this website can even use your snippets! (Which would explain low ratings.)

 Respond  
RoninWarrior   -  Jan 14, 2006

Fiber i have to totally agree with you on just about everything you have stated but i for one dont grade very high on anything just because it has been done a hundred times just coded diffrently i understand your frustration though to get a low score on something you have done is degradeing and to some people it really punches then hard as it did you but for you to get mad or upset that to me isnt you if you want to get point across show everyone that comes just how you do it buy your codeing for mIRC and the others things you do take it to a how nother level and we will follow or atleast try to anyway you have some serious skill for mirc scriptting for sure i have learned alot from your code that you have posted here in the past couple weeks or so , so instead of saying good bye say this is the way scriptting should be innovate! and there are alot of others also i have seen here submitt things that are not to there normal level yonix russleB xDaemon tye hawkee tank59 and there are many others also i can list i by far am not even considered being remotly close to any of you guys when it comes to scriptting but i read and learn from you all it would be a shame for you to leave when you have so much to offer so on that note march on solider and lead everyone in to a whole new era of irc!

 Respond  
tank59   -  Jan 14, 2006

twocents on

It\'s obviously your choice, but I and many others still want you here. Your contribution of code is phenominal and very useful. I agree, the rating system here is weak, but I don\'t think that the majority of people who matter look at that when examining a piece of code. It would be better to get rid of a rating system completely on snippets as far as I\'m concerned. After all, they\'re here for peoples use, and learning. Not competition of who can make the best script. If you want your code ranked, submit it as an addon. After all, I think you\'ll get a low score from someone who doesn\'t like you, your coding style, or the code itself, anywhere you post. It\'s not like the other sites have a sign at the front page saying: \"Only professional scripters allowed.\" The rating system just might be better at those sites. Hopefully you\'ll change your mind.

twocents end

 Respond  
Foamy   -  Jan 14, 2006

You know you\'re 10x better than any scripter here?

 Respond  
FiberOPtics   -  Jan 14, 2006

You don\'t understand.

It\'s not so much the fact that I got a 6, although it is far beneath what it is worth, no matter if I\'m the author, I\'m objective enough to know quality code when I see it.

My gripe is that I get a grade that is only just above some of the absolute garbage that gets posted here. I don\'t know about others, but for me, that is completely insulting. You know, my code actually works! Some of the snippets that got submitted here this week don\'t even work properly, or are suffering from design mistakes that shouldn\'t be there in the first place. That\'s why I was mad, I\'m almost getting the same score as those people, and they can\'t even script!

The score of a snippet says something about the quality of the snippet, of the code, of its usefulness, on how much care the author used when creating the snippet. Do you know how much time I spent on writing the documentation for my snippets? Take a look at my $fileinfo snippet, writing the documentation for that took longer than writing the code.

Anyway, what bothers me the most is that people who don\'t have a clue about mIRC scripting have the ability to grade me with whatever score they want.

Unfortunately, I\'m not the kind of person that can cope with something like that, I don\'t want just anyone grading my code, when I know I\'m 10x better at scripting than the person grading me in the first place. I feel like a professor getting graded a D by a freshman student.

You may call that childish if you wish, but that\'s simply how I perceive things. I\'m not going to beg people to give me a big score, so the only thing to prevent getting a low score is simply no longer submitting code.

I\'m aware my reaction was a overly dramatic, but to be honest I was seriously pissed off, because that\'s the kind of person I am when things happen that I don\'t agree with. I\'m aware that when you\'re pissed of, your not nearly as rational as you are in normal situations. So yes, I did overreact.

I\'m keeping the rest of my snippets for sites where only qualified people may grade submissions, and where people appreciate good code.

I have nothing further to say.

 Respond  
XpLoiTeR   -  Jan 14, 2006

he is right fiberoptics....and its 8.3 now thats so cool ur highest snipp is 8.7 ... they are all usefull n not a kiddy stuff so quit it ;) www.hawkee.com wants good scripters like u

 Respond  
tank59   -  Jan 14, 2006

To leave hawkee.com over a low score is childish. We all know your one of the best scripters around and that your coding is glorious. Don\'t freak over a couple of people who don\'t like this piece of code because they don\'t understand it.

 Respond  
Yoinx   -  Jan 14, 2006

I agree that this snippet does deserve (if the rating system was used properly) at least an 8 or 9. In respect to the way people use the rating system though, this snippet get less than a 10.

[rant]
I\'ve seen some code, that really does nothing. Yet, its being scored like its the Best thing since Sliced Bread.

Personally though, I ignore the scores. Because there are so many people who can\'t code very well (not that Im the best) who score the snippets with no real basis to be submitting a score on it.

The snippet scores DO have little (Neat) (Useful) tags that would make you think you\'re only grading what it does. However, You should be grading the snippets on 1. Functionality 2. Coding 3. Error Checking. Being that to me, those are the 3 most important factors in a snippet.

And this is coming from someone who gets fairly high scores, even though my coding is generally sloppy.
[/rant]

 Respond  
XpLoiTeR   -  Jan 14, 2006

and fiberoptics....that pause deserves more than 6....but not 10..u know..dont say it is insult to u ...ur actin like a fool..all here knows ur abilities :S dont be a redneck u good man and my highest score is in an addon 15/20 ... and am not that pissed..i know ur better from me but its ok ur not waitin for ppl review or rating do u??dont u trust urself

 Respond  
XpLoiTeR   -  Jan 14, 2006

verrrrrrrrrrrrrrrrrrrrrrrrrrrrrry usefull...u can use this snippet instead of timer , and the -u ... i think i can use it...will help me alot

 Respond  
FiberOPtics   -  Jan 14, 2006

Btw, giving this snippet a 6 is an insult to me.

The error checking alone for this snippet is more code than some of the stuff some people submit here, and it\'s 10x more innovative than something like a \"random nick colorer\" the snippet before this that got a 5. Preposterous.

Do you people think you can just come up with functionality like this as if it\'s nothing?

This is complete bullshit, goodbye hawkee.com.

 Respond  
FiberOPtics   -  Jan 14, 2006

The notes look normal to me. They look weird for you?

 Respond  
xDaeMoN   -  Jan 14, 2006

Hmm what happened to the notes, FO? Probably a tag was inserted?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.