mIRC Home    About    Download    Register    News    Help

Print Thread
#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?

sigbin #199728 20/05/08 03:29 PM
Joined: Jan 2006
Posts: 111
N
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.

sigbin #199731 20/05/08 04:19 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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



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.
sigbin #199755 21/05/08 06:39 AM
Joined: Aug 2004
Posts: 7,252
R
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) {


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.
sigbin #199759 21/05/08 08:34 AM
Joined: Aug 2004
Posts: 7,252
R
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
    }
  }
}

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?

sigbin #199857 22/05/08 11:38 PM
Joined: Aug 2004
Posts: 7,252
R
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.


Link Copied to Clipboard