mIRC Home    About    Download    Register    News    Help

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

Joined: Jul 2007
Posts: 1,129
T
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 {

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

Joined: Nov 2006
Posts: 1,559
H
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.
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.

Joined: Jul 2007
Posts: 1,129
T
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.


Joined: Nov 2006
Posts: 1,559
H
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


Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard