mudlet-makers team mailing list archive
-
mudlet-makers team
-
Mailing list archive
-
Message #00128
[Bug 298877] Re: Add replaceWildcard to LuaGlobal.lua
** Changed in: mudlet
Status: Fix Committed => Fix Released
--
Add replaceWildcard to LuaGlobal.lua
https://bugs.launchpad.net/bugs/298877
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
Status in Mudlet the MUD client: Fix Released
Bug description:
Please add this convenience function to the LuaGlobal.lua:
-- Replaces the given wildcard (as a number) with the given text.
-- Example: replaceWildcard(1, "hello") on a trigger of `^You wave (goodbye)\.$`
function replaceWildcard(what, replacement)
if replacement == nil or what == nil then return end
selectCaptureGroup(what)
replace(replacement)
end