This is a forum request inquired by the member Memoli who wants the nicknames he enters to show his or her real name in a channel where he's situated. The real names will be shown by their nicknames and enclosed in parentheses. I thought I'd post this as a snippet to share with the general public.> Hello Superman09 (JasonD) how are you today?
Welcome back Superman09 (JasonD)**05/19/11** - Added support for text, action and notice to show users' real names.> (RealNameHere) Hello everyone * Sebastian (RealNameHere) gives every one a hug... -Sebastian (RealNameHere)- BLAH!- Added a join, part and quit support to show user real names. ```mirc #real on on *:input:*:real $1- on ^*:text:*:*:real $1- on ^*:action:*:*:real $1- on ^*:notice:*:*:real $1- on *:join:#:who $iif($nick = $me,#,$v1) on !^*:part:#:{ set $+(%,real,$nick) $nick echo $color(part) # * Parts: $nick $ial($nick).mark @ $+ $site haltdef } on !^*:quit:{ var %- 1 | while $comchan($nick,%-) { echo $color(quit) $v1 * Quits: $nick $ial($nick).mark @ $+ $site haltdef inc %- } } raw 352:*:.ialmark $6 ( $+ $9- $+ ) | halt raw 315:*:{ if $($+(%,real,$2),2) { var %c 1 | while $comchan($me,%c) { echo $color(join) -a * $2 $ial($2).mark has joined $v1 unset $+(%,real,$2) | halt | inc %c } } } on *:ping:var %ial 1 | while $comchan($me,%ial) { who $v1 | inc %ial } alias -l pnickschan { return $iif($event = text,$+(<,$iif($left($nick(#,$nick).pnick,1) isin $prefix,$v1),$nick),$& $iif($event = action,$+(*,$chr(32),$iif($left($nick(#,$nick).pnick,1) isin $prefix,$v1),$nick),$& $iif($event = notice,$+(-,$iif($left($nick(#,$nick).pnick,1) isin $prefix,$v1),$nick,-)))) } alias -l pnickspm { return $iif($event = text,$+(<,$nick),$iif($event = action,$+(*,$chr(32),$nick),$iif($event = notice,$+(-,$nick,-)))) } alias -l real { if (!$inpaste) && ((!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter)) { var %realnick $ial(*,0) | while %realnick { if $regex($iif($event = input,$1-,$nick),/(^|\s)\Q $+ $replacecs($ial(*,%realnick).nick,\E,\E\\E\Q) $+ \E(\s|$)/iS) { $iif($event = input,say,echo -bcfilmrt $iif($event = text,normal,$event) $iif(#,#,$iif($query($nick),$& $nick,$iif($active ischan,$v1,$target)))) $replace($iif($event = input,$strip($1-),$& $iif(#,$pnickschan($nick),$pnickspm($nick))),$ial(*,%realnick).nick,$& $iif($event = text,$ial(*,%realnick).nick $+ >,$ial(*,%realnick).nick) $ial(*,%realnick).mark) $& $iif($istok(text action notice,$event,32),$1-) | haltdef } dec %realnick } } } #real end menu nicklist,channel { Turn Real-Name-Revealer $iif($group(#real) = on,OFF,ON) { if ($group(#real) != on) .enable #real | else disable #real else ($group(# if $group(#real) = on { who # } | else { ialclear | who # } echo 4 -ag * Real Name Revealer has been turned $upper($group(#real).status) } } ```Try changing this bit:
[quote]
var %realnick $ial(*,0)
to this:
var %realnick $iif($regex($ial(*,0),/^(.+?)$/),$regml(1))
[/quote]
what???
(Angel) Hi (Robin)-girl Hi
a quick look at the script, and i can only see this happening if the regexes contained '\b' in place of '\s'.
jethro, you see why coding like this can be detrimental? it makes it 1000 times harder to debug and interpret your scripts. it also leads to code that is painfully inefficient. looping through all IAL entries when you know you only have one nick to handle ($nick)?? oof.
there is one, and only one, reason to combine code in the manner that you've attempted. if you have the same procedure in numerous places in your script, it's a good idea to extract it and abstract it if necessary in order to avoid having to change the same thing repeatedly when it's time to update the procedure. but it needs to be the SAME procedure, not one that is dependent upon the area of the script from which it's called. as soon as you have to construct more than a couple of '$iif($event ...'s or include a segment of code which will be executed unnecessarily more often than not, then you've taken a step in the wrong direction.
@blackvenomm666 well i do have already some coding in my raw modes to do this and with a whois this does work.
only this script does not do a /whois but a /who $nick or /who $chan and now i get al the "nick End of /WHO list" in the status screen with every who the script does making my status screen beeing flooded with end of /WHO list lines.
when i whois someone nothing gets shown in status screen only if i set the script to show in status screen
@skywalker you would have to use the raws for it. and just add haltdef raw
<- :JungleSpot.chat.server 401 DarknessFalls test :No such nick/channel
<- :JungleSpot.chat.server 318 DarknessFalls test :End of /WHOIS list. <<<end of whois line raw 318
raw 318 :*: {
window -Ckbz @whois $mircexe
aline -pd @whois $1-
haltdef
}
^^^^ that would change where the end of whois line shows up to an @window and halt it from showing up in the status
The_One_And_Only, try adding $1- to the echo print:> echo $color(quit) $v1 * Quits: $nick $ial($nick).mark @ $+ $site $1-and see if that works. If that doesn't work, change the whole event to this:
on !*:quit:{
var %- 1 | while $comchan($nick,%-) {
echo $color(quit) $v1 * Quits: $nick $ial($nick).mark @ $+ $site $1-
inc %-
}
}
This should release the default output and fill the $1- for the reason.
the basic notice from mIRC,
these:
Query: [20:20:43] test <- Memoli's mIRC
Status: [20:20:43] ultrAslan test <- ultrAslan's mIRC
if someone sends a notice who has a private conversation with you (query open) it gets shown in that query even if its not u're active window
(edit: if you close the query and the user who sends the notice still has a query open of you it also still get shown in query)
if no query is open it gets shown in status window again