mIRC Homepage

/setlayer sets 0 if not using a number.

Posted By: KindOne

/setlayer sets 0 if not using a number. - 16/09/20 10:37 PM

I think this command should print an error instead of just blindly setting 0 if someone makes a typo.

Code
//setlayer a | timer 1 5 setlayer 255
Posted By: Khaled

Re: /setlayer sets 0 if not using a number. - 18/09/20 12:01 PM

Thanks for your bug report. Technically, this is standard behaviour across the scripting language and in most features. While some commands and identifiers will report an error if you try to use text instead of a number, the majority will simply try to extract a number from the parameter that you provide. If it happens to be text, it will return zero.
Posted By: maroon

Re: /setlayer sets 0 if not using a number. - 18/09/20 11:49 PM

For this command, evaluating text as if 0 can make it difficult to get back into your client after this scripting error.

//var %setting 128 | !setlayer %setting $chan(1) | timer -o 1 10 !setlayer 255

If the 128 is deleted, the $null %variable causes the first setlayer command to be seen as "setlayer #channel" which is evaluated as if "setlayer 0" against the main window.
Posted By: KindOne

Re: /setlayer sets 0 if not using a number. - 29/09/20 07:04 PM

Quote
15.Changed /setlayer to report an error if invalid parameters are
used.


Thank you. smile
© 2020 mIRC Discussion Forums