mIRC Homepage
Posted By: sigbin on nick help - 20/05/08 03:21 PM
how can i use the on " *:NICK: " in just a specified channel?
Posted By: noMen Re: on nick help - 20/05/08 03:29 PM
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.
Posted By: RoCk Re: on nick help - 20/05/08 04:19 PM

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


Posted By: sigbin Re: on nick help - 21/05/08 04:38 AM
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...
Posted By: RusselB Re: on nick help - 21/05/08 06:39 AM
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) {

Posted By: sigbin Re: on nick help - 21/05/08 06:53 AM
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....
Posted By: RusselB Re: on nick help - 21/05/08 08:34 AM
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
    }
  }
}
Posted By: sigbin Re: on nick help - 22/05/08 01:16 PM
how about if i want to remove this
Code:
          elseif ($hget(badnick,$newnick) == 2) do another here


no more another do?
Posted By: RusselB Re: on nick help - 22/05/08 11:38 PM
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.
© mIRC Discussion Forums