well, this part of your code should be storing the commands per channel:
Code:
writeini commands.ini # $regml(1) $$3-


I'm not sure what else you have going on in the on add command, as when I have my script write new commands to text file, I have the on trigger, a check for isop, and then the write ini code. The write ini code is exactly the same as you have. That is all I have in my on add code block.
Have you verified that the commands are being stored per channel?


I haven't quite figured out what everything stands for in mirc script language, but if I'm not mistaken, when writing the new command, the # designates the specific channel it is being added from/to, the $regml(1) designates the name of the command, and $ss3- designates the text for the command?

if so, when reading back from the text file, you will want to designate that you are reading from channel #, and then also the name of the command $regml(1).




So far I have not yet gotten into coding iterating over all commands for channel to return everything stored for that channel, but if you are simply just looking for a !commands command where it will just return the commands per your channel, store a commandname in the text that returns the commands for your channel. Then, when you add a new command, make sure you either manually add the new command to the list, or code into your addcomm command that the command name is also written to the end of your commandname command in the text.

At least this is how I would do it until figuring out a way to iterate through the text successfully, but honestly, that seems like a lot more code would be required then the benefits. Maybe I'm just thinking about the logic wrong, but we will see.




The code you have to read the file:
Code:
on 4:TEXT:!commands:#: {
msg # Commands are: $read(commands.txt)
}

Looks like it returns everything in the commands.text file? Even the channel names, command names, and command text, right?
If so, it is because you are only simply reading the text file, not designating a channel to read from.

Last edited by AeonPsych; 20/07/14 01:19 AM.