mIRC Home    About    Download    Register    News    Help

Print Thread
/setlayer sets 0 if not using a number. #267753 16/09/20 10:37 PM
Joined: Feb 2011
Posts: 366
K
KindOne Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 366
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


irc.swiftirc.net #msl (mIRC Scripting Language)
Re: /setlayer sets 0 if not using a number. [Re: KindOne] #267761 18/09/20 12:01 PM
Joined: Dec 2002
Posts: 4,831
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,831
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.

Re: /setlayer sets 0 if not using a number. [Re: Khaled] #267763 18/09/20 11:49 PM
Joined: Jan 2004
Posts: 1,410
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,410
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.

Re: /setlayer sets 0 if not using a number. [Re: Khaled] #267796 29/09/20 07:04 PM
Joined: Feb 2011
Posts: 366
K
KindOne Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 366
Quote
15.Changed /setlayer to report an error if invalid parameters are
used.


Thank you. smile


irc.swiftirc.net #msl (mIRC Scripting Language)