Editing Module:Infobox Item

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 123: Line 123:
 
end
 
end
 
return icon(item['name'], url, word)
 
return icon(item['name'], url, word)
end
 
 
local function locationImage(id, word)
 
local loc = p.loadData("location")[tostring(id)]
 
local url = ""
 
if loc['locationImage'] then
 
url = loc['locationImage']
 
else
 
return "[[" .. loc['name'] .. "]]"
 
end
 
return icon(loc['name'], url, word)
 
 
end
 
end
  
Line 148: Line 137:
 
local function addSeparator(num)
 
local function addSeparator(num)
 
return tostring(tonumber(num)):reverse():gsub("(%d%d%d)","%1,"):gsub(",(%-?)$","%1"):reverse()
 
return tostring(tonumber(num)):reverse():gsub("(%d%d%d)","%1,"):gsub(",(%-?)$","%1"):reverse()
end
 
 
local function gatheringSource(id)
 
local s = ""
 
for key, loc in pairs(p.loadData('location')) do
 
if loc['loot'] then
 
for key2, loot in pairs(loc['loot']) do
 
if id == loot['id'] then
 
s = s .. locationImage(loc['locID'], true)
 
s = s .. "<br>"
 
end
 
end
 
end
 
end
 
return s
 
 
end
 
end
  
Line 217: Line 191:
 
end
 
end
  
 +
local function gatheringSource(id)
 +
local s = ""
 +
for key, loc in pairs(p.loadData('location')) do
 +
if loc['loot'] then
 +
for key2, loot in pairs(loc['loot']) do
 +
if id == loot['id'] then
 +
s = s .. "[[" .. loc['name'] .. "]]"
 +
s = s .. "<br>"
 +
end
 +
end
 +
end
 +
end
 +
return s
 +
end
  
 
local function craftingSource(id)
 
local function craftingSource(id)
Line 464: Line 452:
 
end
 
end
 
s = s:sub(1,s:len()-4)
 
s = s:sub(1,s:len()-4)
args[sl()] = "Aug Bonus"
+
args[l()] = "Aug Bonus"
args[sd()] = s
+
args[d()] = s
 
 
 
s = ""
 
s = ""
Line 473: Line 461:
 
end
 
end
 
s = s:sub(1,s:len()-4)
 
s = s:sub(1,s:len()-4)
args[sl()] = "Aug Cost"
+
args[l()] = "Aug Cost"
args[sd()] = s
+
args[d()] = s
 
end
 
end
 
 
Line 521: Line 509:
 
args[d()] = farming['requiredLevel']
 
args[d()] = farming['requiredLevel']
 
args[l()] = "Experience"
 
args[l()] = "Experience"
args[d()] = addSeparator(farming['experience'])
+
args[d()] = farming['experience']
 
args[l()] = "Plot Size"
 
args[l()] = "Plot Size"
 
args[d()] = farming['height'] .. "x" .. farming['width']
 
args[d()] = farming['height'] .. "x" .. farming['width']

Please note that all contributions to Idlescape Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see IdleScape Wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Template used on this page: