; MECHO (mass /echo) - sends echo to multiple windows of specified type(s).
;
; Usage: /mecho <-asnqdtu#?=@> <echo's normal parameters, excluding target>
;
; Where: -a = all, -s = status, -n or -# = channels, -q or -? = queries,
; -d or -? = single message window, -t or -= = chats, -u or -@ = custom windows.
;
; Also: The magic characters '\#' and '\@' can be used to reference a window's name and $wid.
; You can force identifiers to be re-evaluated for a given window using $!identifier.
;
; Examples:
; /mecho -a 4 Hello World!
; //mecho -a -ntic info *** Day changed to $asctime(dd mmm yyyy) $+ , a $asctime(dddd) $+ .
; //mecho -# -ntic whois *** Summary: \# has $!nick(\#,0,o) ops, $!nick(\#,0,v) voices, $!nick(\#,0,r) regulars.
;
; Note: /mecho is extremely handy with /scon -a and /timers, but be aware of their stacking re-re-re-evaluation.
; //.timer_hourly 0 3600 /scon -a /mecho -s#?= -ngti Hourly Report: \# has $!!!line(\@,0) lines.
;
mecho { ; by Raccoon 2015
var %types = $$replacex($replace($regsubex($$iif(-* iswm $1,$v2),/[^asnqdtu#?=@]/g,) $&
,a,snqdtu,$chr(35),n,?,qd,=,t,@,u),s,status.,n,channel.,q,query.,d,message.,t,chat.,u,custom.)
var %i = 1
while ($window(*,%i).wid) {
var %wid = @ $+ $v1, %name = $window(%wid), %type = $window(%wid).type
var %echo = $regsubex($replacex($$2-,\@,%wid,\#,%name),/^((?:\d+ )?(?:-\S*c\S* \S+ |-\S+ )?)(.*)/,\1%wid \2)
if ($istok(%types,%type,46)) { echo [ [ %echo ] ] }
inc %i
} } ; http://hawkee.com/snippet/16185/
Last updated: 06-January-2015
Thank you, it might require a little tweaking.