Home
Random
Log in
Settings
About the Deadlock Wiki
Search
Editing
Module
:
ItemData/name
Give feedback
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Anti-spam check. Do
not
fill this in!
local p = {} local items_data = mw.loadJsonData("Data:ItemData.json") -- {{#invoke:Sandbox|get_item_key|item name}} function p.get_item_key(frame) local item_name_input = frame.args[1] -- Get the item name from the template argument if not item_name_input then return "Error: Item name not specified." end item_name_input = item_name_input:lower() -- For case-independent search -- Go through all the items and look for a name match. for item_key, item_data in pairs(items_data) do if item_data and item_data["Name"] then local current_item_name = item_data["Name"]:lower() if current_item_name == item_name_input then return item_key -- Return the key if the name matches end end end return "Item not found." -- If nothing is found end return p
Summary:
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Pages included on this page:
Module:ItemData/name
(
edit
)
Module:ItemData/name/doc
(
edit
)
Data:ItemData.json
(
view source
) (⧼restriction-level-bot+⧽)