Project

General

Profile

Is there a way to store a list of all #channels available in a server in the clipboard?

Added by Eduardo Bedoya over 8 years ago

Hi,
Is there a way to get a list of all #channels available in a server? (like storing that list on the clipboard, or displaying it so I can copy the entire List). I've search in the AdiIRC scripting language for a command to do that.
I would like to do so, cuz that server List is the only thing I need to complete the script to select the 2 first chatrooms in a server that are not inside a ban list. With that server list I could make all my way out with the script. (I have a workaround).

Thanks Advanced.


Replies (17)

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

So far I have found that if you change AidIRC options...
File >> Options >> Quick Connect >> Show ChannelList on /list (DISABLE)
and then (while connected to a server) in main window you type...
/list -min 200 -max 9999
it will display the list of channels of the server you are currently loggedin in the main window

but is there a command to copy that channel list to clipboard instead?
I have tried...
//clipboard /list -min 200 -max 9999 and
//clipboard $list -min 200 -max 9999
with no result.

Any hint?

Thanks Advanced.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

http://kr0n.dk/view/581323e9

Have a look at this script made by someone else, it puts the channels in the variable %topXchannels

Change the config at the top.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Thanks Admundsen, but I don't quite get it, I copy that and save it as a script??
could you please tell me which line(number) should I replace?
I have realized tha list is displayed not sorted descendent by user.

Thanks man.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

Yeah save it as a script, then get the channel list the usual way, afterwards the channels are in the variable %topXchannels, you could then do something like //clipboard %topXchannel or use the variable in the other script I made for you by replacing %channels with %topXchannels.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Hi Amundsen
I save the script in the link you provided as a script, restarted AdiIRC
type /list in main window (while connected to a server)
it displayed all channels List (no range eg. -min 200 - max900) (not sorted descendent by user)
I wait until it ended displaying the hole channels List
then I type
//clipboard %topXchannel
but it didn't copied anything to the clipboard

am I doing something wrong?
I prefer the default AdiIRC /list command, cuz it can restrict the results (-min 200 - max900) it just would be perfect, if it could sort descendent by user that result and store into a variable. please could you tell me if that is possible via scripting?

THanks Advanced man, thanks again for your support.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

It's possible but very hard, I have only this bandaid solution for now.

Remember to change the config at the top of the script

alias -l netarget return NordicIRC
alias -l users return 10

NordicIRC should be name of the network, the name you see in Treebar/Switchbar.
And 10 should be the minimum number of users to add to the variable.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

You can also type //echo -ag §network to get the network name.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Hi Admundsen
I replace NordicIRC with IRC-Hispano at the top of script
I left 10 as it was. (I don't quite get it what does "minimun number of user to add to the variable" mean)

I save the script,
restarted AidIRC,
type /list in main window (while connected to a server)
it displayed all channels List (no range eg. -min 200 - max900) (not sorted descendent by user)
I wait until it ended displaying the hole channels List
then I type
//clipboard %topXchannel
and it copied (void) into the clipboard (before running the command, the clipboard was "//clipboard %topXchannel" without quotes, afte running the command it was 'Empty')

am I doing something wrong?

Hope man, you could add that script to your TODO list, hope Im not abussing of your support.

Many Thanks

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Thanks man
I really think the default aidIRC /list command is way far better that the script in the link you provided, cuz it can restrict (-min 200 -max 900). I would prefer to get that script into a Variable rather than the script in the link, Hope you could get it, hope not abussing of your support, many thanks again man.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

Filtering yourself makes it easier.

Remove the other script for list, and just add this in a new script:

raw 321:*: {
    unset %topXchannels    
}

raw 322:*:{ 
  set %topXchannels %topXchannels $2 
}

It works with both /list and user interface list.

When the list is done, you can use //clipboard %topXchannels

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Thanks man,
It works, but it shows all channels without any sorting or range (min, max), I would like the list to be sorted descendent by number of users, and only display -min 300 users -max 9999 users.
Hope man you could add this to your TODO list for a future develop, I know it may be complitaded, but I also guess that, that kind of sorting could improve very much your Channel List panel.

Thanks Advanced.
PD: Currently I have the "join channels that are not in a banlist" script working, by manually copying one by one the channel names from the Channel List panel (right click >> Copy Channel Name) using an external macro recorder and append it to a list. And then typing that List into the "join channels that are not in a banlist" script. It works. (I could avoid all that slow macro recorder process if I were able to retrieve that Channel list via a script). Thanks Again man, congrats nice software.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

The channel list already supports min/max and sorting (just click the users tab header), you can also type "/list -min 300 -max 9999" manually (if the network supports it).

Sorting in the script is something that can already be done using /filter, I might try create the script soon.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

Here you go, delete the previous script.

This should integrate well with the previous script I made, if you remove the "var %channel ..." line.

alias sortlist {
  var %tok1 $gettok($1,1,32)
  var %tok2 $gettok($2,1,32)

  if (%tok2 > %tok1) {
    return 1
  }

  if (%tok2 < %tok1) {
    return -1
  }

  return 0
}

raw 321:*: {
    if (!$window(@list)) {
      window -lh @list
    }
    else {
      clear -l @list
    }
    unset %channels    
}

raw 322:*:{ 
  aline @list $3 $2
}

raw 323:*: {
  filter -lLca @list @list /sortlist
  var %s 0
  unset %channels
  while (%s < $line(@list,0)) {
    inc %s
    set %channels %channels $gettok($line(@list,%s),2,32)
  }

  ;echo -ag dd %channels
}

on *:EXIT:unset %channels

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Hi Amundsen, thanks for your support!
I delete this script

raw 321:*: {
    unset %topXchannels    
}

raw 322:*:{ 
  set %topXchannels %topXchannels $2 
}

I erase the line "var %channel ..." from the "joinchan" script, and save it

I copy the code in your previous comment and pasted it into a new script named "sortlist"

I restarted AdiIRC
logged to IRC-Hispano server
1. I typed... /list -min 300 -max 9999
2. then I typed... /sortlist
3. then I typed... /joinchan 3
and it worked.
Thanks again Amundsen.

please correct my if Im wrong, I have to type all 3 commands consecutively right?

PD: in AdiIRC options "File >> Options >> Server >> Try to regain nick" what does "Try to regain nick" mean??? THanks man.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Per Amundsen over 8 years ago

No need to type /sortlist, this is used in the script to do the sorting.

The rest is correct.

"Try to regain nick" means AdiIRC will try to regain your nick e.g if you connect to a server where a nick is already in use, AdiIRC will keep trying to get the nick until the original user is logged off.

RE: Is there a way to store a list of all #channels available in a server in the clipboard? - Added by Eduardo Bedoya over 8 years ago

Incredible, thanks Amundsen, really nice software,
I have realize it even reconnect to server if internet connection drops for a moment, nice software indeed.
Many Thanks Man.

    (1-17/17)