Jump to content

Nicklist Help


Dippy

Recommended Posts

Don't quote me on this, but I'm fairly certain you can't use popups.ini with dialog lists (unles you use nicklist.dll). I use mpopups.dll, though it seems that everyone else here mostly uses popups.dll.

 

You'd have to use it on the click events on your list <id>. Tokenize the list ID then use something like:

if ($devent == rclick) <name of popup alias here>

 

A small snippet of my code as an example (Not the cleanest method I'm sure)

 

On *:Dialog:side.bar:*click:4:{
  if (!$did(4).sel) halt
  did -e $dname 3
  tokenize 32 $did($did,4)
  if ($1 == rclick) { 
    set %selnick $gettok($did(side.bar,4).seltext,-1,32) 
    if (*(Owner)* iswm %selnick) { set %selnick $gettok($did(side.bar,4).seltext,-2,32) }
    if (*(Host)* iswm %selnick) { set %selnick $gettok($did(side.bar,4).seltext,-2,32) }
    if (*(Admin)* iswm %selnick) { set %selnick $gettok($did(side.bar,4).seltext,-2,32) }
    menunick
  }
  if ($1 == dclick) { 
    user.query
  }
  else....

 

Also, for the actual init code of your nicklist, I'm not a fan of putting the docking code in the init itself. Your alias to dock the list could also result in the *dialog nicklist is already in use*

 

I use an alias to dock my list and, as err0r suggested, call it when I join a channel e.g:

alias -l dock.nicklist {
  $iif(!$dialog(side.bar),dialog -m side.bar side.bar,dialog -v side.bar side.bar)
  dll $rebar Dock $dialog(side.bar).HWND > right
}

and to actually dock it...

On *:JOIN:*:{
  refresh.screen
  if ($nick == $me) {
    dock.nicklist
    away.refresh
  }
}

 

Hope this helps somewhat :)

 

PS - Warrior124 has that shared that ff alias with me before, and I highly recommend it. :)

Edited by Silo
Link to comment
Share on other sites

  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

So How About This

 

alias ndll { return $shortfn($mircdirdlls\nicklist.dll) }
alias mdx { return $shortfn($mircdirdlls\mdx.dll) }
alias views { return $shortfn($mircdirdlls\views.mdx) }
alias ico { return $+($mircdirIcon\,$1) }
on *:JOIN:#:{
  if ($nick == $me) {
    set %getsize $dll($ndll,GetSize,$!window(* $+ $right(#,-2) $+ *,1))
    if (!$dialog(nick. [ $+ [ # ] ])) { dialog -m nick. [ $+ [ # ] ] nick. [ $+ [ # ] ] }
    .timer.join -m 1 5 fugk
  }
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
on *:PART:#:{
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
alias fugk { refresh $active | partsb }
on *:RAWMODE:#:{ 
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
on *:KICK:#:{ 
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
dialog nick.* {
  title ""
  size 0 0 112 329
  option dbu
  list 1, 0 0 114 329, size vsbar
}

on *:dialog:nick*:*:*:{
  if ($devent == init) {
    %crap = $dll($ndll,Nicklist,$dname $!window(* $+ $right($dname,-7) $+ *,1))
    dll $mdx SetMircVersion $version
    dll $mdx MarkDialog $dname
    dll $mdx SetDialog $dname style sysmenu
    dll $mdx SetControlMDX $dname 1 ListView report single noheader> $views
    dll $mdx SetDialog $dname bgcolor $rgb(000,000,000)
    did -i $dname 1 1 setbkg color 1 $rgb(000,000,000)
    did -i $dname 1 1 settxt color $rgb(255,255,255)
    did -i $dname 1 1 settxt bgcolor $rgb(000,000,000)
    did -i $dname 1 1 headerdims 150
    did -i $dname 1 1 iconsize 8 16 23 23
    did -i $dname 1 1 seticon normal 0, $+ $ico(staff.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(owner.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(host.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(novoice.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(voice.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(ignore.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(helpop.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(cup.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(voiced.ico)
    did -i $dname 1 1 seticon normal 0, $+ iconmsn.ico
    refresh #
  }
  if (click isin $devent) { 
    tokenize 32 $did($dname,$did,1)
    if ($1 == rclick) { sline $active $fline($active,$replace($hget(decoder,$gettok($did($dname,1).seltext,6,32)),Guest_,>),1,1) | %null = $dll($ndll,Popup,$!window(* $+ $right($dname,-6) $+ *,1)) }
    if ($1 == sclick) { sline $right($dname,-5) $calc($did($dname,1).sel - 1) }
    if ($1 == dclick) { sline $right($dname,-5) $calc($did($dname,1).sel - 1) | query $nick($right($dname,-5),$calc($did($dname,1).sel - 1)) }
  }
}
alias nick.refresh { .timer -m 1 4 refresh $1 }
alias -l refresh { 
  if (!$dialog(nick. [ $+ [ $1 ] ])) return 
  did -r nick. [ $+ [ $1 ] ] 1
  var %l 1
  while (%l <= $nick($1,0)) { 
    did -a nick. [ $+ [ $1 ] ] 1 0 + $nickicon($nick($1,%l),$1) $buzz.decode($replace($nick($1,%l),>,Guest_))
    inc %l
  }
}
alias -l nickicon { 
  var %l 1 | while (%l <= 9) { if ($ignore($mask($address($1,5),%l))) { return 6 } | inc %l }
  if (' isin $1) return 1
  if ($1 isowner $2) return 2
  if ($1 isop $2) && ($1 !isowner $2) return 3
  if ($1 !isvoice $2) && (m isincs $chan($2).mode) return 4
  return 5
}
menu * { 
  mouse:if ($hget(history. $+ $active,0)) click 2 $ifmatch 
  sclick: { var %i = 1 | while ($hget(button. $+ $active,%i)) { tokenize 59 $ifmatch | if ($inrect($mouse.x,$mouse.y,$1,$2,$3,$4)) { hadd -m history. $+ $active 0 %i | click 1 %i | break } | inc %i } } 
  uclick:if ($hget(history. $+ $active,0)) click 3 $ifmatch 
}

 

The only thing is Getting right click to read from popup.ini

Link to comment
Share on other sites

Oh I give up on it lol

 

Seems too much trouble one min it works next it don't then some else works and that other that worked before stop working lol

No in my Life have I come across something that such a pain in the ass lol

Link to comment
Share on other sites

Don't give up, lol. I've tried this out, and made some modifications. I had to take the $hget part out of the sline code as well as the $buzz.decode bit, because you didn't give an alias for it. I've also added the $ff alias code, and changed the way the dlls, and icons are called. Now it will show the nicknames, and the icons as well. It also opens up the mirc popup when you right click on the name in the nicklist. Here is the code...

 

alias ff {
  if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) {
    if (!$longfn($findfile($nofile($mircexe),$1-,1))) set %ff. [ $+ [ $1- ] ] $shortfn($nofile($mircexe) $+ $1-)
    else set %ff. [ $+ [ $1- ] ] $shortfn($findfile($nofile($mircexe),$1-,1))
  }
  return %ff. [ $+ [ $1- ] ]
}
alias ndll { return $ff(nicklist.dll) }
alias mdx { return $ff(mdx.dll) }
alias views { return $ff(views.mdx) }
alias ico { return $ff($1) }
on *:JOIN:#:{
  if ($nick == $me) {
    set %getsize $dll($ndll,GetSize,$!window(* $+ $right(#,-2) $+ *,1))
    if (!$dialog(nick. [ $+ [ # ] ])) { dialog -m nick. [ $+ [ # ] ] nick. [ $+ [ # ] ] }
    .timer.join -m 1 5 fugk
  }
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
on *:PART:#:{
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
alias fugk { refresh $active | partsb }
on *:RAWMODE:#:{
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
on *:KICK:#:{
  if (!$timer(ref)) { .timer.ref 1 1 fugk }
}
dialog nick.* {
  title ""
  size 0 0 112 329
  option dbu
  list 1, 0 0 114 329, size vsbar
}

on *:dialog:nick*:*:*:{
  if ($devent == init) {
    %crap = $dll($ndll,Nicklist,$dname $!window(* $+ $right($dname,-7) $+ *,1))
    dll $mdx SetMircVersion $version
    dll $mdx MarkDialog $dname
    dll $mdx SetDialog $dname style sysmenu
    dll $mdx SetControlMDX $dname 1 ListView report single noheader> $views
    dll $mdx SetDialog $dname bgcolor $rgb(000,000,000)
    did -i $dname 1 1 setbkg color 1 $rgb(000,000,000)
    did -i $dname 1 1 settxt color $rgb(255,255,255)
    did -i $dname 1 1 settxt bgcolor $rgb(000,000,000)
    did -i $dname 1 1 headerdims 150
    did -i $dname 1 1 iconsize 8 16 23 23
    did -i $dname 1 1 seticon normal 0, $+ $ico(staff.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(owner.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(host.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(novoice.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(voice.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(ignore.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(helpop.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(cup.ico)
    did -i $dname 1 1 seticon normal 0, $+ $ico(voiced.ico)
    did -i $dname 1 1 seticon normal 0, $+ iconmsn.ico
    refresh #
  }
  if (click isin $devent) {
    tokenize 32 $did($dname,$did,1)
    if ($1 == rclick) { sline $active $fline($active,$gettok($did($dname,1).seltext,6,32),1,1) | %null = $dll($ndll,Popup,$!window(* $+ $right($dname,-6) $+ *,1)) }
    if ($1 == sclick) { sline $right($dname,-5) $calc($did($dname,1).sel - 1) }
    if ($1 == dclick) { sline $right($dname,-5) $calc($did($dname,1).sel - 1) | query $nick($right($dname,-5),$calc($did($dname,1).sel - 1)) }
  }
}
alias nick.refresh { .timer -m 1 4 refresh $1 }
alias -l refresh {
  if (!$dialog(nick. [ $+ [ $1 ] ])) return
  did -r nick. [ $+ [ $1 ] ] 1
  var %l 1
  while (%l <= $nick($1,0)) {
    did -a nick. [ $+ [ $1 ] ] 1 0 + $nickicon($nick($1,%l),$1) $replace($nick($1,%l),>,Guest_)
    inc %l
  }
}
alias nickicon {
  var %l 1 | while (%l <= 9) { if ($ignore($mask($address($1,5),%l))) { return 6 } | inc %l }
  if (' isin $1) return 1
  if ($1 isowner $2) return 2
  if ($1 isop $2) && ($1 !isowner $2) return 3
  if ($1 !isvoice $2) && (m isincs $chan($2).mode) return 4
  return 5
}
menu * {
  mouse:if ($hget(history. $+ $active,0)) click 2 $ifmatch
  sclick: { var %i = 1 | while ($hget(button. $+ $active,%i)) { tokenize 59 $ifmatch | if ($inrect($mouse.x,$mouse.y,$1,$2,$3,$4)) { hadd -m history. $+ $active 0 %i | click 1 %i | break } | inc %i } }
  uclick:if ($hget(history. $+ $active,0)) click 3 $ifmatch
}

Edited by Warrior124
Link to comment
Share on other sites

ok Fix that scoll bar by removing the one on Dailog

 

Thanks (Y) Just got to work on Icons get them right so Staff shows with butter fly and make the icon bigger lol

 

But Thanks :P:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...