Everyone is so defensive about mIRC. In my initial post where did I blame it all on mIRC and say mIRC is bugged and broken and generally sucks? I simply asked if there was a way to have mIRC clean up its connection list.
And yes, my code showed the issue with its /scid $cid when $cid = 25 and 25 doesn't exist.
The second part answers the first. You're saying that there's a bug in mIRC that's causing it to return invalid values for $cid. What just about everyone else has been saying throughout this whole thread is that nobody else appears to have this problem and the more likely
cause is a line in your script that you've missed. There isn't a 'clean up CIDs' feature in mIRC because there should be no need - if CIDs needed 'cleaning up' it would be a bug in mIRC to be fixed.