Skip to content
Buzzen Chat Network

Nicklist Help

A TG007 community discussion started by Dippy.

Discussion 31 posts
Page 1 of 2
Open
Topic #11038 · 31 published posts · 6,730 views

Tried to do my own nicklist This what I have so far

 

on *:Start:/dialog -m nicklist nicklist

dialog Nicklist {
  title "nicklist"
  size -1 -1 112 256
  option dbu
  list 1, 1 0 106 255, size vsbar
}


on *:Dialog:nicklist:init:*: {
  dll dll\rebar.dll Dock $dialog(nicklist).hwnd > right
  dll dll\mdx.dll Set MircVersion $version
  dll dll\mdx.dll MarkDialog $dname
  dll dll\mdx.dll SetFront $dname
  dll dll\mdx.dll SetFront $dname 1 14 50 verdana
  dll dll\mdx.dll SetColor $dname
  dll dll\mdx.dll SetColor $dname 1 text $rgb (0,0,139)
  dll dll\mdx.dll SetControlMDX $dname 1 ListView noheader smallicon hottrack single > dll\views.mdx
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal 0, $+ icon\owner.ico
  did -i $dname 1 1 seticon normal 0, $+ icon\host.ico
  did -i $dname 1 1 seticon normal 0, $+ icon\spec.ico
  did -i $dname 1 1 seticon normal 0, $+ icon\voice.ico
  did -i $dname 1 1 settxt color $rgb(0,0,139)

  nickinlist

  alias nickinlist{
  did -r nicklist 1

  var %n 1
  while (%n <= $nick($active,0)) {

    did -a nicklist 1 0 + $nicklisticon($nick($active,%n)) $nick($active,%n)

    inc %n
  }
}

alias nicklisticon {
  if(%1 isowner $active) return 1
  elseif ($1 isop $active) return 2
  elseif (*+*m* iswm $chan($active).mode) && ($1 !isvoice $active) return 4
  elseif (*+*m* !iswm $chan($active).mode) && ($1 isvoice $active) return 3
  elseif (*+*m* iswm $chan($active).mode) && ($1 isvoice $active) return 3
  elseif (*+*m* !iswm $chan($active).mode) && ($1 !isvoice $active) return 3
}

 

But I'm unable to get the list going any idea ?

What do you mean unable to get it going? Give us the errors and what happens, what doesn't happen, etc etc.

might have to set your directory on your dlls

Knowledge is a terrible thing to waste.

plus where %1 isowner looks like it should be $1 isowner

Edited Sep 4, 2008 11:02 PM by Vindicator

Knowledge is a terrible thing to waste.

Well Dippy you have a few things wrong with the coding..

 

First you have Set MIRCVERSION which i don't think is valid

Next SetFront should be Set Font

Next you didn't close the bracked on init

 

This should work for you.

 

on *:Start:/dialog -m nicklist nicklist
  
  dialog Nicklist {
    title "nicklist"
    size -1 -1 112 256
    option dbu
    list 1, 1 0 106 255, size vsbar
  }
  
  
  on *:Dialog:nicklist:init:*: {
    dll dll\rebar.dll Dock $dialog(nicklist).hwnd > right
    dll dll\mdx.dll SetMircVersion $version
    dll dll\mdx.dll MarkDialog $dname
    dll dll\mdx.dll SetFont $dname 1 14 50 verdana
    dll dll\mdx.dll SetColor $dname 1 text $rgb (0,0,139)
    dll dll\mdx.dll SetControlMDX $dname 1 ListView noheader smallicon hottrack single > dll\views.mdx
    did -i $dname 1 1 iconsize normal small
    did -i $dname 1 1 seticon normal 0,  icon\owner.ico
    did -i $dname 1 1 seticon normal 0,  icon\host.ico
    did -i $dname 1 1 seticon normal 0,  icon\spec.ico
    did -i $dname 1 1 seticon normal 0,  icon\voice.ico
    did -i $dname 1 1 settxt color $rgb(0,0,139)
    nickinlist
  }
  alias nickinlist {
    did -r nicklist 1
  
    var %n 1
    while (%n <= $nick($active,0)) {
      did -a nicklist 1 0 + $nicklisticon($nick($active,%n)) $nick($active,%n)
      inc %n
    }
  }
  
  alias nicklisticon {
    if ($1 isowner $active) return 1
    elseif ($1 isop $active) return 2
    elseif (*+*m* iswm $chan($active).mode) && ($1 !isvoice $active) return 4
    elseif (*+*m* !iswm $chan($active).mode) && ($1 isvoice $active) return 3
    elseif (*+*m* iswm $chan($active).mode) && ($1 isvoice $active) return 3
    elseif (*+*m* !iswm $chan($active).mode) && ($1 !isvoice $active) return 3
  }

 

It's prolly not a good idea to have the alias to get the nicks in the init if you have it docked on start.

Prolly better to do it on join

Edited Sep 4, 2008 11:11 PM by err0r

Get information about ircWx here

ok Thanks :P:) for that Error :P:)

 

But still unable to grab list

 

It Popups and docks but Blank

Edited Sep 4, 2008 11:12 PM by Dippy

i had to make a bit of an edit

 

your if had the ( right up against it like if( you can't do that with if.. only with $iif.. it needed to be if (

 

join a room and then type in your alias it should populate the nicklist

Edited Sep 4, 2008 11:14 PM by err0r

Get information about ircWx here

Something with a onjoin would probably work better

 

on *:Start:/dialog -m nicklist nicklist
  
  dialog Nicklist {
    title "nicklist"
    size -1 -1 112 256
    option dbu
    list 1, 1 0 106 255, size vsbar
  }
  
  
  on *:Dialog:nicklist:init:*: {
    dll dll\rebar.dll Dock $dialog(nicklist).hwnd > right
    dll dll\mdx.dll SetMircVersion $version
    dll dll\mdx.dll MarkDialog $dname
    dll dll\mdx.dll SetFont $dname 1 14 50 verdana
    dll dll\mdx.dll SetColor $dname 1 text $rgb (0,0,139)
    dll dll\mdx.dll SetControlMDX $dname 1 ListView noheader smallicon hottrack single > dll\views.mdx
    did -i $dname 1 1 iconsize normal small
    did -i $dname 1 1 seticon normal 0,  icon\owner.ico
    did -i $dname 1 1 seticon normal 0,  icon\host.ico
    did -i $dname 1 1 seticon normal 0,  icon\spec.ico
    did -i $dname 1 1 seticon normal 0,  icon\voice.ico
    did -i $dname 1 1 settxt color $rgb(0,0,139)
  }
  
  alias nickinlist {
    did -r nicklist 1
    var %n 1
    while (%n <= $nick($active,0)) {
      did -a nicklist 1 0 + $nicklisticon($nick($active,%n)) $nick($active,%n)
      inc %n
    }
  }
  
  alias nicklisticon {
    if ($1 isowner $active) return 1
    elseif ($1 isop $active) return 2
    elseif (*+*m* iswm $chan($active).mode) && ($1 !isvoice $active) return 4
    elseif (*+*m* !iswm $chan($active).mode) && ($1 isvoice $active) return 3
    elseif (*+*m* iswm $chan($active).mode) && ($1 isvoice $active) return 3
    elseif (*+*m* !iswm $chan($active).mode) && ($1 !isvoice $active) return 3
  }
  on *:join:*: {
    if ($nick == $me) { .timernl -m 1 9 nickinlist }
  }

 

This works as I have tested it. If it doesn't work for you then check your dll folder for rebar.dll, mdx.dll and views.mdx

If they are both there and it still doesn't work then most likely your problem is with your path to the dlls and views

Edited Sep 4, 2008 11:20 PM by err0r

Get information about ircWx here

This should now work for you. I added a code that will find your icons no matter where (within your mirc directory) you place your icons. Also works the same way for your dll files.

 

on *:Start:/dialog -m nicklist nicklist

dialog Nicklist {
  title "nicklist"
  size -1 -1 112 256
  option dbu
  list 1, 1 0 106 255, size vsbar
}


on *:Dialog:nicklist:init:*: {
  dll $ff(rebar.dll) Dock $dialog(nicklist).hwnd > right
  dll $ff(mdx.dll) SetMircVersion $version
  dll $ff(mdx.dll) MarkDialog $dname
  dll $ff(mdx.dll) SetFont $dname
  dll $ff(mdx.dll) SetFont $dname 1 14 50 verdana
  dll $ff(mdx.dll) SetColor $dname
  dll $ff(mdx.dll) SetColor $dname 1 text $rgb (0,0,139)
  dll $ff(mdx.dll) SetControlMDX $dname 1 ListView noheader smallicon hottrack single > $ff(views.mdx)
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal 0, $+ $ff(owner.ico)
  did -i $dname 1 1 seticon normal 0, $+ $ff(host.ico)
  did -i $dname 1 1 seticon normal 0, $+ $ff(spec.ico)
  did -i $dname 1 1 seticon normal 0, $+ $ff(voice.ico)
  did -i $dname 1 1 settxt color $rgb(0,0,139)

  nickinlist
}

alias nickinlist{
  did -r nicklist 1

  var %n 1
  while (%n <= $nick($active,0)) {

    did -a nicklist 1 0 + $nicklisticon($nick($active,%n)) $nick($active,%n)

    inc %n
  }
}

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))
  }
  if (!$exists(%ff. [ $+ [ $1- ] ])) echo $color(info) -a $nopath(%ff. [ $+ [ $1- ] ]) cannot be found anywhere within this directory. Please download, and install.
  return %ff. [ $+ [ $1- ] ]
}

alias nicklisticon {
  if($1 isowner $active) return 1
  elseif ($1 isop $active) return 2
  elseif (*+*m* iswm $chan($active).mode) && ($1 !isvoice $active) return 4
  elseif (*+*m* !iswm $chan($active).mode) && ($1 isvoice $active) return 3
  elseif (*+*m* iswm $chan($active).mode) && ($1 isvoice $active) return 3
  elseif (*+*m* !iswm $chan($active).mode) && ($1 !isvoice $active) return 3
}

on *:join:*: {
  if ($nick == $me) { .timernl -m 1 9 nickinlist }
}

Edited Sep 5, 2008 2:07 AM by Warrior124

Thanks that worked just need to play with icon a bit

 

My Other Question is How Would I make it that it picks up popup.ini?

 

I throught maybe something like this

 

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 
}

 

But don't seems to work lol

Edited Sep 5, 2008 2:19 AM by Dippy

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 Sep 5, 2008 9:50 AM by Silo

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

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

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 Sep 5, 2008 10:22 PM by Warrior124
ok That worked well but the Scoll Bar no longer works

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:)

To make the scroll bar work just add this code to your init part...

 

did -z $dname 1

i have just the one question, why would you have helpop for a nicklist on buzzen?

My code does NOT have bugs. It just develops random features.

Because buzzen have helpop

 

ah is that one of the changes when they changed the webchat?

My code does NOT have bugs. It just develops random features.