mIRC Homepage

read the chanfolders

Posted By: XGamerAMD

read the chanfolders - 18/04/22 06:51 PM

how can i read the mirc favorites


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

thnx

[chanfolder]
issue
Posted By: maroon

Re: read the chanfolders - 18/04/22 09:23 PM

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 }
Posted By: XGamerAMD

Re: read the chanfolders - 18/04/22 09:39 PM

thnx so much
Posted By: XGamerAMD

Re: read the chanfolders - 18/04/22 10:36 PM

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?
Posted By: maroon

Re: read the chanfolders - 18/04/22 11:11 PM

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
Posted By: XGamerAMD

Re: read the chanfolders - 19/04/22 12:35 AM

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!!?
Posted By: maroon

Re: read the chanfolders - 19/04/22 11:28 AM

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 }
Posted By: XGamerAMD

Re: read the chanfolders - 19/04/22 07:09 PM

preciate
© 2022 mIRC Discussion Forums