I've got a wonderful idea [Linked Image from i.ibb.co]

It would be nice if when editing the script after adding a new condition and writing an "if" command, empty round parentheses and empty curly brackets would be automatically added.
In any case, these are mandatory parameters, even when it is done manually without autocomplete, but with automaticity it seems to me it will become more convenient.
It will be similar to code editing, as in any development environment, where there are usually some analogous autocomplete features.
Quote
if () {}

What are the benefits of this solution:

  • All novice scripters will always get the correct construct when creating a new condition.
  • This will prevent a common beginner's scripters error where they forget to close different open brackets.
  • This will speed up the overall editing of the script a bit when creating numerous new conditions.



So in code it might look like this:
Code
on *:TEXT:!test:#test:{
  if () {}
  msg $chan test message
}

But if the code is left like this, it will throw an error message on the second line "* /if: insufficient parameters (line 2, Test.mrc)" and stop the code from running.
I propose to change this behavior so that in the case of empty brackets in the condition, this does not lead to the script stopping, instead, need to send an echo message with a hint on what line number and in what name of the script is the empty condition and also send command for get help info "/help If then else", which should help novice scripters understand, and it won't break the script. Also when leaving empty curly braces, in my opinion, it is not worth reacting at all, this should not be a mistake, since it can be assumed that the script developer will later fill this emptiness with the necessary commands.

In case this interferes with editing, or some of the older scripters find it redundant, then a new item can be added to the scripts editor options for enable or disable this feature. Set as default enable.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples