Real Name Revealer

By Jethro on May 15, 2011

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) } } ```

Comments

Sign in to comment.
Jethro   -  Sep 01, 2011

Ok Skywalker. Keep me posted.

Thanks for your fascinating input to imbue me with the correct idea in scripting, jaytea. :$ Your comment is obligingly noted.

 Respond  
Skywalker   -  Sep 01, 2011

on first sight it did the job i will look for a while if the problem returns
i'll let you know later :)

 Respond  
jaytea   -  Sep 01, 2011

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.

 Respond  
Jethro   -  Sep 01, 2011

I can't seem to reproduce the bug. Try changing this bit:> var %realnick $ial(*,0)to this:

var %realnick $iif($regex($ial(*,0),/^(.+?)$/),$regml(1))

let's see if that helps. :/

That bit of code is located under the real alias.

 Respond  
Skywalker   -  Sep 01, 2011

i have replaced the real alias,
still the same

 Respond  
Skywalker   -  Sep 01, 2011

only alias -l real has changed?

 Respond  
Jethro   -  Sep 01, 2011

I've updated the script. Try and see what happens, Skywalker.

 Respond  
Skywalker   -  Sep 01, 2011

but only then it prompts like i copied here with the -girl after the realname

 Respond  
Skywalker   -  Sep 01, 2011

indeed thats what i mean

 Respond  
Jethro   -  Sep 01, 2011

You mean someone named "sweet-girl" who enters text in a channel prompts another person's name "sweet" to show up too? I'll have a look at why this occurs.

 Respond  
Skywalker   -  Sep 01, 2011

found a bug

(Angel) Hi (Robin)-girl Hi The nick sweet is not on the channel but its seems the script haves his realname from the nick sweet and it scrambles the two users it was just sweet-girl who said something this happens with every line she types
 Respond  
Jethro   -  Aug 16, 2011

Skywalker, add this instead:

raw 318:*: halt
 Respond  
Skywalker   -  Aug 16, 2011

@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

 Respond  
Jethro   -  Aug 16, 2011

Well it wasn't my fault that I misunderstood you. I thought you wanted the output to echo to another location. At any rate, just add venommm666's example.

 Respond  
blackvenomm666   -  Aug 16, 2011

@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

 Respond  
Skywalker   -  Aug 16, 2011

i think you understand me wrong i meant how to hide the: nick End of /WHO list:. and/or: channel End of /WHO list.
from the status screen or show it in another window like @whodata

 Respond  
Jethro   -  Aug 16, 2011

Skywalker, see the edit at this link: http://pastebin.com/VtKJJcX9

 Respond  
Skywalker   -  Aug 16, 2011

can you give me some code for that?

 Respond  
Jethro   -  Aug 16, 2011

You can have the info echoed to a custom window if you want.

 Respond  
Skywalker   -  Aug 16, 2011

on *:join:#:who $iif($nick = $me,#,$v1)
gives the who data in the status screen, i know this code is needed to make the script work, but can it been shown somewhere else or hided also?

 Respond  
Jethro   -  Aug 15, 2011

I don't know what you're talking about.

 Respond  
Skywalker   -  Aug 15, 2011

how can i make the who date no longer be shown in the status screen? with this script?

 Respond  
The_One_And_Only   -  May 23, 2011

nevermind i had a fault in my script

 Respond  
The_One_And_Only   -  May 23, 2011

another bug :)
when you open a query with another user (private chat)
instead of sending what you type to that user it try's to send it to the first word you typ.
result you get the message nick/channel firstword does not excist.

 Respond  
Jethro   -  May 22, 2011

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.

 Respond  
The_One_And_Only   -  May 22, 2011

one more thing is it possible to include the quit reason like in the original quit message in the quit message of this snippet?
like "Quit" "connection reset by peer" "forced nick collision" "killed by" etc?

 Respond  
The_One_And_Only   -  May 21, 2011

ok works fine now :)

 Respond  
Jethro   -  May 21, 2011

The_One_And_Only, I believe I've fixed the notice bug. Try the latest update and let me know if it goes well for you.

 Respond  
The_One_And_Only   -  May 20, 2011

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

 Respond  
Jethro   -  May 20, 2011

:| what sort of notices?

 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.