aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNinjune <enderknight537@gmail.com>2022-12-07 21:36:53 -0600
committerNinjune <enderknight537@gmail.com>2022-12-07 21:36:53 -0600
commit1ffc0a89be42fcde95a04a87cc00dbc347b27ece (patch)
tree87ef5251d1fc2a32d495daa8f6a94e173c701f8e
parent8ad19e54f6c3f44a84dd2565d910c207ffc5bc52 (diff)
downloadcoleweight-1ffc0a89be42fcde95a04a87cc00dbc347b27ece.tar.gz
coleweight-1ffc0a89be42fcde95a04a87cc00dbc347b27ece.tar.bz2
coleweight-1ffc0a89be42fcde95a04a87cc00dbc347b27ece.zip
v1.7.0v1.7.0
-rw-r--r--chat/grieferTrack.js2
-rw-r--r--commandManager.js105
-rw-r--r--commands/calculate/calcSpeed.js47
-rw-r--r--commands/calculate/calculate.js36
-rw-r--r--commands/calculate/hotmCalc.js55
-rw-r--r--commands/calculate/tick.js (renamed from commands/tick.js)10
-rw-r--r--commands/credits.js7
-rw-r--r--commands/help.js10
-rw-r--r--commands/spiral.js2
-rw-r--r--commands/throne.js2
-rw-r--r--data/collections.json87
-rw-r--r--data/hotm.json151
-rw-r--r--index.js1
-rw-r--r--metadata.json2
-rw-r--r--render/collectionGui.js64
-rw-r--r--render/cwGui.js2
-rw-r--r--render/downtimeGui.js14
-rw-r--r--render/gemstoneMiningStats.js66
-rw-r--r--render/tabList.js39
-rw-r--r--settings.js56
-rw-r--r--util/constants.js15
-rw-r--r--util/helperFunctions.js231
22 files changed, 894 insertions, 110 deletions
diff --git a/chat/grieferTrack.js b/chat/grieferTrack.js
index 5ac186f..f4ae0e4 100644
--- a/chat/grieferTrack.js
+++ b/chat/grieferTrack.js
@@ -58,4 +58,6 @@ register("gameLoad", () => {
ChatLib.chat(err)
})
})
+
+
export default "" \ No newline at end of file
diff --git a/commandManager.js b/commandManager.js
index 62623f8..c6c3e55 100644
--- a/commandManager.js
+++ b/commandManager.js
@@ -2,7 +2,8 @@ import { openTimerGui } from "./render/timerGui.js"
import { openPowderGui } from "./render/powertrackerGui"
import { openCoordsGui } from "./render/coordsGui.js"
import { openDowntimeGui } from "./render/downtimeGui.js"
-import { openCwGui, reload } from "./render/cwGui"
+import { openCwGui, reloadColeweight } from "./render/cwGui"
+import { openCollectionGui, reloadCollection, trackCollection } from "./render/collectionGui"
import { help } from "./commands/help"
import { setkey } from "./commands/setkey"
import { spiral } from "./commands/spiral"
@@ -13,27 +14,29 @@ import { update } from "./commands/update"
import { fetchDiscord } from "./commands/fetchDiscord"
import { findColeweight } from "./commands/findColeweight"
import { claim } from "./commands/claim"
-import { tick } from "./commands/tick"
import { time } from "./commands/time"
import { info } from "./commands/info"
+import { credits } from "./commands/credits"
import Settings from "./settings"
import constants from "./util/constants"
import { clearLobbies } from "./commands/markingLobbies"
import { divans } from "./commands/divans.js"
+import { calculate } from "./commands/calculate/calculate.js"
-register("command", (arg, arg2, arg3) => {
- if (arg == undefined) {findColeweight(arg); return}
- switch(arg.toLowerCase())
+register("command", (...args) => {
+ console.log(args[0])
+ if (args[0] == undefined) {findColeweight(args[0]); return}
+ switch(args[0].toString().toLowerCase())
{
case "setkey":
- setkey(arg2)
+ setkey(args[1])
break
case "help":
help()
break
case "move":
- if (arg2 == undefined) {ChatLib.chat(`${constants.PREFIX}&cNot enough arguments.`); return}
- switch(arg2.toLowerCase())
+ if (args[1] == undefined) {ChatLib.chat(`${constants.PREFIX}&cNot enough arguments.`); return}
+ switch(args[1].toLowerCase())
{
case "coleweight":
openCwGui()
@@ -48,21 +51,34 @@ register("command", (arg, arg2, arg3) => {
case "downtime":
openDowntimeGui()
break
+ case "collection":
+ openCollectionGui()
+ break
default:
ChatLib.chat(`${constants.PREFIX}&cNo such gui as '${arg2}'.`)
}
break
case "throne":
- throne(arg2)
+ throne(args[1])
break
case "spiral":
- spiral(arg2)
+ spiral(args[1])
break
case "reload":
- reload()
+ switch(args[1].toLowerCase())
+ {
+ case "coleweight":
+ reloadColeweight()
+ break
+ case "collection":
+ reloadCollection()
+ break
+ default:
+ ChatLib.chat(`${constants.PREFIX}&cNo such gui as '${args[1]}'.`)
+ }
break
case "leaderboard":
- leaderboard(arg2, arg3)
+ leaderboard(args[1], args[2])
break
case "update":
update()
@@ -72,14 +88,11 @@ register("command", (arg, arg2, arg3) => {
Settings.openGUI()
break
case "claim":
- claim(arg2)
+ claim(args[1])
break
case "powdertrackersync":
updateDisplay()
break
- case "tick":
- tick(arg2, arg3)
- break
case "time":
time()
break
@@ -90,37 +103,71 @@ register("command", (arg, arg2, arg3) => {
clearLobbies()
break
case "yog":
- yog(arg2)
+ yog(args[1])
break
case "divans":
case "divan":
- divans(arg2)
+ divans(args[1])
break
case "coord":
case "coords":
openCoordsGui()
break
+ case "credits":
+ credits()
+ break
+ case "track":
+ trackCollection(args[1])
+ break
+ case "calc":
+ case "calculate":
+ calculate(args.slice(1))
+ break
default:
- findColeweight(arg)
+ findColeweight(args[0])
}
}).setTabCompletions((args) => {
let output = [],
+ calculateOptions = ["tick", "ms2toprofessional", "hotmcalc", "calchotm"],
commands = ["setkey", "help", "move", "toggle", "throne", "spiral", "reload", "leaderboard",
- "settings", "claim", "tick", "time", "info", "clearlobbies", "yog", "divan", "coords"]
+ "settings", "claim", "time", "info", "clearlobbies", "yog", "divan", "coords", "credits", "track", "calculate"]
if(args[0].length == 0 || args[0] == undefined)
- output = commands
+ return output = commands
+
+ if(args[0] == "calc" || args[0] == "calculate")
+ {
+ if(args[1] == undefined) output = calculateOptions
+
+ else
+ {
+ calculateOptions.forEach(calculateOption => {
+ for(let char = 0; char < args[1].length; char++)
+ {
+ if(calculateOption[char] != args[1][char])
+ break
+ else if(char == args[1].length - 1)
+ output.push(calculateOption)
+ }
+ })
+ }
+ }
else
{
- for(let i = 0; i < commands.length; i++)
+
+ if(args[0] == undefined) output = commands
+
+ else
{
- for(let j = 0; j < args[0].length; j++)
- {
- if(commands[i][j] != args[0][j])
- break
- else if(j == args[0].length - 1)
- output.push(commands[i])
- }
+ commands.forEach(command => {
+ for(let char = 0; char < args[0].length; char++)
+ {
+ if(command[char] != args[0][char])
+ break
+ else if(char == args[0].length - 1)
+ output.push(command)
+ }
+ })
}
}
return output
diff --git a/commands/calculate/calcSpeed.js b/commands/calculate/calcSpeed.js
new file mode 100644
index 0000000..1b2eae6
--- /dev/null
+++ b/commands/calculate/calcSpeed.js
@@ -0,0 +1,47 @@
+import constants from "../../util/constants"
+import { parseNotatedInput } from "../../util/helperFunctions"
+const PREFIX = constants.PREFIX
+
+
+export function calcSpeed(powder)
+{
+ let speedLevels = 1,
+ professionalLevels = 1
+
+ if(powder == undefined || parseNotatedInput(powder) == "NI") return ChatLib.chat(constants.CALCULATEERRORMESSAGE)
+ powder = parseNotatedInput(powder)
+
+ while(powder > msPowder(speedLevels) + profPowder(professionalLevels))
+ {
+ if(ms2SpeedPerPowder(speedLevels + 1) > professionalSpeedPerPowder(professionalLevels + 1) && speedLevels < 50)
+ {
+ powder -= msPowder(speedLevels++)
+ }
+ else if (professionalLevels < 140)
+ {
+ powder -= profPowder(professionalLevels++)
+ }
+ else break
+ }
+ return ChatLib.chat(`&bGet &6&l${speedLevels} &bmining speed levels and &6&l${professionalLevels} &bprofessional levels.`)
+}
+
+function ms2SpeedPerPowder(miningSpeedLevel) // 40 speed per level
+{
+ return 40/msPowder(miningSpeedLevel)
+}
+
+function professionalSpeedPerPowder(professionalLevel) // 5 speed per level
+{
+ return 5/profPowder(professionalLevel)
+}
+
+function msPowder(miningSpeedLevel)
+{
+ return Math.floor(Math.pow(miningSpeedLevel+1, 3.2))
+}
+
+function profPowder(professionalLevel)
+{
+ return Math.floor(Math.pow(professionalLevel+1, 2.3))
+} \ No newline at end of file
diff --git a/commands/calculate/calculate.js b/commands/calculate/calculate.js
new file mode 100644
index 0000000..cc4a006
--- /dev/null
+++ b/commands/calculate/calculate.js
@@ -0,0 +1,36 @@
+import constants from "../../util/constants"
+import { hotmCalc } from "./hotmCalc"
+import { calcSpeed } from "./calcSpeed"
+import { tick } from "./tick"
+import { helpCommand } from "../help"
+const PREFIX = constants.PREFIX
+
+
+export function calculate(args)
+{
+ switch(args[0].toLowerCase())
+ {
+ case "hotm":
+ case "hotmcalc":
+ case "calchotm":
+ hotmCalc(args[1], args[2], args[3])
+ break
+ case "tick":
+ tick(args[1], args[2])
+ break
+ case "calcspeed":
+ case "speed":
+ calcSpeed(args[1])
+ break
+ case "help":
+ ChatLib.chat("&b--------------[ &a&l/cw calculate &b]--------------")
+ helpCommand("calculate tick", "Calculates tick data.", "(mining speed) (('r','jade', etc) || breaking power of block))")
+ helpCommand("calculate speed", "Calculates the ratio of mining speed 2 to professional with a certain amount of powder.", "(powder)")
+ helpCommand("calculate hotm", "Calculates powder between two levels of a certain perk.", "(perk) (minlevel) [maxlevel]")
+ ChatLib.chat("&b------------------------------------------")
+ return
+ default:
+ return ChatLib.chat(constants.CALCULATEERRORMESSAGE)
+ }
+}
+
diff --git a/commands/calculate/hotmCalc.js b/commands/calculate/hotmCalc.js
new file mode 100644
index 0000000..415e7f4
--- /dev/null
+++ b/commands/calculate/hotmCalc.js
@@ -0,0 +1,55 @@
+import constants from "../../util/constants"
+import { addCommas } from "../../util/helperFunctions"
+const PREFIX = constants.PREFIX
+
+
+export function hotmCalc(hotmName, minLevel, maxLevel)
+{
+ if(maxLevel == undefined)
+ {
+ maxLevel = minLevel
+ minLevel = 1
+ }
+
+ if(minLevel != parseInt(minLevel) || maxLevel != parseInt(maxLevel)) return ChatLib.chat(constants.CALCULATEERRORMESSAGE)
+
+ minLevel = parseInt(minLevel)
+ maxLevel = parseInt(maxLevel)
+ let hotmObjectToFind = findHotmObject(hotmName)
+ if(hotmObjectToFind == undefined) return ChatLib.chat(`${PREFIX}&cDid not find HOTM perk with name '${hotmName}'!`)
+
+ maxLevel = (maxLevel < hotmObjectToFind.maxLevel ? maxLevel : hotmObjectToFind.maxLevel)
+
+ let powderSum = findCost(hotmObjectToFind.costFormula, minLevel, maxLevel),
+ reward = findReward(hotmObjectToFind.rewardFormula, minLevel, maxLevel)
+
+ ChatLib.chat("")
+ ChatLib.chat(`&6${hotmObjectToFind.nameStringed} ${minLevel} - ${maxLevel} &bwill cost &6&l${addCommas(Math.round(powderSum))} &6${hotmObjectToFind.powderType[0].toUpperCase() + hotmObjectToFind.powderType.slice(1)} &bpowder.`)
+ ChatLib.chat(`&6${hotmObjectToFind.nameStringed} ${minLevel} - ${maxLevel} &bwill give &6&l${addCommas(Math.round(reward * 100) / 100)} &bof whatever reward is listed.`)
+ ChatLib.chat("")
+}
+
+export function findHotmObject(hotmName)
+{
+ let hotmData = JSON.parse(FileLib.read("Coleweight", "data/hotm.json")).data
+
+ for(let i = 0; i < hotmData.length; i++)
+ {
+ if(hotmData[i].names.includes(hotmName))
+ return hotmData[i]
+ }
+}
+
+export function findCost(costFormula, minLevel, maxLevel)
+{
+ let powderSum = 0
+
+ for(let currentLevel = minLevel; currentLevel < maxLevel; currentLevel++) // finds cost
+ powderSum += eval(costFormula.replace("currentLevel", currentLevel))
+ return powderSum
+}
+
+export function findReward(rewardFormula, minLevel, maxLevel)
+{
+ return eval(rewardFormula.replace("Level", 1+maxLevel-minLevel))
+} \ No newline at end of file
diff --git a/commands/tick.js b/commands/calculate/tick.js
index 7af81e2..5969710 100644
--- a/commands/tick.js
+++ b/commands/calculate/tick.js
@@ -1,12 +1,14 @@
-import constants from "../util/constants"
+import constants from "../../util/constants"
const PREFIX = constants.PREFIX
export function tick(speed, block)
{
- if(speed == undefined || parseInt(speed) != speed)
- return `${PREFIX}&cMining speed must be an integer!`
+ if(speed == undefined || parseInt(speed) != speed)
+ return ChatLib.chat(`${PREFIX}&cMining speed must be an integer!`)
+ if(block == undefined)
+ return ChatLib.chat(constants.CALCULATEERRORMESSAGE)
let strength = findStrength(block)
- if(strength < 1) return `${PREFIX}&cBlock must be a gemstone or positive breaking power! (or starting letter of gemstone)`
+ if(strength < 1) return ChatLib.chat(`${PREFIX}&cBlock must be a gemstone or positive breaking power! (or starting letter of gemstone)`)
let currentBlockTick = strength*30/speed,
currentShardTick = (strength-200)*30/speed,
nextBlockSpeed, nextShardSpeed
diff --git a/commands/credits.js b/commands/credits.js
new file mode 100644
index 0000000..af4aa28
--- /dev/null
+++ b/commands/credits.js
@@ -0,0 +1,7 @@
+import constants from "../util/constants"
+const PREFIX = constants.PREFIX
+
+export function credits()
+{
+ ChatLib.chat(`${PREFIX}&bCW was made by Ninjune#0670 (NinOnCubed).`)
+} \ No newline at end of file
diff --git a/commands/help.js b/commands/help.js
index 05c5a04..8e06b51 100644
--- a/commands/help.js
+++ b/commands/help.js
@@ -7,14 +7,15 @@ export function help()
helpCommand("", "Gets Coleweight of specified user", "(username)")
helpCommand("help", "This menu.", "")
helpCommand("time", "Prints time on timer (timer gui doesn't have to be visible).", "")
- helpCommand("tick", "Shows tick data.", "(mining speed) (('r','jade', etc) || breaking power of block))")
+ helpCommand("calculate", "Calculates things. '/cw calculate help' for more info.", "")
helpCommand("leaderboard", "Shows leaderboard.", "(min) [max]")
helpCommand("info", "Prints coleweight info.", "")
ChatLib.chat(ChatLib.getCenteredText("&a&lSettings"))
helpCommand("settings", "Opens settings.", "")
helpCommand("claim", "Claims a chollows sapphire structure in a lobby.", "(throne || spiral)")
- helpCommand("setkey", "Sets API key (can also use /api new)-", "(key)")
+ helpCommand("setkey", "Sets API key (can also use /api new)", "(key)")
helpCommand("reload", "Reloads the gui.", "")
+ helpCommand("track", "Sets tracked collection for collection tracker.", "(collection)")
ChatLib.chat(ChatLib.getCenteredText("&a&lWaypoints"))
helpCommand("coords", "Opens coords gui.", "")
helpCommand("throne", "Guide for setting up waypoints for throne.", "[toggle]")
@@ -27,8 +28,7 @@ export function help()
}
// Made by Almighty Stylla <3
-function helpCommand(command, desc, usage)
+export function helpCommand(command, desc, usage)
{
ChatLib.chat(new TextComponent(`&a${PREFIX} /cw ${command} => &b${desc}`).setHoverValue(`${"/cw " + command + " " + usage}`))
-}
-
+} \ No newline at end of file
diff --git a/commands/spiral.js b/commands/spiral.js
index 6574f18..f9f00aa 100644
--- a/commands/spiral.js
+++ b/commands/spiral.js
@@ -45,7 +45,7 @@ export function spiral(arg2)
}
register("renderWorld", () => {
- waypointRender(spiralWaypoints, true)
+ waypointRender(spiralWaypoints, true, true)
})
register("worldLoad", () => {
diff --git a/commands/throne.js b/commands/throne.js
index 517c93d..c3a2e1c 100644
--- a/commands/throne.js
+++ b/commands/throne.js
@@ -41,7 +41,7 @@ export function throne(arg2)
register("renderWorld", () => {
- waypointRender(throneWaypoints, true)
+ waypointRender(throneWaypoints, true, true)
})
diff --git a/data/collections.json b/data/collections.json
new file mode 100644
index 0000000..e61a942
--- /dev/null
+++ b/data/collections.json
@@ -0,0 +1,87 @@
+{
+ "gemstone":
+ {
+ "collectionToTrack": "GEMSTONE_COLLECTION",
+ "collectionStringed": "Gemstone"
+ },
+ "mithril":
+ {
+ "collectionToTrack": "MITHRIL_ORE",
+ "collectionStringed": "Mithril"
+ },
+ "gold":
+ {
+ "collectionToTrack": "GOLD_INGOT",
+ "collectionStringed": "Gold"
+ },
+ "obsidian":
+ {
+ "collectionToTrack": "OBSIDIAN",
+ "collectionStringed": "Obsidian"
+ },
+ "netherrack":
+ {
+ "collectionToTrack": "NETHERRACK",
+ "collectionStringed": "Netherrack"
+ },
+ "diamond":
+ {
+ "collectionToTrack": "DIAMOND",
+ "collectionStringed": "Diamond"
+ },
+ "ice":
+ {
+ "collectionToTrack": "ICE",
+ "collectionStringed": "Ice"
+ },
+ "redstone":
+ {
+ "collectionToTrack": "REDSTONE",
+ "collectionStringed": "Redstone"
+ },
+ "lapis":
+ {
+ "collectionToTrack": "INK_SACK:4",
+ "collectionStringed": "Lapis"
+ },
+ "coal":
+ {
+ "collectionToTrack": "COAL",
+ "collectionStringed": "Coal"
+ },
+ "emerald":
+ {
+ "collectionToTrack": "EMERALD",
+ "collectionStringed": "Emerald"
+ },
+ "endstone":
+ {
+ "collectionToTrack": "ENDER_STONE",
+ "collectionStringed": "Endstone"
+ },
+ "glowstone":
+ {
+ "collectionToTrack": "GLOWSTONE_DUST",
+ "collectionStringed": "Glowstone"
+ },
+ "iron":
+ {
+ "collectionToTrack": "IRON_INGOT",
+ "collectionStringed": "Iron"
+ },
+ "mycelium":
+ {
+ "collectionToTrack": "MYCEL",
+ "collectionStringed": "Mycelium"
+ },
+ "quartz":
+ {
+ "collectionToTrack": "QUARTZ",
+ "collectionStringed": "Endstone"
+ },
+ "cobblestone":
+ {
+ "collectionToTrack": "COBBLESTONE",
+ "collectionStringed": "Cobblestone"
+ }
+} \ No newline at end of file
diff --git a/data/hotm.json b/data/hotm.json
new file mode 100644
index 0000000..6eda953
--- /dev/null
+++ b/data/hotm.json
@@ -0,0 +1,151 @@
+{"data": [
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3)",
+ "rewardFormula": "Level*20",
+ "nameStringed": "Mining Speed",
+ "names": ["miningspeed", "speed", "ms"],
+ "maxLevel": 50,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.05)",
+ "rewardFormula": "Level*5",
+ "nameStringed": "Mining Fortune",
+ "names": ["miningfortune", "fortune", "mf"],
+ "maxLevel": 50,
+ "powderType": "mithril"
+
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 4)",
+ "rewardFormula": "10+(Level*0.5)",
+ "nameStringed": "Quick Forge",
+ "names": ["quickforge", "forge"],
+ "maxLevel": 20,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "200+((currentLevel-1)*18)",
+ "rewardFormula": "(200+((Level-1)*18))*2",
+ "nameStringed": "Titanium Insanium",
+ "names": ["titaniuminsanium", "titanium", "tita"],
+ "maxLevel": 50,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "200+((currentLevel-1)*18)",
+ "rewardFormula": "(200+((Level-1)*18))*2",
+ "nameStringed": "Titanium Insanium",
+ "names": ["dailypowder"],
+ "maxLevel": 100,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.07)",
+ "rewardFormula": "5+Level",
+ "nameStringed": "Luck Of The Cave",
+ "names": ["luckofthecave", "caveluck", "luck"],
+ "maxLevel": 45,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.4)",
+ "rewardFormula": "20+((Level-1)*6)",
+ "nameStringed": "Crystallized",
+ "names": ["crystallized"],
+ "maxLevel": 30,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 2.6)",
+ "rewardFormula": "10+(Level*0.4)",
+ "nameStringed": "Efficient Miner",
+ "names": ["efficientminer", "efficient"],
+ "maxLevel": 100,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "currentLevel*70",
+ "rewardFormula": "0.2+(Level*0.01)",
+ "nameStringed": "Orbiter",
+ "names": ["orbiter", "orbit"],
+ "maxLevel": 80,
+ "powderType": "mithril"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 2.3)",
+ "rewardFormula": "5+(Level*0.1)",
+ "nameStringed": "Seasoned Mineman",
+ "names": ["seasonedmineman", "mineman"],
+ "maxLevel": 100,
+ "powderType": "mithril"
+ },
+ {
+ "1": { "cost": "0", "reward": "+1 Pickaxe Ability Level;+1 Token of the Mountain", "powderType": "mithril"},
+ "2": { "cost": "50000", "reward": "+1 Forge Slot", "powderType": "mithril" },
+ "3": { "cost": "75000", "reward": "+1 Commission Slot" },
+ "4": { "cost": "100000", "reward": "+1 base ᠅ Mithril Powder when mining Mithril", "powderType": "mithril" },
+ "5": { "cost": "125000", "reward": "+1 Token of the Mountain", "powderType": "mithril" },
+ "6": { "cost": "500000", "reward": "+1 base ᠅ Gemstone Powder when mining Gemstones", "powderType": "gemstone" },
+ "7": { "cost": "750000", "reward": "+1 Token of the Mountain", "powderType": "gemstone"},
+ "nameStringed": "Peak of the Mountain",
+ "names": ["peakofthemountain", "peak", "potm"],
+ "maxLevel": 7
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 2.2)",
+ "rewardFormula": "50+((Level-1)*5",
+ "nameStringed": "Mole",
+ "names": ["mole"],
+ "maxLevel": 190,
+ "powderType": "gemstone"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 2.3)",
+ "rewardFormula": "50+(Level*5)",
+ "nameStringed": "Professional",
+ "names": ["professional", "prof"],
+ "maxLevel": 140,
+ "powderType": "gemstone"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.07)",
+ "rewardFormula": "5+((Level-1)*0.5)",
+ "nameStringed": "Lonesome Miner",
+ "names": ["lonesomeminer", "lonesome"],
+ "maxLevel": 45,
+ "powderType": "gemstone"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 4)",
+ "rewardFormula": "20+(4*(Level-1))",
+ "nameStringed": "Great Explorer",
+ "names": ["greatexplorer", "explorer"],
+ "maxLevel": 20,
+ "powderType": "gemstone"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.2)",
+ "rewardFormula": "Level*0.01",
+ "nameStringed": "Powder Buff",
+ "names": ["powderbuff", "powder"],
+ "maxLevel": 50,
+ "powderType": "gemstone"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.2)",
+ "rewardFormula": "Level*40",
+ "nameStringed": "Mining Speed II",
+ "names": ["miningspeedii", "miningspeed2", "speed2", "ms2"],
+ "maxLevel": 50,
+ "powderType": "gemstone"
+ },
+ {
+ "costFormula": "Math.pow((currentLevel+1), 3.2)",
+ "rewardFormula": "Level*5",
+ "nameStringed": "Mining Fortune II",
+ "names": ["miningfortuneii", "miningfortune2", "fortune2", "mf2"],
+ "maxLevel": 50,
+ "powderType": "gemstone"
+ }
+]} \ No newline at end of file
diff --git a/index.js b/index.js
index 94eef22..1937ec5 100644
--- a/index.js
+++ b/index.js
@@ -1,5 +1,6 @@
import './render/naturals'
import './render/tabList'
+import './render/gemstoneMiningStats'
import './commands/yog'
import './chat/apiNew'
import './chat/message'
diff --git a/metadata.json b/metadata.json
index 034e1f8..c36134f 100644
--- a/metadata.json
+++ b/metadata.json
@@ -3,6 +3,6 @@
"creator": "Ninjune",
"entry": "index.js",
"description": "Mining utilities.",
- "version": "1.6.11",
+ "version": "1.7.0",
"requires": ["axios", "PogData", "Vigilance", "Elementa"]
} \ No newline at end of file
diff --git a/render/collectionGui.js b/render/collectionGui.js
index 8197b11..4e6deee 100644
--- a/render/collectionGui.js
+++ b/render/collectionGui.js
@@ -1,43 +1,53 @@
-/*import constants from "../util/constants"
+import constants from "../util/constants"
+import settings from "../settings"
+import { trackerGui } from "../util/helperFunctions"
const PREFIX = constants.PREFIX
+const collectionMoveGui = new Gui()
+const collectionGui = new trackerGui("", "Collection Not set! /cw track", settings.collectionNotation)
-let collectionGui = new Gui(),
- collection = ""
export function trackCollection(arg)
{
- switch(arg)
- {
- case "obby":
- case "obsidian":
- collection = "OBSIDIAN"
- break
- default:
- ChatLib.chat(`${PREFIX}&eThat is not a valid collection! (or is not supported)`)
- }
+ collectionGui.resetVars()
+ let collections = JSON.parse(FileLib.read("Coleweight", "data/collections.json"))
+ if(arg == "obby") arg = "obsidian"
+ if(arg == "cobble") arg = "cobblestone"
+ if(collections[arg.toLowerCase()] == undefined) return ChatLib.chat(`${PREFIX}&eThat is not a valid collection! (or is not supported)`)
+ collectionGui.trackedItem = collections[arg].collectionToTrack
+ collectionGui.itemStringed = collections[arg].collectionStringed
+
+ ChatLib.chat(`${PREFIX}&bSet collection to ${collectionGui.itemStringed}!`)
+}
+
+export function openCollectionGui()
+{
+ collectionGui.moveGui()
}
-export function moveCollection()
+export function reloadCollection()
{
- collectionGui.open()
+ collectionGui.resetVars()
}
register("dragged", (dx, dy, x, y) => {
- if (!collectionGui.isOpen()) return
- constants.data.collectionX = x
- constants.data.collectionY = y
- constants.data.save()
+ if (!collectionGui.collectionMoveGui.isOpen()) return
+ constants.collectiondata.x = x
+ constants.collectiondata.y = y
+ constants.collectiondata.save()
})
register("renderOverlay", () => {
- if (cwGui.isOpen())
+ collectionGui.renderGui(constants.collectiondata.x, constants.collectiondata.y, settings.collectionNotation, settings.collectionTracker)
+})
+
+register("step", () => {
+ let date_ob = new Date(),
+ seconds = date_ob.getSeconds()
+
+ if(collectionGui.trackingItem == true)
+ collectionGui.uptimeSeconds += 1
+ if(seconds == 0 || seconds == 15 || seconds == 30 || seconds == 45)
{
- let txt = "Please set your api key with /cw setkey (key)!"
- if (constants.data.api_key != undefined)
- txt = "Click anywhere to move!"
- Renderer.drawStringWithShadow(txt, Renderer.screen.getWidth()/2 - Renderer.getStringWidth(txt)/2, Renderer.screen.getHeight()/2)
- Renderer.drawStringWithShadow(`&aCollection: &b0\n&aCW/hr: &b0\n&aUptime: &b0m\n&aColeweight Gained: &b0`, constants.data.collectionX, constants.data.collectionY)
+ collectionGui.calcApi(["members", Player.getUUID().replace(/-/g, ""), "collection"], Player.getUUID())
}
- if(collection == "") return
- coleweight > 1000 ?collectionMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`: coleweightMessage = `&b${coleweight.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`
-})*/ \ No newline at end of file
+}).setFps(1) \ No newline at end of file
diff --git a/render/cwGui.js b/render/cwGui.js
index 5af6773..0695e1c 100644
--- a/render/cwGui.js
+++ b/render/cwGui.js
@@ -21,7 +21,7 @@ export function openCwGui()
}
-export function reload()
+export function reloadColeweight()
{
upTimeTrack = false
stepsSinceLast = 0
diff --git a/render/downtimeGui.js b/render/downtimeGui.js
index 538c590..e11c376 100644
--- a/render/downtimeGui.js
+++ b/render/downtimeGui.js
@@ -21,9 +21,9 @@ export function openDowntimeGui()
register("dragged", (dx, dy, x, y) => {
if (!downtimeMoveGui.isOpen()) return
- constants.downtimedata.x = x
- constants.downtimedata.y = y
- constants.downtimedata.save()
+ constants.collectiondata.x = x
+ constants.collectiondata.y = y
+ constants.collectiondata.save()
})
register('actionbar', (xp) => {
@@ -57,16 +57,16 @@ register("renderOverlay", () => {
let txt = "Drag to move."
Renderer.drawStringWithShadow(txt, Renderer.screen.getWidth()/2 - Renderer.getStringWidth(txt)/2, Renderer.screen.getHeight()/2)
downtimeGui.guiObject = {leftValues: ["Downtime", "Overall Downtime", "Average Downtime", "Uptime"], rightValues: [0, 0, 0, 0]}
- downtimeGui.x = constants.downtimedata.x
- downtimeGui.y = constants.downtimedata.y
+ downtimeGui.x = constants.collectiondata.x
+ downtimeGui.y = constants.collectiondata.y
downtimeGui.renderGui()
return
}