Module:String: Difference between revisions
From Ashenzari's Archive
More actions
imported>CommanderC No edit summary |
imported>CommanderC No edit summary |
||
| Line 18: | Line 18: | ||
function p.fix_monster_size(frame) | function p.fix_monster_size(frame) | ||
local text = frame.args[1] | local text = frame.args[1] | ||
found, _, token = string.find(text, "|([^% | found, _, token = string.find(text, "|([^%]]+)%]") | ||
if found then | if found then | ||
return token | return token | ||
Revision as of 16:34, 29 November 2013
local p = {}
function p.first_word(frame)
local text = frame.args[1] for token in string.gmatch(text, "[^%s]+") do return token end
end
function p.fix_magic_resistance(frame)
local text = frame.args[1] if text == "Immune" or text == "immune" then return "1000" end return text
end
function p.fix_monster_size(frame)
local text = frame.args[1] found, _, token = string.find(text, "|([^%]]+)%]") if found then return token end return text
end
function p.fix_monster_intelligence(frame)
return p.fix_monster_size(frame)
end
return p