forked from Mudlet/Mudlet
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: isActiveID(...) and existsID(...) functions
This PR is an alternative/replacement for Mudlet#6401 that provides the functionality with a *new* function rather than overloading the existing `isActive(name as string, type as string)`. This is at the request of @Kebap who expressed a strong desire for this alternative approach to establishing the status of a Mudlet item by ID number rather than by name. As temporary items do not *have* names but they do possess a unique ID this will also work for them whereas the unmodified `isActive(...)` function can not. Unlike the `isActive(...)` function there can only be a single item that matches the ID so the return value is a boolean value rather than an integer count (of matching items that are active). Whilst developing the `isActiveID(...)` function I spotted that there was potentially a need for the related `existsID(...)` in the same way that there is an `exists(name, type)` alongside the `active(name, type)` function. Like the `isActiveID(...)`function compared to the `isActive(...)` the `existsID(...)` too only relates to a single item so also returns a boolean result. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
- Loading branch information
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters