This is an updated code and has been tested to the best of my ability over the past week on 10 - 20 channels over 4 networks.
Please let me know if you run into any difficulties, and please be as precise as you can.
Note: There is a slight chance that one or more nicks may not be stored correctly if there is a lot of people that join a channel very quickly.