It would work, but only for
/signal -n commands, these are essentially like calling an alias so the callig script halts untill there done, of course being ON SIGNAL event(s) there can be more than one, thus allowing moduals to be loaded.
Your also a slight bit confused on how a /signal with out the -n switch works, if that is done then the signal event is queued up for processing like every other event, it wont run untill the currently executing script be it an alias or event completes.
IMO since signals are user developed code, i would really expect it should be up to the coder to build in this returnback info. I doubt it would take much code honestly, I might give it a go.
edit Ok here it isalias signal {
if (-* !iswm $1) { var %tablename = $+(sreturn.,$1) } | else { var %tablename = $+(sreturn.,$2) }
hfree -sw %tablename
signal $1-
if ((-*r* iswmcs $1) && (!$hget(%tablename,0).item)) { hadd -sm %tablename 1 $3- }
}
alias sreturn {
if (!$isid) {
if (!$signal) { echo -a NO $!SIGNAL | return }
var %tablename = $+(sreturn.,$signal)
hadd -sm %tablename $calc($hget(%tablename,0).item + 1) $1-
}
else {
var %tablename = $gettok($+(sreturn.,$1),1,32)
if ($2 isnum 0) { return $hget(%tablename,0).item }
return $hget(%tablename,$2)
}
}
Notes:
I custom override the the signal command, this to some people is bad, (im one of them lol) but changing it to _signal would work just as well.
Also becuase i cant override the $signal identifier i instead used $sreturn(<signal>,<N>) as the identifier for drawing out the return values
so its
on ^*:TEXT:*:?:{
;The -r switch is used, so if there is no signal, $nick and $1- will be added to the list as [color:blue]line 1[/color]
signal -nr ontext $nick $1-
;$sreturn is used to get the lines returned by the ontext signal.
echo -a $sreturn(ontext,1) $sreturn(ontext,2)
halt
}
on *:SIGNAL:ontext:{
;Add $+(<,$1,>) to the list as the first line, because its the first /sreturn used.
sreturn $+(<,$1,>)
;Add $2- to the list as the second line.
sreturn $2-
}
correction : line1 only not line1 and 2 becuase there is no logical reason that it would know to place the first parameter to the signal on line 1 and the 2nd and onwards on line2