mIRC Homepage
Posted By: Scripto Error Messages? - 31/12/06 06:06 PM
There are some messages that mIRC sends when an event from say a remote error takes place. Events such as trying to open a dialog (my mp3 player: /dialog -m mymp3 mymp3) that is already open would return this:

* /dialog: 'mymp3' name in use

Or there are always the code error messages:

* /if: insufficient parameters (line 7, Input)

Here is my question... I have everything in my mIRC scripted differently than default, so that joins, parts, quits, kicks, raws, etc... all return color coded display text of my preference. The beauty of mIRC is to be able to do this with most of the events, is there any way to alter the looks these types of error messages before they are returned, so that I can have them match the rest of my script events?

Like an: on */ "if" error message: echo -a [colorcode] whatever i want it to look like goes here?

Its kind of hard to ask this in a forum, ha, I cant find anything relating to this in the editor, so im not sure if its a question or a suggestion for improvement. I have had alot of friends ask me about this, so i thought i would come here and ask for some friendly feedback for all of us on the network grin

Thanks in advance,

Scripto

Posted By: RusselB Re: Error Messages? - 31/12/06 07:47 PM
I think what you're looking for is the ON ERROR event.

/help on error
Posted By: starbucks_mafia Re: Error Messages? - 31/12/06 08:11 PM
The on ERROR event is for capturing error messages sent by the server, it has nothing to do with errors in mIRC scripts.

There currently isn't any way to generically catch all mIRC scripting errors or otherwise change their appearance. Then again the errors that the OP has posted aren't ones that should ever be seen by the end-user of a script. Scripters should always check if ($dialog(dialogname)) before creating them and any syntax errors like the if one should, of course, be corrected.

For any other kind of errors that the scripter doesn't intend to fix unfortunately the only way to catch them currently is using the :error mechanism (see /help Error handling in mIRC).
Posted By: Riamus2 Re: Error Messages? - 01/01/07 12:58 AM
Originally Posted By: starbucks_mafia
Then again the errors that the OP has posted aren't ones that should ever be seen by the end-user of a script.


True, but I think he's referring to theming mIRC. He wants it so that if someone is uses his themed mIRC and another script or command outputs an error like that, it will display it with the appropriate theme (colors/formatting) instead of the default way.
Posted By: Scripto Re: Error Messages? - 01/01/07 02:45 AM
Yes, Riamus2, i am looking for someway to code the default mIRC error messages called upon from a failure through a remote script. I listed a couple that I run into from time to time, such as trying to access a dialog that is currently open will return this message:

* /dialog: 'mymp3' name in use


There are many error messages or error events that can trigger a default echo message from mIRC as I posted above:

* /if: insufficient parameters (line 7, Input)

This is a default error message if a user writes a script and forgets a parameter, or missing ()'s or something. There are others, I have gotten them with incorrectly formatted /timer statements ranging through improper calls of custom aliases. Through my years of learning I have discovered these messages (dont we all? crazy) but never knew of a way to re-code their looks to match the theme of my script.

mIRC generally responds with this echo'd error message begining with an asterisk followed by the result of what error is being called.

I wanted to know if there is a way to change the format of these messages so that I can make the echo statment to match the theme I use on the rest of the events, with like say, a time, followed by the fancy little color scheme of my choice etc. etc.

Thanks for responding,

And as a courtesy to anyone, i will help anyone I can with extreme patience. I am an advanced user, but please reserve my help to forums.

I absolutely enjoy scripting

Thanks in advance for the input grin

Scripto
Posted By: Om3n Re: Error Messages? - 02/01/07 01:03 PM
From a help/support point of view, i think allowing mircs internal default error messages to be changed (even halted completely) would make helping others with problems significantly more difficult.
Posted By: cold Re: Error Messages? - 02/01/07 03:07 PM
What about having an errors window? An window where all error messages are allocated, with more detailed information, such as the calling aliases/events/timers/whatever related to the error.

With something like that, any script could simply hide it (eliminating the need to theme the error messages). Any user could then enter a command (like /errors or so) to visualize it when needed.
Posted By: Mpdreamz Re: Error Messages? - 02/01/07 04:33 PM
I like it ! smile
Posted By: Riamus2 Re: Error Messages? - 02/01/07 11:05 PM
That would be useful. Especially just having more detailed information.
Posted By: Om3n Re: Error Messages? - 04/01/07 12:16 PM
An optional errors mdi somewhere sounds like a nice idea to me, in such a case an option like 'show errors in...' with dropdown 'Status or Active (or whatever it does now) only', 'error window only', 'both' or something to that extent should come with it.

My personal opinion is simply that there should not be a scriptable way to disable/change mirc internal error messages. Changing where they are shown is perfectly reasonable. If such a feature is implemented, i wouldn't see a problem with being able to capture (if it cant already be done) the messages to display them how you like, so long as they are still displayed in the unaltered form in the specified location (hidden mdi that open with /errors for example).
Posted By: cold Re: Error Messages? - 04/01/07 01:10 PM
Originally Posted By: Om3n
My personal opinion is simply that there should not be a scriptable way to disable/change mirc internal error messages. Changing where they are shown is perfectly reasonable. If such a feature is implemented, i wouldn't see a problem with being able to capture (if it cant already be done) the messages to display them how you like, so long as they are still displayed in the unaltered form in the specified location (hidden mdi that open with /errors for example).


Yeah, I agree completely. That's what I thought about: guaranteeing the existence and precedence of mIRC's own error messages display, without sacrificing a scripter's will to theme mIRC. And, of course, having the error messages in a separate window opens room for more detailed information.

Nice addition of yours... having an option like the "show errors in..." you explained would be definitely welcome.
Posted By: Scripto Re: Error Messages? - 04/01/07 05:21 PM
I had a vision once of being able to not only change the theme, but by having access to said errors, or default messages, I could code notes reminding myself upon seeing a particular message, a list of possible "fixes", like I forgot to close a comparison in an "if" statement, or something along those lines.

An overview being, every scripter has his own shortcomings.

There are many default messages, both error and informational, that would be helpful to make 'self' key notes upon, for future reference.

I dont think I had a strand of hair left in my head the very first year I was interested in script writing. Not only did I have to self teach the structure of the language, but also interpret where and how I made errors, through the default messaging.

I became efficiant after time, and then quit writing for a year or two, only to walk back into a wall I had already climbed. Some notes passed onto me, pre-scripted, themed, and advanced to my understandings from my trial and error years would have been a wonderful re-discovery, to pick up and move forward with.

In turn, being the idea behind this thread smile Great ideas guys grin
Posted By: Scripto Re: Error Messages? - 04/01/07 05:43 PM
Or maybe instead of actual error messages, have it be an error number instead, that resorts to an additional mIRC help index.

And you could use that number to trigger on your own code /and or help.files.txt

Think of the possibilities whistle
© mIRC Discussion Forums