17,101
edits
m (1.0 testing: Constants) |
mNo edit summary |
||
Line 1: | Line 1: | ||
-- Version: | -- Version: PUBLIC BETA V1.0 (?1274) | ||
--[[Generated from the console via | --[[Generated from the console via | ||
var | (function() { | ||
var getGameVersion = function() { | |||
var elemNavHeader = document.getElementsByClassName("nav-main-heading") | |||
if (elemNavHeader.length > 0) { | |||
var verElem = Array.from(elemNavHeader).filter((i, idx) => i.innerText.toLowerCase().startsWith(gameVersion.toLowerCase()))[0] | |||
if (verElem !== undefined) { | |||
return verElem.innerText | |||
} | |||
} | |||
return gameVersion | |||
} | |||
var | var fullText = "-- Version: " + getGameVersion() | ||
txt = JSON.stringify( | var txt = JSON.stringify(CONSTANTS) | ||
txt = txt.replace(/\'/g, "\\\'") | txt = txt.replace(/\'/g, "\\\'") | ||
txt = txt.replace(/\\\"/g, "\\\\\"") | txt = txt.replace(/\\\"/g, "\\\\\"") | ||
fullText + | fullText = fullText + "\r\n\r\nlocal Constants = mw.text.jsonDecode('" + txt + "')" | ||
var wikiSlayerItems = new Set() | |||
txt = txt.replace(/\'/g, "\\\'") | SHOP.Slayer.filter((i) => i.contains.items !== undefined && i.contains.items.length == 1).forEach((i) => wikiSlayerItems.add(i.contains.items[0][0])) | ||
txt = txt.replace(/\\\"/g, "\\\\\"") | txt = JSON.stringify(Array.from(wikiSlayerItems)) | ||
fullText += "\r\n\r\nConstants. | txt = txt.replace(/\'/g, "\\\'") | ||
txt = txt.replace(/\\\"/g, "\\\\\"") | |||
fullText += "\r\n\r\nConstants.Shop = {}\r\nConstants.Shop.SlayerItems = mw.text.jsonDecode('" + txt + "')" | |||
fullText += "\r\n\r\nreturn Constants" | txt = JSON.stringify(SHOP.Slayer.filter((i) => i.name.includes('Resupply'))) | ||
console.log(fullText) | txt = txt.replace(/\'/g, "\\\'") | ||
txt = txt.replace(/\\\"/g, "\\\\\"") | |||
fullText += "\r\n\r\nConstants.Shop.Packs = mw.text.jsonDecode('" + txt + "')" | |||
txt = JSON.stringify(Object.values(SlayerTask.data).sort(function(a, b) { return a.minLevel - b.minLevel; })) | |||
txt = txt.replace(/\'/g, "\\\'") | |||
txt = txt.replace(/\\\"/g, "\\\\\"") | |||
fullText += "\r\n\r\nConstants.Slayer = {}\r\nConstants.Slayer.Tiers = mw.text.jsonDecode('" + txt + "')" | |||
fullText += "\r\n\r\nreturn Constants" | |||
console.log(fullText) | |||
})() | |||
--]] | --]] | ||
local | |||
Constants.Shop = {} | Constants.Shop = {} |