mIRC Home    About    Download    Register    News    Help

Topic Options
#209775 - 23/02/09 03:56 AM Nick script not working
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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.

Top
#209776 - 23/02/09 04:13 AM Re: Nick script not working [Re: RusselB]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
Shouldn't it be:
Code:
if DJ^ isin $newnick {

Or
Code:
If DJ^ == $newnick {

Top
#209778 - 23/02/09 04:31 AM Re: Nick script not working [Re: Tomao]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
No, since my DJ nick is DJ^RusselB so it has to be the isin comparison

Top
#209779 - 23/02/09 05:04 AM Re: Nick script not working [Re: RusselB]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
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 }
  (...)
}


Edited by Horstl (23/02/09 05:16 AM)

Top
#209780 - 23/02/09 05:23 AM Re: Nick script not working [Re: Horstl]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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.

Top
#209781 - 23/02/09 05:37 AM Re: Nick script not working [Re: Horstl]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.


Top
#209782 - 23/02/09 05:52 AM Re: Nick script not working [Re: Tomao]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
It's possible for both statements to be true laugh
nevertheless
Code:
on me:*:nick: echo -a $me == $nick is now $newnick


Top
#209783 - 23/02/09 05:58 AM Re: Nick script not working [Re: Horstl]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
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 }
  }
}


Edited by westor (23/02/09 06:00 AM)
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top