Page 1 of 1

TIP: title your scripts - easier debugging

Posted: Thu Jun 12, 2014 11:10 pm
by Caled
Just a little tip, because in all the scripts I've used from other people, I don't think I have ever seen anyone do this:

To help with debugging in Mudlet, when you create a new script object, make the first line a comment with a title, either the function name, or a name for a group of functions if there are multiple:

-- timer-backbone
namespace = namespace or {}
function namespace.startTimer(s)
end
function namespace.etcTimer()
end

In this way, the debug window output will use your comment as the script title (it chooses the first line, which is often just something like "namespace = namespace or {}" and doesn't help at all in figuring out WHICH script has a bug on line 52

Re: TIP: title your scripts - easier debugging

Posted: Fri Jun 13, 2014 6:08 am
by Vadi
Yep, this helps tons.