mIRC Home    About    Download    Register    News    Help

Print Thread
on nick help #199727 20/05/08 03:21 PM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
how can i use the on " *:NICK: " in just a specified channel?

Re: on nick help [Re: sigbin] #199728 20/05/08 03:29 PM
Joined: Jan 2006
Posts: 111
N
noMen Offline
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
It is not possible to change a nick just for one channel, so on *:NICK: will be triggered on every channel for a specific network.

Re: on nick help [Re: sigbin] #199731 20/05/08 04:19 PM
Joined: Dec 2002
Posts: 2,023
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,023

You could check to see if they're on a specific channel...

Change #mychan to your channel name.
Code:

on *:NICK: {
  if ($newnick ison #mychan) {
    ; do stuff here
  }
}



Re: on nick help [Re: RoCk] #199751 21/05/08 04:38 AM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
thankz rock for the reply...

nomen i think you miss understood my question

Code:
on *:NICK: {
  if ($newnick ison #mychan) {
    if (!$hget(badnick)) hmake badnick 20
    var %i = 1
    while ($gettok($badnick,%i,32)) {
      if ($+(*,$gettok($badnick,%i,32),*) iswm $nick) {
        if ($nick !isop $nick) {
          hinc badnick $nick
          var %badnick = $gettok($badnick,%i,32)
          if ($hget(badnick,$nick) == 1) do something heere
          if ($hget(badnick,$nick) == 2) do another here
        }
      }
      inc %i
    }
  }
}


i cant make this work...

Last edited by sigbin; 21/05/08 04:46 AM.
Re: on nick help [Re: sigbin] #199755 21/05/08 06:39 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) In the ON NICK event, $nick contains the old nick and $newnick contains the new/current nick

2) You use $badnick but there's no way we can check for possible errors in that identifier without seeing the custom alias for it.
ie: alias badnick {

3) Invalid IF statement
Code:
if ($nick !isop $nick) {

It's impossible for a nick to be opped on a nick.. if you want to see if the nick is oppedk, use
Code:
if ($newnick !isop #channel) {


Re: on nick help [Re: RusselB] #199757 21/05/08 06:53 AM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
Code:
alias badnick {
  return nick1 nick2 nick3
}
on *:NICK: {
  if ($newnick ison #mychan) {
    if (!$hget(badnick)) hmake badnick 20
    var %i = 1
    while ($gettok($badnick,%i,32)) {
      if ($+(*,$gettok($badnick,%i,32),*) iswm $newnick) {
        if ($newnick !isop $chan) {
          hinc badnick $newnick
          var %badnick = $gettok($badnick,%i,32)
          if ($hget(badnick,$newnick) == 1) do something heere
          if ($hget(badnick,$newnick) == 2) do another here
        }
      }
      inc %i
    }
  }
}


how can i make this work in a channel? i just wnt it to detect new nick that was changed... then if it is bad nick my script will kick warn the user....

Last edited by sigbin; 21/05/08 06:54 AM.
Re: on nick help [Re: sigbin] #199759 21/05/08 08:34 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
alias badnick {
  return nick1 nick2 nick3
}
on *:NICK: {
  if $nick(#mychannel,$newnick,a,o) {
    var %i = 1
    while $gettok($badnick,%i,32) {
      if $+(*,$gettok($badnick,%i,32),*) iswm $newnick {
          hinc -m badnick $newnick
          var %badnick = $gettok($badnick,%i,32)
          if ($hget(badnick,$newnick) == 1) do something here
          elseif ($hget(badnick,$newnick) == 2) do another here
      }
      inc %i
    }
  }
}

Re: on nick help [Re: RusselB] #199836 22/05/08 01:16 PM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
how about if i want to remove this
Code:
          elseif ($hget(badnick,$newnick) == 2) do another here


no more another do?

Re: on nick help [Re: sigbin] #199857 22/05/08 11:38 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
that's fine...you can remove that, or add others using the same format.. I simply used that to show that you're not stuck with only the one if possibility.