Skip to content
General IRCd

Tried To Make A Nicklist

A TG007 community discussion started by Haggis.

Discussion 48 posts
Page 1 of 3
Open
Topic #13278 · 48 published posts · 10,181 views

its working and puts in icons etc but when i tried to dock it i t does this

 

desktop3kli.jpg

 

here is my code

 

dialog nicklist {
  title "Nick"
  size -1 -1 86 250
  option dbu
  list 1, 1 20 83 330, size vsbar
  text "Room name", 2, 3 2 80 8
  text "Chatters:", 3, 3 10 43 8
  text "num", 4, 54 11 29 8, right
}

menu channel {
  Nicklist: /dialog -m nicklist nicklist
}

on *:dialog:nicklist:init:*: { 

  listnicks
}

on *:dialog:nicklist:sclick:1: { echo -a $did(1).seltext }

alias listnicks {
  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 12 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 c:\mirc\icons\owner.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\host.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\no.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\voice.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\tick.ico
  did -ra nicklist 4 $nick($active,0)
  did -ra nicklist 2 $active
  did -r nicklist 1
  var %x = 1
  while ($nick($active,%x)) {
    did -a nicklist 1 0 + $nickicon($nick($active,%x)) $nick($active,%x)
    inc %x

  }
}
alias nickicon {
  if ($left($nick($active,$1).pnick,1) == ~) return 1
  if ($left($nick($active,$1).pnick,1) == &) return 2
  if ($left($nick($active,$1).pnick,1) == +) return 4
  if ($left($nick($active,$1).pnick,1) == %) return 2
  else return 3





}

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

you are better off docking it with nicklist dll

 

another thing is you should use nicklist.channelname as the name of the dialog and nicklist.* init so you can have them in multiple rooms

Edited Aug 16, 2009 12:00 AM by err0r

Get information about ircWx here

everytime i see someone post something like this it makes me wana break out the mirc again lol! i may just do it later tonight

Yes, when you use rebar.dll you will need your regular mirc nicklist hidden, because rebar does not dock to the nicklist. In order to dock to the nicklist you will need nicklist.dll to accomplish that. Here is the edited version for you...

 

dialog nicklist {
  title "Nick"
  size -1 -1 86 314
  option dbu
  list 1, 2 20 83 293, size hsbar vsbar
  text "Room name", 2, 3 2 80 8
  text "Chatters:", 3, 3 10 43 8
  text "num", 4, 54 11 29 8, right
}


menu channel {
  Nicklist: /dialog -m nicklist nicklist
}

on *:dialog:nicklist:init:*: {
  dll dll\mdx.dll SetMircVersion $version
  dll dll\mdx.dll MarkDialog $dname
  dll dll\mdx.dll SetFont $dname 1 12 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 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,$active),1,38) - 6) $+ :1 0:2
  dll dll\nicklist.dll Nicklist $dname $active
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal c:\mirc\icons\owner.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\host.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\no.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\voice.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\tick.ico
  listnicks
}

on *:dialog:nicklist:sclick:1: { echo -a $did(1).seltext }

on *:join:#: listnicks
on *:part:#: listnicks
on *:kick:#: listnicks

alias listnicks {
  did -ra nicklist 4 $nick($active,0)
  did -ra nicklist 2 $active
  var %x = 1
  did -r nicklist 1
  while ($nick($active,%x)) {
    did -a nicklist 1 0 + $nickicon($nick($active,%x)) $nick($active,%x)
    inc %x

  }
  .timerresize -m 0 1 resize $active
}

alias nickicon {
  if ($left($nick($active,$1).pnick,1) == ~) return 1
  if ($left($nick($active,$1).pnick,1) == &) || ($left($nick($active,$1).pnick,1) == @) return 2
  if ($left($nick($active,$1).pnick,1) == +) return 4
  if ($left($nick($active,$1).pnick,1) == %) return 2
  else return 3
}

alias resize {
  var %achan $1-
  if ($dialog(nicklist).w $dialog(nicklist).h > $dll(dll\nicklist.dll,GetSize,%achan)) || ($dialog(nicklist).w $dialog(nicklist).h < $dll(dll\nicklist.dll,GetSize,%achan)) {
    dll dll\mdx.dll SetDialog nicklist coords 0 0 $dll(dll\nicklist.dll,GetSize,%achan)
    dll dll\mdx.dll MoveControl nicklist 1 * * $dll(dll\nicklist.dll,GetSize,%achan)
    if ($dialog(nicklist)) {
      did -i nicklist 1 1 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,%achan),1,38) - 6) $+ :1 0:2
    }
    listnicks
  }
}

Edited Aug 16, 2009 7:19 AM by Warrior124

cool i made those changes but now it look slike this

 

desktop4w.jpg

 

and also its flashing all the time

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Ahh, I see what happened. Replace the init part of the code with this...

 

on *:dialog:nicklist:init:*: {
  dll dll\mdx.dll MarkDialog $dname
  dll dll\mdx.dll SetMircVersion $version
  dll dll\mdx.dll SetDialog $dname style
  dll dll\mdx.dll SetFont $dname 1 12 50 verdana
  dll dll\mdx.dll SetColor $dname 1 text $rgb (0,0,139)
  dll dll\mdx.dll SetControlMDX $dname 1 ListView report showsel noheader smallicon hottrack single > dll\views.mdx
  did -i $dname 1 1 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,$active),1,38) - 6) $+ :1 0:2
  dll dll\nicklist.dll Nicklist $dname $active
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal c:\mirc\icons\owner.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\host.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\no.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\voice.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\tick.ico
  listnicks
}

 

It should look like this now...

post-216-1250438244_thumb.jpg

post-216-1250438418_thumb.jpg

post-216-1250438426_thumb.jpg

Edited Aug 16, 2009 4:01 PM by Warrior124
Attachments 3 files

cool thanks i will give that a try when i get home

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

No problem. So far it only works for one channel, but you can make it to work for others as err0r suggested, or making it to where it would close, and then reopen on active. :)

put code exactly as you had it before and turn off mircs nicklist

or use nicklist.dll to dock it rather than rebar

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

why does it do this

 

desktop5r.jpg

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

When you make the nicklist wider it does that for some reason. As of yet I don't know how to fix that, but I'll work on it, though. :)

you need to have it auto resize when you change the nicklist size

Get information about ircWx here

i'm not home atm but i have a nicklist that works on every network, multiple channels, and auto resizes.. i'll pm u on tg when i get home with it

Get information about ircWx here

I've added some code to this, as well as added a left hand vertical scroll bar so you can scroll the nicklist. Here is the code. :)

 

dialog nicklist {
  title "Nick"
  size -1 -1 86 314
  option dbu
  list 1, 10 20 75 293, size extsel hsbar vsbar
  text "Room name", 2, 3 2 80 8
  text "Chatters:", 3, 3 10 43 8
  text "num", 4, 54 11 29 8, right
  button "", 5, 1 21 8 283
}

menu channel {
  Nicklist: {
    if ($dialog(nicklist)) dialog -c nicklist nicklist
    dialog -m nicklist nicklist
  }
}

on *:dialog:nicklist:init:*: {
  dll dll\mdx.dll MarkDialog $dname
  dll dll\mdx.dll SetMircVersion $version
  dll dll\mdx.dll SetDialog $dname style
  dll dll\mdx.dll SetFont $dname 1 12 50 verdana
  dll dll\mdx.dll SetColor $dname 1 text $rgb (0,0,139)
  dll dll\mdx.dll SetControlMDX $dname 1 ListView report showsel noheader smallicon hottrack single > dll\views.mdx
  dll dll\mdx.dll SetControlMDX $dname 5 scrollbar vertical > dll\ctl_gen.mdx
  did -i $dname 1 1 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,$active),1,38) - 6) $+ :1 0:2
  dll dll\nicklist.dll Nicklist $dname $active
  did -ra $dname 5 1 0 114 15 2 1
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal c:\mirc\icons\owner.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\host.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\no.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\voice.ico
  did -i $dname 1 1 seticon normal c:\mirc\icons\tick.ico
  listnicks
}

on *:dialog:nicklist:sclick:*: { 
  if ($did == 1) echo -a $did(1).seltext
  if ($did == 5) relistnicks
}

on *:join:#: listnicks
on *:part:#: listnicks
on *:kick:#: listnicks

alias listnicks {
  did -ra nicklist 4 $nick($active,0)
  did -ra nicklist 2 $active
  var %x = 1
  did -r nicklist 1
  while ($nick($active,%x)) {
    did -az nicklist 1 0 + $nickicon($nick($active,%x)) $nick($active,%x)
    inc %x

  }
  .timerresize -m 0 1 resize $active
}

alias relistnicks {
  .remove nicklist.txt
  var %x = $gettok($calc($did(nicklist,1).lines * $gettok($did(nicklist,5).text,1,32) / 100),1,$asc(.))
  did -r nicklist 1
  while ($nick($active,%x)) {
    write -l $+ %x nicklist.txt 0 + $nickicon($nick($active,%x)) $nick($active,%x)
    inc %x
  }
   loadbuf -ro nicklist 1 nicklist.txt
  .timerresize -m 0 1 resize $active
}
alias nickicon {
  if ($left($nick($active,$1).pnick,1) == ~) return 1
  if ($left($nick($active,$1).pnick,1) == &) || ($left($nick($active,$1).pnick,1) == @) return 2
  if ($left($nick($active,$1).pnick,1) == +) return 4
  if ($left($nick($active,$1).pnick,1) == %) return 2
  else return 3
}

alias resize {
  var %achan $1-
  if ($dialog(nicklist).w $dialog(nicklist).h > $dll(dll\nicklist.dll,GetSize,%achan)) || ($dialog(nicklist).w $dialog(nicklist).h < $dll(dll\nicklist.dll,GetSize,%achan)) {
    dll dll\mdx.dll SetDialog nicklist coords 0 0 $dll(dll\nicklist.dll,GetSize,%achan)
    dll dll\mdx.dll MoveControl nicklist 1 * * $gettok($dll(dll\nicklist.dll,GetSize,%achan),1,32) 2000
    if ($dialog(nicklist)) {
      did -i nicklist 1 1 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,%achan),1,38) - 6) $+ :1 0:2
    }
    listnicks
  }
}

i got it working when i switch channels lol

 

desktop6.jpg

 

desktop7j.jpg

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

if you look at the first screenshot though, the bottom person is half cut off, so it needs an auto resizer otherwise you won't be able to do some of the things in a full room.

theres a scrollbar there so u can scroll down to the other names

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

i don't see a scrollbar in the screenshot though.

The scrollbar is on the left side of the nicklist. :)

post-216-1250509093_thumb.jpg

Edited Aug 17, 2009 11:38 AM by Warrior124
Attachments 1 file

that is a bit of a silly place to put it in my opinion because of the fact that all conventions put it on the right side. you should try and stick to it, cause even for an experienced user like me, it doesn't make sense at all.