I'd like to request a few more default events:
onConnect - called when mudlet successfully connects to a mud
onDisconnect - called when mudlet is disconnected from a mud
onSave - called when the profile is saved
onClose - called just before the profile is closed
Wyd
[available] Feature request - new events
Re: Feature request - new events
I like this. Although there are often other events raised when you connect to a MUD (CharName for example, in IRE games)
Re: Feature request - new events
I'd like to add an:
onSend - called whenever a command is sent to the MUD - either via alias or send() function. (overwriting these is problematic, both in their different ways)
onSend - called whenever a command is sent to the MUD - either via alias or send() function. (overwriting these is problematic, both in their different ways)
Re: Feature request - new events
Another one I'd like is a onError event, which sends the error as a argument
That way, its possible to log out the error somewhere, if for some reason you're not able to check the debug window at the time the error occurs (in the middle of a fight, or something).
That way, its possible to log out the error somewhere, if for some reason you're not able to check the debug window at the time the error occurs (in the middle of a fight, or something).
Re: Feature request - new events
Well, I pass most of what I need to do through an assert function, which takes an option to return a string on a failure. It's kind of like try...catch in JavaWyd wrote:Another one I'd like is a onError event, which sends the error as a argument
That way, its possible to log out the error somewhere, if for some reason you're not able to check the debug window at the time the error occurs (in the middle of a fight, or something).
Re: Feature request - new events
True,
What I'm hoping to do those is having a nice easy way to log stuff going wrong out into a file, so I can look over and fix it up later (because there are times when you can't fix a error just as it happens - for example, while fighting).
Being able to have a single function that gets called on the onError event, and then log out the error, and the lines before it, would mean that you could just look over the log afterwards to make sure nothing weird happened, or if it did, to fix it up.
What I'm hoping to do those is having a nice easy way to log stuff going wrong out into a file, so I can look over and fix it up later (because there are times when you can't fix a error just as it happens - for example, while fighting).
Being able to have a single function that gets called on the onError event, and then log out the error, and the lines before it, would mean that you could just look over the log afterwards to make sure nothing weird happened, or if it did, to fix it up.
Re: Feature request - new events
Does the simple logger have a method of logging manually input lines?Wyd wrote:True,
What I'm hoping to do those is having a nice easy way to log stuff going wrong out into a file, so I can look over and fix it up later (because there are times when you can't fix a error just as it happens - for example, while fighting).
Being able to have a single function that gets called on the onError event, and then log out the error, and the lines before it, would mean that you could just look over the log afterwards to make sure nothing weird happened, or if it did, to fix it up.
Re: Feature request - new events
Well, the main Log() function simply takes in a line and outputs it to a file, so yestsuujin wrote: Does the simple logger have a method of logging manually input lines?
Re: Feature request - new events
You can override the send function to assert everything with a failsafe, and write that failsafe to the file.Wyd wrote:Well, the main Log() function simply takes in a line and outputs it to a file, so yestsuujin wrote: Does the simple logger have a method of logging manually input lines?
Re: Feature request - new events
Right,
But not all errors occur on send, and it would be nice to have a callback for when a error occurs, instead of manually wrapping every bit of code in asserts
But not all errors occur on send, and it would be nice to have a callback for when a error occurs, instead of manually wrapping every bit of code in asserts