this actually completes a nickname without having to push tab to resolve the nickname. All you need do is specify the first three letters of a nickname together with a : which is the trigger, space and then your text. EG: ast: hello (pressing return would then display "Astro: hello"). I have made this a basic on INPUT event including normal messaging of the channel when there is no nick to complete.
on *:INPUT:#:{
if ($left($1,1) != /) && ($1 != $null) {
var %nick 0
if ($right($strip($1),1) == :) {
while (%nick < $nick($chan,0,a)) {
inc %nick 1
if ($left($nick($chan,%nick,a),$calc($len($strip($1)) - 1)) == $remove($strip($1),:)) {
msg $chan $+($nick($chan,%nick,a),:) $2- | goto endnick
}
}
}
msg $chan $1-
:endnick | halt
}