msg/notice control alias
Platform: mIRC
Published Jul 07, 2009
Updated May 15, 2011
This is a little snippet but it is extremely useful. This alias will allow you to send large amounts of text to a channel without worrying about flooding or the size of the line. If you send it a line that is 4000 characters the alias will break it down into 10 or so lines and send them to their destination with a 1 1/2 second delay. If the delay is not enough just change this line
1.5 works for me but it might not for everyone.
I repeatedly threw 12 thousand characters per 3 seconds, at this alias and I couldn't break it. All of the lines came out in perfect order.
******* One thing to note ********
This was designed for normal text! With spaces in between the words :)
$str(c,431) will break this code. The splitting of the text is based on the closest space to 430 characters without going over. I did it this way to prevent the splitting of words.
****Syntax****
/Put msg #channel text to send
/Put notice nickname text to send
You can also use .notice and .msg with this :)
Post any problems or suggestions here.
Rewrites or different versions of this are welcome.
It would be interesting to see how someone else would try to accomplish this.
I saw a script for this once on mircscripts, but it was several pages long.
alias Put {
if (!$regex($1,/(\.|^)(msg|notice)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text | return }
tokenize 32 $regsubex($1-,/([$\|%\[\]\}\{][^\s]*)/g,$+($chr(2),$chr(2),\t))
var %tokens $0, %Tstart 3, %Dtimer 1500
if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }
while ($len($($+($,%Tstart,-,%tokens),2)) > 430) {
dec %tokens
if ($len($($+($,%Tstart,-,%tokens),2)) <= 430) {
.timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
inc %Dtimer 1500
%Tstart = $calc(%tokens + 1)
%tokens = $0
}
}
.timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
.timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop
}