mIRC Home    About    Download    Register    News    Help

Print Thread
Nick script not working #209775 23/02/09 03:56 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Nick script not working [Re: RusselB] #209776 23/02/09 04:13 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Shouldn't it be:
Code:
if DJ^ isin $newnick {

Or
Code:
If DJ^ == $newnick {

Re: Nick script not working [Re: Tomao] #209778 23/02/09 04:31 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
No, since my DJ nick is DJ^RusselB so it has to be the isin comparison

Re: Nick script not working [Re: RusselB] #209779 23/02/09 05:04 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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 }
  (...)
}

Last edited by Horstl; 23/02/09 05:16 AM.
Re: Nick script not working [Re: Horstl] #209780 23/02/09 05:23 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Nick script not working [Re: Horstl] #209781 23/02/09 05:37 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.


Re: Nick script not working [Re: Tomao] #209782 23/02/09 05:52 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
It's possible for both statements to be true laugh
nevertheless
Code:
on me:*:nick: echo -a $me == $nick is now $newnick


Re: Nick script not working [Re: Horstl] #209783 23/02/09 05:58 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 }
  }
}

Last edited by westor; 23/02/09 06:00 AM.