mIRC Homepage
Posted By: Marantz /list - 23/11/04 04:38 PM
Ok, i saw a while ago a post on /list to be able to make your own one instead of mIRC's default, so i took this idea and added a few bits...

raw *:*: {
  if $numeric == 321 {
    window -h "channels list"
    set  %list $ticks
    if !$window($+(@List-,$network)) { window -kal $+(@List-,$network) }
    aline $+(@List-,$network) Listing all available channels on 00 $+ $network
    aline $+(@List-,$network)  14-
    aline $+(@List-,$network)  00,14Channel $+ $str($chr(255),$calc(20 - $len(Channel))) $+ 00,14Users/Modes $+ $str($chr(255),$calc(41 - $len(Users/Modes))) $+ 00,14Topic
  if $numeric == 322 { aline $+(@List-,$network)  $2 $+ $str($chr(255),$calc(20 - $len($2))) $+ $3-4 $+ $str($chr(255),$calc(41 - $len($3-4))) $+ $5- | halt }
  if $numeric == 323 {
    aline $+(@List-,$network)  14-
    aline $+(@List-,$network)  Finished Listing channels for 00 $+ $network
    aline $+(@List-,$network)  Listing Took00 $round($calc($calc($ticks - %list) / 1000),4) $+ s
    window -kb $+(@List-,$network) 
    window -c "channels list"

Problem i have now is that if i highlight a line with a channel in it, how would i make an option to say /join that channel or /who it (if it's not +s or +p)
i don't know where to start really frown
Posted By: FiberOPtics Re: /list - 23/11/04 05:56 PM
You can add a popupmenu to a custom window.

For example, make a .txt file named "listchannels.txt", and put this in it:

Join Channel: ls_joinchans
Who Channel: ls_whochans

Then in your script, add these 2 aliases:

alias ls_joinchans {
  var %a = 1, %b
  while $sline($active,%a) { %b = %b $+ , $+ $gettok($v1,1,255) | inc %a }
  join %b
[color:red]  [/color] 
alias ls_whochans {
  var %a = 1, %b
  while $sline($active,%a) { 
    if $me ison $gettok($v1,1,255) { who $v1 }
    inc %a 

Then in your raw code, when creating the window, specify the .txt file like:

if !$window($+(@List-,$network)) { window -kal $+(@List-,$network) listchannels.txt }

This was scripted in a rush, so there could be mistakes, and optimization might be necessary. Btw I'm curious
why you use $chr(255) for your alignment, it looks kinda odd, but I suppose that is a personal preference.

Posted By: Marantz Re: /list - 23/11/04 06:28 PM
Ahh sweet, that does work fine, and also i use $chr(255) because the font i use (IBMPC) which is an ascii based font it returns a hidden character, so i can create spaces and align things.

thanks for the help. smile
Posted By: FiberOPtics Re: /list - 24/11/04 01:10 AM
Posted By: DaveC Re: /list - 24/11/04 02:51 AM
just a note, you can use TAB alignments in custom windows this well ensure your text lines up in its columns, from memory with listbox windows, a column that has text thats too large well even hide the text that exceeds the column width. $chr(9) TAb and -t in /window i think
© mIRC Discussion Forums