mIRC Homepage
Posted By: RusselB Nick script not working - 23/02/09 03:56 AM
Code:
alias dj {
  .nick $iif(DJ^ isin $me,$mnick,$+(DJ^,$mnick))
}
on me:*:nick:{
  if network isin $network {
    if DJ^ isin $me {
        .join #chan1,#chan2,#chan3,#chan4
    }
    else {
      .part #chan2,#chan3,#chan4
    }
  }
}

The alias works perfectly, however, the ON NICK event doesn't even seem to be being triggered.
Posted By: Tomao Re: Nick script not working - 23/02/09 04:13 AM
Shouldn't it be:
Code:
if DJ^ isin $newnick {

Or
Code:
If DJ^ == $newnick {
Posted By: RusselB Re: Nick script not working - 23/02/09 04:31 AM
No, since my DJ nick is DJ^RusselB so it has to be the isin comparison
Posted By: Horstl Re: Nick script not working - 23/02/09 05:04 AM
In the me:nick event, $me equals $nick (not $newnick) - Maybe that's the pitfall for you.
I don't know if you want to join or part these chans on DJ-nick; assuming you want to join:
Code:
on me:*:nick:{
  (...)
  if $left($newnick,3) === DJ^ { .join #chan1,#chan2,#chan3,#chan4 }
  else { .part #chan2,#chan3,#chan4 }
  (...)
}
Posted By: RusselB Re: Nick script not working - 23/02/09 05:23 AM
Weird that $me matches $nick in the ON NICK event, rather than $newnick since, it's your nick that's being changed.

Thanks for the suggestion, and I'll give it a test later.. right now, my bed is calling.
Posted By: Tomao Re: Nick script not working - 23/02/09 05:37 AM
I find it baffling because I tested it with
Code:
if ^ isin $me && $v1 isin $left($me,3)
and
Code:
if ^ isin $newnick && $v1 isin $left($newnick,3)
They both work seamlessly.

Posted By: Horstl Re: Nick script not working - 23/02/09 05:52 AM
It's possible for both statements to be true laugh
nevertheless
Code:
on me:*:nick: echo -a $me == $nick is now $newnick

Posted By: westor Re: Nick script not working - 23/02/09 05:58 AM
i make this code try it , also have more ways to script better this script but i make this and tested and work perfect!

Code:
alias dj {
  if ($network !== MYNETWORK) .halt
  .var %m = $me
  .var %chans = #chans1,#chans2
  if (*DJ^* iswm %m) { 
    .nick $remove(%m,DJ^)
    if (*DJ^* !iswm $newnick) { .part %chans }
    .halt
  }
  else { 
    .nick DJ^ $+ $me
    if ($newnick !ison %chans) { .join %chans }
  }
}
© mIRC Discussion Forums