mIRC Home    About    Download    Register    News    Help

Print Thread
#70323 04/02/04 09:34 PM
S
sunken
sunken
S
When I type nick + [tab] it complete the nick, i want it to add a : + [space] afterwards like this:

sunken + [tab] = sunken:

in Script editor, Tab called "Remote" type the following and restart irc

on *:INPUT:#:if $$1 ison $chan && ($$2) { msg # $1 $+ : $2- | haltdef }
smirk

#70324 05/02/04 06:36 AM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
Actually, all you have to do is close the remotes. This code does not in any warrant the restarting of the program.

I can't test it here, so this could be wrong, but the on INPUT event usually requires you to use halt, and not haltdef.

On a side note - thise code also doesn't do what TAB does. TAB actually completes the nick, this code requires you to type out the complete nick.

Code:
on *:INPUT:#: {
  [color:green]; if you typed out a complete nick[/color]
  if ($1 ison $chan) && ($2) msg $chan $+ : $2-
  [color:green]; if only one nick matches the letters you typed[/color]
  elseif ($ialchan($+($1,*!*@*),$chan,0) == 1) msg $chan $ialchan($+($1,*!*@*),$chan,1) $+ : $2-
  [color:green]; if no nicks match the letters you typed[/color]
  elseif ($ialchan($+($1,*!*@*),$chan,0) == 0) echo -a ERROR: no matches found
  [color:green]; if more than 1 nicks match the letters you typed[/color]
  else echo -a ERROR: more than one match found
  halt
}


This code actually completes the nick.

Not to be a meany, but I do wonder about your use of () in the if statement. Why do you not use them on the first condition, but you do use them on the second?

#70325 05/02/04 10:28 AM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
edit: scratch the sidenote - using tab + code will work.

#70326 11/02/04 09:11 PM
Joined: Feb 2003
Posts: 806
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 806
Pay more attention at your codes, please test them before posting:
Code:
on *:INPUT:#: {
  if ($1 ison $chan) && [color:red]($2)[/color] msg [color:red]$chan $+ :[/color] $2-
  elseif ($ialchan($+($1,*!*@*),$chan,0) == 1) msg $chan [color:red]$ialchan($+($1,*!*@*),$chan,1)[/color] $+ : $2-
  elseif ($ialchan($+($1,*!*@*),$chan,0) == 0) echo -a ERROR: no matches found
  else echo -a ERROR: more than one match found
  halt
}
The correct version is:
Code:
on *:INPUT:#: {
  if ($1 ison $chan) && [color:green]($2 != $null)[/color] msg [color:green]$chan $1:[/color] $2-
  elseif ($ialchan($+($1,*!*@*),$chan,0) == 1) msg $chan [color:green]$ialchan($+($1,*!*@*),$chan,1).nick[/color] $+ : $2-
  elseif ($ialchan($+($1,*!*@*),$chan,0) == 0) echo -a ERROR: no matches found
  else echo -a ERROR: more than one match found
  halt
}

Edit - Below is a better version, since the previous ones still halt the process even when you don't want to complete anything:
Code:
on *:INPUT:#: {
  if ($2 == $null) { return }
  if ($1 ison #) { msg # $1: $2- | halt }
  elseif ($ialchan($1*!*@*,#,0)) {
    if ($ifmatch > 1) { echo -ag ERROR: more than one match found }
    else { msg # $ialchan($1*!*@*,#,1).nick $+ : $2- | halt }
  }
}


Nonetheless, I think all these methods are poor as nick completion features.

Last edited by cold; 11/02/04 09:21 PM.

Link Copied to Clipboard