Last Nick & Channel Name Tab Completion
Platform: mIRC
Published Aug 15, 2011
Updated Aug 15, 2011
Snippet to append the last users nickname to your edit box by hitting tab at the beginning or after a space. Also, if the last word is the last users nickname, it will be changed to the channel name.
Examples:
"" >> [TAB] >> "LastUsersNick"
"Hi " >> [TAB] >> "Hi LastUsersNick"
"Hi LastUsersNick" >> [TAB] >> "Hi #CurrentChannel"
Very nice when answering questions in a busy channel.
on *:TABCOMP:#:{
var %lastnick = $hget(lastnick,$cid $+ $chan)
if (($regex(edit,$editbox($active),/(^|^.* )( $+ $chan $+ $chr(124) $+ %lastnick $+ )?$/)) && ($1- == $regsubex($editbox($active),/(^ +| +$)/g,))) {
if ($regml(edit,2) == %lastnick) editbox -a $regml(edit,1) $+ $chan
else editbox -a $regml(edit,1) $+ $iif(%lastnick, $v1, $chan)
halt
}
}
on *:TEXT:*:#:{ hadd -m lastnick $cid $+ $chan $nick }
on *:ACTION:*:#:{ hadd -m lastnick $cid $+ $chan $nick }
on *:NOTICE:*:#:{ hadd -m lastnick $cid $+ $chan $nick }