Skip to content
General IRCd

Tried To Make A Nicklist

A TG007 community discussion started by Haggis.

Discussion 48 posts
Page 2 of 3
Open
Topic #13278 · 48 published posts · 10,227 views

just because all the sheep do it does not mean i should stick to the herd ;)

Edited Aug 17, 2009 12:38 PM by Haggis

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

You forget, David. I too am experienced with scripting, myself, and to me it makes some sense to put it there. For one thing it keeps a person from having to move the mouse a little more to get to the scrollbar. Not everyone has a digital mouse, and has to rely on on old mouse using a ball, lol. So, something like this makes perfect sense to use.

 

Also, if you place an mdx scrollbar on the right hand side you will also need to configure it to stay put when the nicklist is stretched. I can do that. However, I won't unless Haggis wants me to. As far as it being silly it may be unique, but please watch what you say about a persons work. You don't have to use it if you don't want, but don't insult someones work just because you don't like it.

I'm assuming this can very well be used as a webservice ... -obeselete-

 

 

---------------

 

I'm sorry ... too far fetched.

Edited Aug 17, 2009 4:37 PM by Shems

what are u talking about?

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

To me, I like to have my nicklist shown on my FAR left side. It's the same logic we have people right- and left-handed.

Edited Aug 17, 2009 6:29 PM by Fanfare

warrior, it was an opinion. I did not intend or come off as being a "flamer" on his work. I gave a valid reason as to why i thought that. I would hope that it was constructive critism, cause if i was to have really flamed it, i could of used a lot more words than that to do so. But I gave my opinion for it.

 

Being that it's critism, you can take it or leave it at your discretion, that is the fun about being human.

 

Btw, isn't there an auto list scroll bar that generally gets created when a list is too long? I don't recall having to make a scroll bar in GD5 for the nicklist, it was there.

No problem, mate. Thanks for clearing that up.

 

To answer your question, yes there is. However, it is almost inaccessible for some reason when using the style version from mdx. The border hides most of the scrollbar.

Edited Aug 17, 2009 10:36 PM by Warrior124

i tried to make it multi room but now it seems to crash mirc lol and the nicklist does not show

 

 

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 $+ $active nicklist $+ $active
    dialog -m nicklist $+ $right(#,-1) 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 *:join:#: listnicks
on *:part:#: listnicks
on *:kick:#: listnicks

alias listnicks {
  did -ra nicklist $+ $right(#,-1) 4 $nick($active,0)
  did -ra nicklist $+ $right(#,-1) 2 $active
  var %x = 1
  did -r nicklist $+ $right(#,-1) 1
  while ($nick($active,%x)) {
    did -az nicklist $+ $right(#,-1) 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 $+ $right(#,-1),1).lines * $gettok($did(nicklist $+ $right(#,-1),5).text,1,32) / 100),1,$asc(.))
  did -r nicklist $+ $right(#,-1) 1
  while ($nick($active,%x)) {
    write -l $+ %x nicklist.txt 0 + $nickicon($nick($active,%x)) $nick($active,%x)
    inc %x
  }
  loadbuf -ro nicklist $+ $right(#,-1) 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 $+ $right(#,-1)).w $dialog(nicklist $+ $right(#,-1)).h > $dll(dll\nicklist.dll,GetSize,%achan)) || ($dialog(nicklist $+ $right(#,-1)).w $dialog(nicklist $+ $right(#,-1)).h < $dll(dll\nicklist.dll,GetSize,%achan)) {
    dll dll\mdx.dll SetDialog nicklist $+ $right(#,-1) coords 0 0 $dll(dll\nicklist.dll,GetSize,%achan)
    dll dll\mdx.dll MoveControl nicklist $+ $right(#,-1) 1 * * $gettok($dll(dll\nicklist.dll,GetSize,%achan),1,32) 2000
    if ($dialog(nicklist $+ $right(#,-1))) {
      did -i nicklist $+ $right(#,-1) 1 1 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,%achan),1,38) - 6) $+ :1 0:2
    }
    listnicks
  }
}
;on 1:ACTIVE:*: {
;  if ($dialog(nicklist)) dialog -c nicklist nicklist
;  dialog -m nicklist nicklist
;}

 

 

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

var %x = $gettok($calc($did(nicklist $+ $right(#,-1),1).lines * $gettok($did(nicklist $+ $right(#,-1),5).text,1,32) / 100),1,$asc(.))
  did -r nicklist $+ $right(#,-1) 1
  while ($nick($active,%x)) {

 

I could be very well wrong but just guessing %x should just be a total number of lines in the nicklist if this is also i would use .dec %x if i already had the line total and just negate the value on the loop. The while loop would cause u to crash it.

 

Correct me if im wrong never really worked with nicklists.

 

I Didnt do it ...

i dont think its that bit as i have not actually changed anything in the loop

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

humms o well ill leave it to the pros lol .. good job sofar tho looks nice

 

I Didnt do it ...

The following code will make it for multiple rooms...

 

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:
  .Turn Nicklist On: {
   ;This will turn the nicklist on for each channel you use it in.
    if ($dialog(nicklist $+ $active)) dialog -c nicklist $+ $active nicklist
    dialog -m nicklist $+ $active nicklist
   ;The codes above will determine if the nicklist for a channel is already running. If it is it will close, and reactivate it.
  }
  .Turn Nicklist off: dialog -c nicklist $+ $active 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
;The code above transforms the button above into a vertical scrollbar.
  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
;The code above attaches your custom nicklist to the one in mIRC.
  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*:*:*: {
  if ($devent == sclick) {
    if ($did == 1) echo -a $did(1).seltext
    if ($did == 5) relistnicks
  }
  elseif ($devent == close) .timerresize. $+ $remove($dialog(nicklist*),nicklist) off
}

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

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

  }
  .timerresize. $+ $active -m 0 1 resize $active
;This code resizes the nicklist if it needs to. Otherwise, it won't do anything.
}

;This code is used for scrolling with the scrollbar. It deletes the top names from the list while scrolling down, and readds them when scrolling up. It calculates the position of the scrollbar to determine which nicknames to add, and which to delete. Therefore giving it a scrolling perspective.
alias relistnicks {
  .remove nicklist.txt
  var %x = $gettok($calc($did(nicklist $+ $active,1).lines * $gettok($did(nicklist $+ $active,5).text,1,32) / 100),1,$asc(.))
  did -r nicklist $+ $active 1
  while ($nick($active,%x)) {
    write -l $+ %x nicklist.txt 0 + $nickicon($nick($active,%x)) $nick($active,%x)
    inc %x
  }
   loadbuf -ro nicklist $+ $active 1 nicklist.txt
  .timerresize. $+ $chan -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
}

;The following alias checks to see if the nicklist needs to be resized for whatever reason. If the nicklist isn't the size of mIRC's nicklist it will resize to compensate.
alias resize {
  var %achan $1-
  if ($dialog(nicklist $+ %achan)) {
    if ($dialog(nicklist $+ %achan).w $dialog(nicklist $+ %achan).h > $dll(dll\nicklist.dll,GetSize,%achan)) || ($dialog(nicklist $+ %achan).w $dialog(nicklist $+ %achan).h < $dll(dll\nicklist.dll,GetSize,%achan)) {
      dll dll\mdx.dll SetDialog nicklist $+ %achan coords 0 0 $dll(dll\nicklist.dll,GetSize,%achan)
      dll dll\mdx.dll MoveControl nicklist $+ %achan 1 * * $gettok($dll(dll\nicklist.dll,GetSize,%achan),1,32) 2000
      if ($dialog(nicklist $+ %achan)) {
        did -i nicklist $+ %achan 1 1 headerdims $calc($gettok($dll(dll\nicklist.dll,GetSize,%achan),1,38) - 6) $+ :1 0:2
      }
      listnicks
    }
  }
}

Edited Aug 19, 2009 1:15 AM by Warrior124

warrior, maybe we should point out what modifications took place to have the code work? It may be beneficial for others to know what you did. I could probably work it out, but yea, not sure everyone here could.

i got it by looking at the code i had and seeing what warrior had put

 

i find this a good way as it lets me see what i did wrong and why it is wrong

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

Yes, with some people it is beneficial, but if you tell people straight off how to do it then most of the times they don't look over the code. Haggis is doing a terrific job by looking over the code to learn. If I ever give out any code that someone doesn't understand they can always ask me how to do it, and I'll definitely help out that way, too. However, I find the best way to learn is actually to dig in, and see what does what. That is how I learned, lol. :)

yea i am the same warrior. I pretty much did that with all my languages as well.

but if you label it like

; this line does this or that

 

it becomes more than an example to help one person..

 

it becomes a tutorial to help a lot of ppl

Get information about ircWx here

That's true, lol. I'll try it like that.

The code has been modified to include an explaination of what was added. Click here

Edited Aug 19, 2009 1:17 AM by Warrior124

nice job :yes:

Get information about ircWx here