Mudlet features and API requests

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Mudlet API requests

Post by Yetzederixx »

Actually no. When I click and drag it they either:
1: end up in a folder I don't want them in
2: drop to the bottom where I don't want them either
3: ends up a child-trigger/alias/etc

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

Re: Mudlet API requests

Post by Vadi »

You don't drag it into, you drag it between them.

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

Re: Mudlet API requests

Post by Vadi »

Widjet wrote:Okay, probably dreaming with this one, but would it be possible to have events for mouse movements or at least mouse entering/exiting specified areas?
I can imagine something like:
Code: [show] | [select all] lua
addMouseEntryListener({x = 30, y = 30, width = 100, height = 100}, "highlightMyButton()")
addMouseExitListener({x = 30, y = 30, width = 100, height = 100}, "dimMyButton()")
Started on this. Several ways to go about implementing this...

Either a) use event tracking on the whole main window and report every movement as a Lua event + have a framework in Lua that calculates whenever it was in any of those bounds
b) same, but do the calculations in Mudlet and only raise events then
c) use per-label tracking and only report mouse movements as events then

I'm not sure how efficient is the event system for this, but initially I'll go with option 3 - since it somewhat covers the selection part for you already. Further discussion on this should be branched off into a topic of it's own, I suppose.

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

Re: Mudlet API requests

Post by Vadi »

Added a sysWindowMouseMoveEvent event that has the label name as the argument. Fires whenever the mouse is moving over labels. If you can compile code, it'd be great if you could test this - my branch is currently at https://github.com/vadi2/Mudlet

Widjet
Posts: 30
Joined: Thu Apr 22, 2010 1:43 am

Re: Mudlet API requests

Post by Widjet »

I will when I get a chance, I'm a bit busy until after the Easter weekend, though.

mudlettest
Posts: 9
Joined: Tue Nov 02, 2010 12:34 pm

Re: Mudlet API requests

Post by mudlettest »

Would be nice if feedTriggers function would have parameter, that simulated line is not added to main window at all.

Currently, i was trying to re-use all triggers for parsing log file of mud sessions to collect some statistics. Log files can be big, millions of lines. I don't want those line to be visible in main window nor in log files, so gagging them is not an option. Also, i experience crashes when so many lines are fed. And i don't know how safe is such feeding in terms of that at this same time other lines can come from mud, and i don't want them to interfere with current log's parsing.

Currently i have to resort to duplicate triggers i want manually in code, parsing log files line by line and matching against those patterns i want and calling appropriate functions (which is actually more or less what mudlet itself does). This solution is very fast and works ok, but not elegant because of this duplicating.

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

Re: Mudlet API requests

Post by Vadi »

You could open a second instance of Mudlet, not connect it, and parse it then?

mudlettest
Posts: 9
Joined: Tue Nov 02, 2010 12:34 pm

Re: Mudlet API requests

Post by mudlettest »

True, that is another possibility, seems to work good enough at first glance.

Widjet
Posts: 30
Joined: Thu Apr 22, 2010 1:43 am

Re: Mudlet API requests

Post by Widjet »

Vadi wrote:Added a sysWindowMouseMoveEvent event that has the label name as the argument. Fires whenever the mouse is moving over labels. If you can compile code, it'd be great if you could test this - my branch is currently at https://github.com/vadi2/Mudlet
Okay, I've had a chance to test this.

It doesn't work, because the TLabel's mpHost variable is always null, because TLabel's setScript function is never called (so far as I can tell). I'm not sure where setScript should be called, perhaps in createLabel?

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

Re: Mudlet API requests

Post by Vadi »

Er... Worked in my testing. I'll give it check on a new checkout.

Post Reply