Module:Get drop info

-- local p = {} local Galars = require('Dev:Galars') function p.main(frame) -- This template is fairly expensive to use, so it should be limited mw.incrementExpensiveFunctionCount local args = frame:getParent.args local monster = string.gsub(args['?monster'] or args.monster or ,'[][]',) monster = mw.text.decode(monster) local drop = string.lower(args.userparam or args.drop or '') drop = mw.text.decode(drop) -- escape lua characters local _drop = drop:gsub('([%^%$%(%)%%%.%[%]%*%+%-%?])','%%%1') local smwdata = frame:preprocess('				]]) smwdata = mw.text.decode(tostring(smwdata)) local _found = false local json, cmb = unpack( mw.text.split(smwdata,'%(&&SPLITPOINT&&') )	local json_good	json_good, json = pcall(JSONS.decode,string.format('[ %s ]',json))	if not json_good then		return ''	end	cmb = string.format( '(%s',cmb or '?' ) local ret = {} for _, v in pairs(json) do		if drop == string.lower(v.name) then table.insert(ret,v) _found = true end end if not _found then return '' end local combat = mw.ustring.match(cmb:lower,'%(combat level: (.-)%)') or 'N/A' combat = mw.ustring.gsub(combat,'(%d),(%d%d%d)','%1%2') local retString = {} for _, v in pairs(ret) do		local _min,_max = v.quantity[1],v.quantity[2] local quantity if tonumber(_min) == tonumber(_max) then quantity = _min else quantity = string.format('%s-%s',_min,_max) end table.insert(retString,				string.format('', monster, combat, quantity, v.rarity)			) end return frame:preprocess(table.concat(retString,'\n')) end return p