mIRC Homepage
Posted By: SladeKraven Custom Channels. - 08/08/05 01:42 AM
Hello everyone, the last couple of days I've been working on "Custom Channels" a while back some of you may seen my "Custom Query" thread here. Where when ever you get a private message it has all the nicknames into a single query box etc..

Eventually I'll do the channels all in one window as an update but for now, what I want to do is when I join a channel to hide it and open up a Custom Window, that's all done now I've ran into a little pitfall and that is when someone changed their nickname from Andy to test for example the nicklist doesnt sort alphabetically instead Andy goes to the the bottom, hopefully you guys understand that.

Here's the code so you can see for yourself, if you'd like.

Code:
On *:Close:@: {
  if ($chan($remove($target,@))) part $v1
}

On *:Join:#: {
  if ($nick == $me) {
    window -h $chan
    window -k0el12 $+(@,$chan) 1 1 791 496
  }
  else {
    aline -l 2 $+(@,$chan) $nick
    renwin $+(@,$chan) $+(@,$chan) $+([,$nick($chan,0),]) $+([,$chan($chan).mode,]:) Custom Chans coded by Andy..
    echo 3 $+(@,$chan) $timestamp *** $nick $+($chr(40),$address,$chr(41)) joins.  
  }
}

On *:Part:#: {
  if ($nick == $me) window -c $+(@,$chan)
  else {
    dline -l $+(@,$chan) $fline($+(@,$chan),$nick,1,1)
    renwin $+(@,$chan) $+(@,$chan) $+([,$calc($nick($chan,0) -1),]) $+([,$chan($chan).mode,]:) Custom Chans coded by Andy..
    echo 3 $+(@,$chan) $timestamp *** $nick $+($chr(40),$address,$chr(41)) parts.
  }
}

On *:Quit: {
  var %x = $comchan($nick,0)
  while (%x) {
    dline -l $+(@,$comchan($nick,%x)) $fline($+(@,$comchan($nick,%x)),$nick,1,1)
    echo 2 $+(@,$comchan($nick,%x)) $timestamp *** $nick has quit IRC $+($chr(40),$1-,$chr(41))
    renwin $+(@,$comchan($nick,%x)) $+(@,$comchan($nick,%x)) $+([,$calc($nick($comchan($nick,%x),0) - 1),]) $+([,$chan($comchan($nick,%x)).mode,]:) Custom Chans coded by Andy..
    dec %x
  }
}

On *:Nick: {
  var %x = $comchan($newnick,0)
  while (%x) {
    dline -l $+(@,$comchan($newnick,%x)) $fline($+(@,$comchan($newnick,%x)),$nick,1,1)
    aline -l 2 $+(@,$comchan($newnick,%x)) $nick($comchan($newnick,%x),$newnick).pnick
    echo 3 $+(@,$comchan($newnick,%x)) $timestamp *** $nick is now known as $newnick
    dec %x
  }
}

Raw 324:*: { set %ChanMode $3 }
Raw 366:*: { 
  renwin $+(@,$2) $+(@,$2) $+([,$nick($2,0),]) $+([,%chanmode,]:) Custom Chans coded by Andy..
  var %x = 1
  while (%x <= $nick($2,0)) {
    aline -l 2 $+(@,$2) $nick($2,%x).pnick
    inc %x
  }
}

On ^*:Text:*:#: {
  echo $+(@,$chan) $timestamp $+(<,$nick,>) $1-
  haltdef
}

On *:Input:@: {
  if ($left($1,1) == /) return $1-
  if ($remove($target,@) ischan) {
    msg $ifmatch $1-
    echo $target $timestamp $+(<,$me,>) $1-
  }
  halt
}



I guess the problem would lie in On Join/Nick because thats where I'll be adding/removing nicks. I thought it could be done with is +S flag in /WINDOW but I was assured not because all the ops were also sorted (not at the top).

Any suggestions? Thanks in advance to all responses.

Edit: screenshot as you can see Andy should be below ^T^.

-Andy
Posted By: hellfire Re: Custom Channels. - 11/08/05 07:07 PM
i think error is on your part..
window -k0el12 $+(@,$chan) 1 1 791 496 should be
window -Sk0el12 $+(@,$chan) 1 1 791 496..
also try use rline instead of doing a dline and aline when theres a nick change.. i had the same problem as you before i believe but its fine now http://www.shadoweffects.info/d-irc1.PNG shows that..
Posted By: Mary_juana Re: Custom Channels. - 11/08/05 07:20 PM
Code:
 On *:Nick: {

  var %x = $comchan($newnick,0)

  while (%x) {

    [color:red]  r[/color]line -l $+(@,$comchan($newnick,%x)) $fline($+(@,$comchan($newnick,%x)),$nick,1,1)

    aline -l 2 $+(@,$comchan($newnick,%x)) $nick($comchan($newnick,%x),$newnick).pnick

    echo 3 $+(@,$comchan($newnick,%x)) $timestamp *** $nick is now known as $newnick

    dec %x

  }

} 
Posted By: SladeKraven Re: Custom Channels. - 13/08/05 02:33 PM
Oh eck. Silly mistakes on my part.

Thank you for the pointing out and such. smile

P.S. Yours looks pretty neat, is it multi-server?

That's my next goal.

-Andy
© mIRC Discussion Forums