Module:GetRandomCreature: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 85: Line 85:


return b
return b
end
function p.a(seed)
  math.randomseed(seed)
  local count = cargo.query('Characters=C, GeneralData=GD', 'COUNT(C._pageName)=Number', {join='C._pageName=GD._pageName', where='C._pageNamespace="0" AND GD.Categories <> "Walls"'})[1]['Number']
  --local offsetin = math.random(0 , tonumber(count))
  local tables = 'Characters=C, GeneralData=GD'
  local fields = 'GD.PlainName=Name'
  local args ={join='C._pageName=GD._pageName', where='GD._pageNamespace="0" AND GD.Categories <> "Walls"', offset=offsetin,limit = 1}
  local result = cargo.query(tables, fields, args)
  if not next(result) then
    error('?????')
  end
  return result[1]['Name']
end
function p.getRandomChara(frame)
  return p.a(frame.args.seed)
end
end


return p
return p

Navigation menu