My latest plug-in at Metaplace, Moderators, provides a scripting interface to let you discover, from script, if a user is one of the Metaplace-appointed moderators, or not.
Note: this detects only those moderators appointed globally by Metaplace, not any individual world's moderation arrangements.
Usage of the plug-in is simple. After installing the plug-in, simply IncludeScript the contained script, ark_moderators, into the script you are writing, as follows:
Define Properties()
IncludeScript (‘214539:188’)
end
Having done so, you gain access to the following three functions:
ath_get_moderator_list ()
This function returns a Lua table containing the Metaplace user names of all currently appointed moderators.
ath_is_a_moderator (user)
ath_is_a_moderator_byname (user_name)
These functions return a pseudo-Boolean value (1 == true, 0 == false) indicating whether the specified user is a moderator or not. The former function takes a user object; the latter the user name as a string.
As there isn’t currently a programmatic way of detecting moderators, yes, this script currently operates using a hard-coded list of moderator names. What you’re paying the 250 coins for isn’t this relatively simple functionality; it’s for me keeping the list updated and ultimately converting it over to use the MP API when we get one. In addition, because of this, this script is marked as closed-source/uneditable to assure trustworthiness.
