It's all related, I'll try to explain again.
Let start from the problem: a user (several users, to be more correct) chat in different channels. In most of them, copy-paste is allowed and in many others it isn't. Sometimes, they mistake an paste text in channels where it's not allowed.
Seeing that scenario, I think it would be great some kind of self-protection to avoid pasting in channels where it's forbidden at the same time it allows pasting in the channels where it is allowed. And all of this, of course, in a transparent way to the user, which would only have to mark a check box in a option window (different from the one provided by mIRC) entitled like "Avoid pasting in these channels" or so.
At the time of developing it, I thought about several options, in this order:
- On INPUT event: discarded from the beggining, as a halt on an ON INPUT in one script doesn't stop ON INPUT in the rest of the scripts.
- Use the confirm Tools->Options->Other->Confirm-> Confirm when pasting x or more lines of text. The idea would be that, when in an allowed channel, this option to be disabled, and when in a forbidden channel, enabled, with automatic switching from one to another setting, I mean, with no user action needed (this is the key point)
At this point, I began looking for a way to enable / disable this confirmation depending on the channel the user is. I follow 3 approaches to this:
1 ) looking for some function in mIRC documentation which allows adjusting this setting. Dead End, at least, what I've seen til now.
2 ) using $readini and writeini to modify mirc.ini, according to the document Mirc Unleashed, which provides the line and position for every option in mIRC, and forcing to reload mirc.ini without restarting mIRC. A "dirty solution", as writeini is suggested not to be used to modify mirc.ini and it's unknown how options may be trated and stored in future versions. Dead End, at least, what I've seen til now.
3 ) using COM to simulate key strokes by the user to open the options window and navigate to enable/disable this option. This solution is even dirtier, as it depends on the order and position of the components in the options window but, til now, is the only one which I see as possible. This approach, which I initially preferred to be discarded, was also suggested by another scripter I exposed the question to.
Hope this explanation shows you why ON INPUT, reloading mirc.ini and a function to change settings in mIRC are related, at least concerning the problem I want to solve.