mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2011
Posts: 448
K
KindOne Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 448
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

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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.

Joined: Feb 2011
Posts: 448
K
KindOne Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 448
Quote
15.Changed /setlayer to report an error if invalid parameters are
used.


Thank you. smile


Link Copied to Clipboard