mIRC Home    About    Download    Register    News    Help

Print Thread
read the chanfolders #270196 18/04/22 06:51 PM
Joined: Apr 2005
Posts: 72
X
XGamerAMD Offline OP
Babel fish
OP Offline
Babel fish
X
Joined: Apr 2005
Posts: 72
how can i read the mirc favorites


//echo -a $read($mircdir,mirc.ini,3)?

thnx

[chanfolder]
issue

Last edited by XGamerAMD; 18/04/22 06:56 PM.
Re: read the chanfolders [Re: XGamerAMD] #270197 18/04/22 09:23 PM
Joined: Jan 2004
Posts: 1,772
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,772
depends what you want to read from it. If all you need is the name of the channel, this will do it. The data in the [chanfolder] section can be sorted in a different order than appears in the favorites list. Each channel has the information has 1 of the items in that section, and it's in comma-delimited format, where there's doublequotes around some of the fields that can contain a comma.

//var -s %i 1 , %total $ini($mircini,chanfolder,0) | while (%i <= %total) { var %item $ini($mircini,chanfolder,%i) , %line $readini($mircini,n,chanfolder,%item) | echo -a $gettok(%line,1,44) | inc %I }

Re: read the chanfolders [Re: maroon] #270198 18/04/22 09:39 PM
Joined: Apr 2005
Posts: 72
X
XGamerAMD Offline OP
Babel fish
OP Offline
Babel fish
X
Joined: Apr 2005
Posts: 72
thnx so much

Re: read the chanfolders [Re: maroon] #270199 18/04/22 10:36 PM
Joined: Apr 2005
Posts: 72
X
XGamerAMD Offline OP
Babel fish
OP Offline
Babel fish
X
Joined: Apr 2005
Posts: 72
Originally Posted by maroon
depends what you want to read from it. If all you need is the name of the channel, this will do it. The data in the [chanfolder] section can be sorted in a different order than appears in the favorites list. Each channel has the information has 1 of the items in that section, and it's in comma-delimited format, where there's doublequotes around some of the fields that can contain a comma.

//var -s %i 1 , %total $ini($mircini,chanfolder,0) | while (%i <= %total) { var %item $ini($mircini,chanfolder,%i) , %line $readini($mircini,n,chanfolder,%item) | echo -a $gettok(%line,1,44) | inc %I }


n17=#chaco-corrientes,,,"RedHispana" how can i select this?

Re: read the chanfolders [Re: XGamerAMD] #270200 18/04/22 11:11 PM
Joined: Jan 2004
Posts: 1,772
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,772
It helps if you describe your ultimate goal.
The favorites list isn't designed to interact with scripts, as evidenced by how it's stored in CSV format like this. Are you trying to find a specific channel name within the list? finding the 18th item in the list? Finding items that are at a specific network? I can tell from your example that you've chosen something that isn't even selected for autojoin.

The purpose of the favorites list is mainly so you can have a list of channels from which you can choose to join, as well as being a list where some of the channels can be auto-joined every time you connect to that network.
So depending on what you really want, there are several different answers

Re: read the chanfolders [Re: maroon] #270201 19/04/22 12:35 AM
Joined: Apr 2005
Posts: 72
X
XGamerAMD Offline OP
Babel fish
OP Offline
Babel fish
X
Joined: Apr 2005
Posts: 72
Originally Posted by maroon
It helps if you describe your ultimate goal.
The favorites list isn't designed to interact with scripts, as evidenced by how it's stored in CSV format like this. Are you trying to find a specific channel name within the list? finding the 18th item in the list? Finding items that are at a specific network? I can tell from your example that you've chosen something that isn't even selected for autojoin.

The purpose of the favorites list is mainly so you can have a list of channels from which you can choose to join, as well as being a list where some of the channels can be auto-joined every time you connect to that network.
So depending on what you really want, there are several different answi miers


i main kind of filter redispana!!?

Re: read the chanfolders [Re: XGamerAMD] #270204 19/04/22 11:28 AM
Joined: Jan 2004
Posts: 1,772
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,772
As I had mentioned, searching within the favorites list for a specific string is not reliable because of how the favorites info is saved. It seems like you want to create a list of channels attached to a specific network.

The favorites list is saved as comma delimited, where the network is the 4th token. However, if that channel exists at more than 1 network, the 4th token would change from being like ,redispana, to being ,"redispana,dalnet, quakenet", etc. It is also possible for the 2nd token to be a string containing a comma inside doublequotes, so $gettok(string,4,44) would no longer be looking at the network names.

If all you care about is entries in the favorites list which contain 'redispana' somewhere within the entire list of information, you can edit the following to change *swiftirc* to *redispana*

The -s create debugging information so you can see the entire line existing inside mirc.ini, so you can reduce the clutter by removing the -s switch. You can have the following commands be on separate lines within your alias if you also make sure that the | symbol is deleted so that it does not begin or end any of the lines

//hfree -w delete_me | hload -im1 delete_me $qt($mircini) chanfolder | var -s %wildcard *swift* , %i $hfind(delete_me,%wildcard,0,w).data | while (%i) { var -s %item $hfind(delete_me,%wildcard,%i,w).data , %data $hget(delete_me,%item) | echo -a channel: $gettok(%data,1,44) | dec %i }

Re: read the chanfolders [Re: maroon] #270209 19/04/22 07:09 PM
Joined: Apr 2005
Posts: 72
X
XGamerAMD Offline OP
Babel fish
OP Offline
Babel fish
X
Joined: Apr 2005
Posts: 72
preciate