Search found 34 matches

by fordpinto
Fri Mar 13, 2020 9:56 pm
Forum: Scripts & Packages
Topic: Enhanced OO wrapper for Mudlet Trigger, Timer, Event and Stopwatch objects
Replies: 6
Views: 5908

Re: Enhanced OO wrapper for Mudlet Trigger, Timer, Event and Stopwatch objects

Added Event object: -- creating Event definition eventDef = { name = "My special event", eventLabel = "Handler object for my special event", -- this is ignored by the lean version, -- and can be omitted in full version (taken as "") code = function() echo("My speci...
by fordpinto
Fri Mar 13, 2020 9:42 pm
Forum: Scripts & Packages
Topic: Enhanced OO wrapper for Mudlet Trigger, Timer, Event and Stopwatch objects
Replies: 6
Views: 5908

Re: Enhanced OO wrapper for Mudlet Trigger, Timer, Event and Stopwatch objects

I realized that I needed Event objects as well, so added it. Added Stopwatch for good measure, but not all of Mudlet API fits within the OO object structure (more comments in a second). Also improved on some logic details (a bit more assert()). Included both the debug and the lean version. Lean vers...
by fordpinto
Fri Mar 13, 2020 8:41 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: Fastest Trigger Types
Replies: 18
Views: 20042

Re: Fastest Trigger Types

This was touched upon in another thread, which is why I ended up here. My first reaction to the suggestion that start of line/exact match is faster than regex was "Yeah, makes sense". But I am now wondering it's a bit more nuanced than that. Some second thoughts: 1) The basic algorithmic s...
by fordpinto
Thu Mar 12, 2020 11:18 pm
Forum: Scripts & Packages
Topic: Enhanced OO wrapper for Mudlet Trigger, Timer, Event and Stopwatch objects
Replies: 6
Views: 5908

Enhanced OO wrapper for Mudlet Trigger, Timer, Event and Stopwatch objects

I find object-oriented syntax to be oftentimes more readable, but the reason I ended up making this package is much more practical. When creating "temporary", i.e. dynamic Mudlet triggers and timers I found it very annoying that they keep hanging around even when I do not need them. I was ...
by fordpinto
Thu Mar 12, 2020 9:30 pm
Forum: Help Forum
Topic: Package and module interdependence best practices
Replies: 24
Views: 13596

Re: Package and module interdependence best practices

@demonnic Appreciate you sharing your thoughts on this. I am not discouraged in the least that this apparently was already discussed many times. I am not trying to drive Mudlet into certain direction. Presently, I can code anything I like as a require() library, and use it just fine, since I am not ...
by fordpinto
Tue Mar 10, 2020 5:43 pm
Forum: Help Forum
Topic: Package and module interdependence best practices
Replies: 24
Views: 13596

Re: Package and module interdependence best practices

.mpackage/.xml vs require() As I mentioned earlier, currently require() makes more sense to me as means for inclusion of the shared code. I do not think it's a radical notion, since require() was put in place by Lua developers specifically for code sharing and library creation. I am listing some ad...
by fordpinto
Mon Mar 09, 2020 6:56 pm
Forum: Help Forum
Topic: Package and module interdependence best practices
Replies: 24
Views: 13596

Re: Package and module interdependence best practices

> Deletion is necessary if the file is conflicting with another one, for example - or if the package was uninstalled. In case of de-installation of a package that uses a shared library, I think it's fine to leave shared library in place by default. I do not see a problem with that. Not sure what you...
by fordpinto
Mon Mar 09, 2020 5:51 pm
Forum: Help Forum
Topic: Package and module interdependence best practices
Replies: 24
Views: 13596

Re: Package and module interdependence best practices

>> Otherwise we could have been piggybacking off luarocks repository to distribute Mudlet shared code. >I don't think so - have you tried to install LuaRocks on Windows? You got me, I have no idea how easy/hard it is to use luarocks under Windows. Sounds like it's a pain. >> For Lua files it would m...
by fordpinto
Mon Mar 09, 2020 12:10 am
Forum: Help Forum
Topic: Package and module interdependence best practices
Replies: 24
Views: 13596

Re: Package and module interdependence best practices

For sure, one can use require(). Just the other day I have installed a shared Lua library using luarocks, and there was zero problem using that library from within Mudlet using require(). That wasn't Mudlet specific code, just a general use library from luarocks. However, it doesn't seem like the be...
by fordpinto
Sat Mar 07, 2020 8:12 pm
Forum: Help Forum
Topic: Package and module interdependence best practices
Replies: 24
Views: 13596

Re: Package and module interdependence best practices

I thought some more about this, and I am somewhat amused that I realize this quite late into this discussion, that the things that make me unsure about using Mudlet module feature and Lua require feature are pretty much the same. It's the lack of convention on the location for these common library c...