Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Sandbox/Soreness

From Growtopia Wiki
Revision as of 12:07, 27 April 2022 by Sorenesss (talk | contribs)

Documentation for this module may be created at Module:Sandbox/Soreness/doc

local p = {}

local md5 = require('Module:Md5')

local s = {{}}

local function getItemData(hash)
    local a = mw.loadData('Module:Item/Data')
    return a[hash] or {-1, -1}
end

local function addToSet(set, key)
    set[key] = true
end

local function removeFromSet(set, key)
    set[key] = nil
end

local function setContains(set, key)
    return set[key] ~= nil
end

function p.addtoList(name)
	local d = getItemData(md5.md5(name))
	if not setConatains(s, d[3]) then
		table.insert(s[d[3]],"'''Rarity "..i..":'''<br>")
	end
	table.insert(s[d[3]],"[["..name.."]]")
end

function p.ListRaritys(name)
	return table.concat(s)
end

return p