Nicklist.dll alias

By Ayon on Aug 04, 2010

This is an alias covering all the functions available in Nicklist.dll by Janno.
It can be downloaded here: http://www.mircscripts.org/comments.php?cid=2646

Example:
Add a new line: nicklist -al $active $nick($active,$$1)
Return topindex: echo $nicklist(-ti,$active)
Change topindex: nicklist -ti $active 99

It's also included a .chm in the download with full documentation with examples.

Enjoy

; +------------------------------------------------------------
; | Function    : nicklist <type> <window> <line> [line]
; | Description : This function let's you make changes to the
; |               nicklist. i.e: Remove nick when ignored
; |
alias nicklist {
  if ($1 == -al) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd Aline $calc($3 - 1)) | return }
  if ($1 == -rl) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd Dline $calc($3 - 1)) | return }
  if ($1 == -il) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd Iline $calc($3 - 1) $4) | return }
  if ($1 == -cl) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd Cline $calc($3 - 1) $4) | return }
  if ($1 == -dc) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd DColor $3) | return }
  if ($1 == -rs) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd $3 $4) | return }
  if ($1 == -s) { noop $dll(path/to/Nicklist.dll,ListBox,$window($2).hwnd $3 $iif($4,$4,)) | return }
  if ($1 == -ti) { 
    if (!$3) { return $dll(scripts/system/dlls/Nicklist.dll,ListBox,$window($2).hwnd TopIndex) }
    else { noop $dll(scripts/system/dlls/Nicklist.dll,ListBox,$window($2).hwnd TopIndex $3) }
  }
}
; |
; +------------------------------------------------------------

Comments

Sign in to comment.
Gummo   -  Aug 06, 2010

Use a variable. $findfile is extremely inefficient when you know the location already.

alias nicklist {
  var %path path/to/Nicklist.dll
  if ($1 == -al) { noop $dll(%path,ListBox,$window($2).hwnd Aline $calc($3 - 1)) | return }
  if ($1 == -rl) { noop $dll(%path,ListBox,$window($2).hwnd Dline $calc($3 - 1)) | return }
  if ($1 == -il) { noop $dll(%path,ListBox,$window($2).hwnd Iline $calc($3 - 1) $4) | return }
  if ($1 == -cl) { noop $dll(%path,ListBox,$window($2).hwnd Cline $calc($3 - 1) $4) | return }
  if ($1 == -dc) { noop $dll(%path,ListBox,$window($2).hwnd DColor $3) | return }
  if ($1 == -rs) { noop $dll(%path,ListBox,$window($2).hwnd $3 $4) | return }
  if ($1 == -s) { noop $dll(%path,ListBox,$window($2).hwnd $3 $iif($4,$4,)) | return }
  if ($1 == -ti) { 
    if (!$3) { return $dll(%path,$window($2).hwnd TopIndex) }
    else { noop $dll(%path,ListBox,$window($2).hwnd TopIndex $3) }
  }
}

It can be simplified more anyway if you set %arguments and then just execute that as in:

alias nicklist {
  var %args
  if ($1 == -al) %args = Aline $calc($3 - 1)
  if ($1 == -rl) %args = Dline $calc($3 - 1)
  if ($1 == -il) %args = Iline $calc($3 - 1) $4
  if ($1 == -cl) %args = Cline $calc($3 - 1) $4
  if ($1 == -dc) %args = DColor $3
  if ($1 == -rs) %args = $3 $4
  if ($1 == -s) %args = $3 $iif($4,$4,)
  if ($1 == -ti) { 
    if (!$3) %args = TopIndex
    else %args = TopIndex $3
  }
  if (%args) noop $dll(path/to/DLL,ListBox,$window($2).hwnd %args)
}

By the way, I don't get $iif($4,$4,).. The only thing that would do is replace 0 and $false with $null.

 Respond  
Sorasyn   -  Aug 05, 2010

So I dont have to type in the path 3 times?

 Respond  
Ayon   -  Aug 05, 2010

That's also an option. But why search for it if you already know where it is? ;)

 Respond  
Sorasyn   -  Aug 05, 2010

I've seen people put that "PATH/TO/something.dll" was wondering why not use a $findfile() function or something that locates the file for you.

 Respond  
Ayon   -  Aug 04, 2010

I'm sorry I haven't been here to answer you guys on the previous posts. Been to busy in my new job, and having a newborn is pretty damn stressfull :) But I'll try my best to stay active from now on. Don't know if I will fix my previous posts, maybe a day I'm bored or something :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.