[available] Feature request - new events

Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

[available] Feature request - new events

Post by Wyd »

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

naftali
Posts: 138
Joined: Wed Jan 20, 2010 8:42 pm

Re: Feature request - new events

Post by naftali »

I like this. Although there are often other events raised when you connect to a MUD (CharName for example, in IRE games)

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Feature request - new events

Post by Vadi »

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)

Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

Re: Feature request - new events

Post by Wyd »

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).

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Feature request - new events

Post by tsuujin »

Wyd 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).
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 Java

Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

Re: Feature request - new events

Post by Wyd »

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.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Feature request - new events

Post by tsuujin »

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.
Does the simple logger have a method of logging manually input lines?

Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

Re: Feature request - new events

Post by Wyd »

tsuujin wrote: Does the simple logger have a method of logging manually input lines?
Well, the main Log() function simply takes in a line and outputs it to a file, so yes

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Feature request - new events

Post by tsuujin »

Wyd wrote:
tsuujin wrote: Does the simple logger have a method of logging manually input lines?
Well, the main Log() function simply takes in a line and outputs it to a file, so yes
You can override the send function to assert everything with a failsafe, and write that failsafe to the file.

Wyd
Posts: 54
Joined: Wed Mar 24, 2010 11:56 pm

Re: Feature request - new events

Post by Wyd »

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

Post Reply