Compare commits

..

No commits in common. "a28869a7827009922a9156bb62205ded87e32cf7" and "354808ef0b307a54da9cd9bd65c86189ed799956" have entirely different histories.

12 changed files with 223 additions and 1599 deletions

View file

@ -1,7 +0,0 @@
config*
docker*
Docker*
README*
node_modules/
.*
pnpm-lock*

2
.gitignore vendored
View file

@ -1,2 +0,0 @@
node_modules
.env

View file

@ -1,8 +0,0 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"parser": "babel-flow",
"bracketSameLine": true
}

View file

@ -1,176 +1,101 @@
const { default: axios } = require('axios'); const {default: axios} = require("axios");
const { const {getParsed, getProfit, splitNumber, getRawCraft} = require("./src/helperFunctions");
getParsed, const {parentPort, workerData} = require("worker_threads");
getProfit, const config = require("./config.json")
splitNumber, let minProfit = config.data.minSnipeProfit
getRawCraft, let minPercentProfit = config.data.minSnipePP
} = require('./src/helperFunctions'); let ignoredAuctions = []
const { parentPort, workerData } = require('worker_threads'); const {Item} = require("./src/Item")
const config = require('./config.json'); const threadsToUse = require("./config.json").data["threadsToUse/speed"]
let minProfit = config.data.minSnipeProfit; const promises = []
let minPercentProfit = config.data.minSnipePP;
let ignoredAuctions = [];
const { Item } = require('./src/Item');
const threadsToUse = require('./config.json').data['threadsToUse/speed'];
const promises = [];
console.log(`[Worker ${workerData.workerNumber}] Worker started`); parentPort.on("message", async (message) => {
if (message.type === "pageCount") {
parentPort.on('message', async (message) => { await doTask(message.data)
console.log( } else if (message.type === "moulberry") {
`[Worker ${workerData.workerNumber}] Received message: ${message.type}` workerData.itemDatas = message.data
); }
if (message.type === 'pageCount') { })
await doTask(message.data);
} else if (message.type === 'moulberry') {
workerData.itemDatas = message.data;
console.log(`[Worker ${workerData.workerNumber}] Updated item data`);
}
});
async function parsePage(i) { async function parsePage(i) {
console.log(`[Worker ${workerData.workerNumber}] Parsing page ${i}`); const auctionPage = await axios.get(`https://api.hypixel.net/skyblock/auctions?page=${i}`)
try {
const auctionPage = await axios.get(
`https://api.hypixel.net/skyblock/auctions?page=${i}`
);
for (const auction of auctionPage.data.auctions) { for (const auction of auctionPage.data.auctions) {
if (!auction.bin) continue; if (!auction.bin) continue
const uuid = auction.uuid; const uuid = auction.uuid
if ( if (ignoredAuctions.includes(uuid) || config.data.ignoreCategories[auction.category]) continue
ignoredAuctions.includes(uuid) || const item = await getParsed(auction.item_bytes)
config.data.ignoreCategories[auction.category] const extraAtt = item["i"][0].tag.ExtraAttributes
) const itemID = extraAtt.id
continue; let startingBid = auction.starting_bid
const item = await getParsed(auction.item_bytes); const itemData = workerData.itemDatas[itemID]
const extraAtt = item['i'][0].tag.ExtraAttributes; if (!itemData) continue
const itemID = extraAtt.id; const lbin = itemData.lbin
let startingBid = auction.starting_bid; const sales = itemData.sales
const itemData = workerData.itemDatas[itemID]; const prettyItem = new Item(item.i[0].tag.display.Name, uuid, startingBid, auction.tier, extraAtt.enchantments,
if (!itemData) continue; extraAtt.hot_potato_count > 10 ? 10 : extraAtt.hot_potato_count, extraAtt.hot_potato_count > 10 ?
const lbin = itemData.lbin; extraAtt.hot_potato_count - 10 : 0, extraAtt.rarity_upgrades === 1,
const sales = itemData.sales; extraAtt.art_of_war_count === 1, extraAtt.dungeon_item_level,
const prettyItem = new Item( extraAtt.gems, itemID, auction.category, 0, 0, lbin, sales, auction.item_lore)
item.i[0].tag.display.Name, const unstableOrMarketManipulated = Math.abs((lbin - itemData.cleanPrice) / lbin) > config.data.maxAvgLbinDiff
uuid, ignoredAuctions.push(uuid)
startingBid, const rcCost = config.data.includeCraftCost ? getRawCraft(prettyItem, workerData.bazaarData, workerData.itemDatas) : 0
auction.tier, const carriedByRC = rcCost >= config.data.rawCraftMaxWeightPP * lbin
extraAtt.enchantments,
extraAtt.hot_potato_count > 10 ? 10 : extraAtt.hot_potato_count,
extraAtt.hot_potato_count > 10 ? extraAtt.hot_potato_count - 10 : 0,
extraAtt.rarity_upgrades === 1,
extraAtt.art_of_war_count === 1,
extraAtt.dungeon_item_level,
extraAtt.gems,
itemID,
auction.category,
0,
0,
lbin,
sales,
auction.item_lore
);
const unstableOrMarketManipulated =
Math.abs((lbin - itemData.cleanPrice) / lbin) >
config.data.maxAvgLbinDiff;
ignoredAuctions.push(uuid);
const rcCost = config.data.includeCraftCost
? getRawCraft(prettyItem, workerData.bazaarData, workerData.itemDatas)
: 0;
const carriedByRC = rcCost >= config.data.rawCraftMaxWeightPP * lbin;
if ( if (carriedByRC || unstableOrMarketManipulated || sales <= config.data.minSales || !sales) continue
carriedByRC ||
unstableOrMarketManipulated ||
sales <= config.data.minSales ||
!sales
)
continue;
if ( if (config.filters.nameFilter.find((name) => itemID.includes(name)) === undefined) {
config.filters.itemIDExclusions.find((name) => if ((lbin + rcCost) - startingBid > minProfit) {
itemID.includes(name) const profitData = getProfit(startingBid, rcCost, lbin)
) === undefined let auctionType = null
) { if (rcCost > (lbin - startingBid) && profitData.snipeProfit < minProfit) {
if (lbin + rcCost - startingBid > minProfit) { auctionType = "VALUE"
const profitData = getProfit(startingBid, rcCost, lbin); } else if (profitData.snipeProfit >= minProfit && rcCost < (lbin - startingBid)) {
let auctionType = null; auctionType = "SNIPE"
if ( } else if (profitData.snipeProfit >= minProfit && rcCost > 0) {
rcCost > lbin - startingBid && auctionType = "BOTH"
profitData.snipeProfit < minProfit }
) {
auctionType = 'VALUE';
} else if (
profitData.snipeProfit >= minProfit &&
rcCost < lbin - startingBid
) {
auctionType = 'SNIPE';
} else if (profitData.snipeProfit >= minProfit && rcCost > 0) {
auctionType = 'BOTH';
}
prettyItem.auctionData.ahType = auctionType; prettyItem.auctionData.ahType = auctionType
if (auctionType === 'VALUE' || auctionType === 'BOTH') { if (auctionType === "VALUE" || auctionType === "BOTH") {
if ( if (profitData.RCProfit > config.data.minCraftProfit && profitData.RCPP > config.data.minCraftPP) {
profitData.RCProfit > config.data.minCraftProfit && prettyItem.auctionData.profit = profitData.RCProfit
profitData.RCPP > config.data.minCraftPP prettyItem.auctionData.percentProfit = profitData.RCPP
) { parentPort.postMessage(prettyItem)
prettyItem.auctionData.profit = profitData.RCProfit; }
prettyItem.auctionData.percentProfit = profitData.RCPP; } else {
parentPort.postMessage(prettyItem); if (profitData.snipeProfit > minProfit && profitData.snipePP > minPercentProfit) {
prettyItem.auctionData.profit = profitData.snipeProfit
prettyItem.auctionData.percentProfit = profitData.snipePP
parentPort.postMessage(prettyItem)
}
}
} }
} else {
if (
profitData.snipeProfit > minProfit &&
profitData.snipePP > minPercentProfit
) {
prettyItem.auctionData.profit = profitData.snipeProfit;
prettyItem.auctionData.percentProfit = profitData.snipePP;
parentPort.postMessage(prettyItem);
}
}
} }
}
} }
} catch (error) {
console.error(
`[Worker ${workerData.workerNumber}] Error parsing page ${i}:`,
error
);
}
} }
async function doTask(totalPages) { async function doTask(totalPages) {
console.log( let startingPage = 0
`[Worker ${workerData.workerNumber}] Starting task for ${totalPages} pages` const pagePerThread = splitNumber(totalPages, threadsToUse)
);
let startingPage = 0;
const pagePerThread = splitNumber(totalPages, threadsToUse);
if (workerData.workerNumber !== 0 && startingPage === 0) { if (workerData.workerNumber !== 0 && startingPage === 0) {
const clonedStarting = pagePerThread.slice(); const clonedStarting = pagePerThread.slice()
clonedStarting.splice(workerData.workerNumber, 9999); clonedStarting.splice(workerData.workerNumber, 9999);
clonedStarting.forEach((pagePer) => { clonedStarting.forEach((pagePer) => {
startingPage += pagePer; startingPage += pagePer
}); })
} }
let pageToStop = let pageToStop = parseInt(startingPage) + parseInt(pagePerThread[workerData.workerNumber])
parseInt(startingPage) + parseInt(pagePerThread[workerData.workerNumber]);
if (pageToStop !== totalPages) { if (pageToStop !== totalPages) {
pageToStop -= 1; pageToStop -= 1
} }
console.log( for (let i = startingPage; i < pageToStop; i++) {
`[Worker ${workerData.workerNumber}] Processing pages from ${startingPage} to ${pageToStop}` promises.push(parsePage(i))
); }
await Promise.all(promises)
for (let i = startingPage; i < pageToStop; i++) { //parentPort.postMessage("finished")
promises.push(parsePage(i));
}
await Promise.all(promises);
console.log(`[Worker ${workerData.workerNumber}] Finished task`);
parentPort.postMessage('finished');
} }

View file

@ -1,9 +0,0 @@
FROM node:23-alpine3.20
COPY . /app
WORKDIR /app
RUN npm install
CMD ["node", "index.js"]

View file

@ -1,11 +1,5 @@
# Hypixel Auction House Flipper # Hypixel Auction House Flipper
# Changes
- Made auction command copyable in a single click
- Uses a different and more accurate JSON for retrieving average auction prices
- Added the average price to message description
- Add minAvgProfit to config which allows for the user to set a minimum profit based on the average price
# Features: # Features:
- Custom filters (Catergory, Name, Enchantment..) - Custom filters (Catergory, Name, Enchantment..)
@ -19,20 +13,3 @@
- Ability to make some high tier enchantments worthless (like Looking 4, Luck 6 etc..) - Ability to make some high tier enchantments worthless (like Looking 4, Luck 6 etc..)
- Bad Enchantment filter - Bad Enchantment filter
- And more.. - And more..
# Setup
## .env
`.env` file is needed due to docker compose. Even if you are not using docker and docker compose, **.ENV IS NEEDED**
the example .env is
```
webhook_url=<url_of_webhook>
webhook_name=Flipper
webhook_profile_picture_link=https://cdn.discordapp.com/avatars/486155512568741900/164084b936b4461fe9505398f7383a0e.png?size=4096
```
You can also add these as environment variables into your system when running Node or run the app via `node --env-file=.env index.js`
## config.json
### filters
- itemIDExclusions: exclusion based on itemID (contains, doesnt have to be the full itemID name)
- EnchantThreshold and EnchantThresholdConditionalBypass are used for **Raw Crafting**. I suggest leaving them as they are.

View file

@ -1,12 +1,11 @@
{ {
"data": { "data": {
"threadsToUse/speed": 48, "threadsToUse/speed": 64,
"minSnipeProfit": 900000, "minSnipeProfit": 100000,
"minAvgProfit": 500000, "minCraftProfit": 100000,
"minCraftProfit": 500000,
"maxAvgLbinDiff": 3.0, "maxAvgLbinDiff": 0.35,
"rawCraftMaxWeightPP": 0.4, "rawCraftMaxWeightPP": 0.4,
"minSnipePP": 8, "minSnipePP": 8,
"minCraftPP": 8, "minCraftPP": 8,
@ -23,8 +22,13 @@
"includeCraftCost": true, "includeCraftCost": true,
"minPriceForRawcraft": 5000000 "minPriceForRawcraft": 5000000
}, },
"webhook": {
"discordWebhookUrl": "WEBHOOK_URL",
"webhookName": "Flipper",
"webhookPFP": "https://cdn.discordapp.com/avatars/486155512568741900/164084b936b4461fe9505398f7383a0e.png?size=4096"
},
"filters": { "filters": {
"EnchantThresholdConditionalBypass": { "rawCraftIgnoreEnchants": {
"WITHER_": { "WITHER_": {
"growth": 6, "growth": 6,
"protection": 6 "protection": 6
@ -34,7 +38,7 @@
"protection": 6 "protection": 6
}, },
"NECROMANCER": { "NECROMANCER": {
"growth": 4, "growth": 6,
"protection": 6 "protection": 6
}, },
"SHREDDED": { "SHREDDED": {
@ -45,7 +49,7 @@
"protection": 6 "protection": 6
} }
}, },
"EnchantThreshold": { "badEnchants": {
"giant_killer": 6, "giant_killer": 6,
"growth": 6, "growth": 6,
"power": 6, "power": 6,
@ -58,12 +62,12 @@
"vampirism": 6, "vampirism": 6,
"luck": 6, "luck": 6,
"syphon": 4, "syphon": 4,
"ultimate_soul_eater": 6, "ultimate_soul_eater": 3,
"ultimate_wise": 5, "ultimate_wise": 4,
"ultimate_wisdom": 5, "ultimate_wisdom": 4,
"ultimate_legion": 3 "ultimate_legion": 3
}, },
"itemIDExclusions": [ "nameFilter": [
"SALMON", "SALMON",
"PERFECT", "PERFECT",
"BEASTMASTER", "BEASTMASTER",

View file

@ -1,12 +0,0 @@
---
services:
hypixel-flipper:
container_name: hypixel-flipper
build: .
restart: unless-stopped
env_file:
- .env
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./config.json:/app/config.json

280
index.js
View file

@ -1,185 +1,139 @@
const { default: axios } = require('axios'); const {default: axios} = require("axios")
const config = require('./config.json'); const config = require("./config.json")
const { WebhookClient, EmbedBuilder, Embed } = require('discord.js'); const discord = require('discord.js')
const { Worker } = require('worker_threads'); const {Worker} = require("worker_threads")
const { asyncInterval, addNotation } = require('./src/helperFunctions'); const { asyncInterval, addNotation } = require("./src/helperFunctions")
const { string } = require('prismarine-nbt'); let threadsToUse = config.data["threadsToUse/speed"] ?? 1
let lastUpdated = 0
let threadsToUse = config.data['threadsToUse/speed'] ?? 1; let doneWorkers = 0
let lastUpdated = 0; let startingTime
let doneWorkers = 0; let maxPrice = 0
let startingTime; let itemDatas = {}
let maxPrice = 0; const workers = []
let itemDatas = {}; const webhookRegex = /https:\/\/discord.com\/api\/webhooks\/(.+)\/(.+)/
const workers = [];
const webhookRegex = /https:\/\/discord.com\/api\/webhooks\/(.+)\/(.+)/;
const bazaarPrice = { const bazaarPrice = {
RECOMBOBULATOR_3000: 0, "RECOMBOBULATOR_3000": 0,
HOT_POTATO_BOOK: 0, "HOT_POTATO_BOOK": 0,
FUMING_POTATO_BOOK: 0, "FUMING_POTATO_BOOK": 0
}; }
async function initialize() { async function initialize() {
const matches = process.env.webhook_url.match(webhookRegex); matches = config.webhook.discordWebhookUrl.match(webhookRegex)
if (!matches) return console.log(`[Main thread] Couldn't parse Webhook URL`); if (!matches) return console.log(`[Main thread] Couldn't parse Webhook URL`)
const webhook = new WebhookClient({ id: matches[1], token: matches[2] }); const webhook = new discord.WebhookClient(matches[1], matches[2]);
await getBzData(); await getBzData()
await getMoulberry(); await getMoulberry()
await getLBINs(); await getLBINs()
for (let j = 0; j < threadsToUse; j++) { for (let j = 0; j < threadsToUse; j++) {
workers[j] = new Worker('./AuctionHandler.js', { workers[j] = new Worker('./AuctionHandler.js', {
workerData: { workerData: {
itemDatas: itemDatas, itemDatas: itemDatas,
bazaarData: bazaarPrice, bazaarData: bazaarPrice,
workerNumber: j, workerNumber: j,
maxPrice: maxPrice, maxPrice: maxPrice
}, }
}); })
workers[j].on('message', async (result) => { workers[j].on("message", async (result) => {
if (result.itemData !== undefined) { if (result.itemData !== undefined) {
let averagePrice = itemDatas[result.itemData.id]?.cleanPrice || 'N/A'; if (result.auctionData.lbin >= result.auctionData.price) {
if ( await webhook.send({
result.auctionData.lbin - result.auctionData.price >= username: config.webhook.webhookName,
config.data.minSnipeProfit && avatarURL: config.webhook.webhookPFP,
averagePrice - result.auctionData.price >= config.data.minAvgProfit embeds: [new discord.MessageEmbed()
) { .setTitle(`**${(result.itemData.name).replaceAll(/§./g, '')}**`)
let mustBuyMessage = ''; .setColor("#2e3137")
const embed = new EmbedBuilder() .setThumbnail(`https://sky.shiiyu.moe/item/${result.itemData.id}`)
.setTitle(`**${result.itemData.name.replace(/§./g, '')}**`) .setDescription(`Auction: \`/viewauction ${result.auctionData.auctionID}\`\nProfit: \`${addNotation("oneLetters", (result.auctionData.profit))} (${result.auctionData.percentProfit}%)\`\nCost: \`${addNotation("oneLetters", (result.auctionData.price))}\`\nLBIN: \`${addNotation("oneLetters", (result.auctionData.lbin))}\`\nSales/Day: \`${addNotation("oneLetters", result.auctionData.sales)}\`\nType: \`${result.auctionData.ahType}\``)
.setColor('#2e3137') ]
.setThumbnail(`https://sky.shiiyu.moe/item/${result.itemData.id}`) })
.setDescription(
`${mustBuyMessage}\nAuction:
\`\`\`/viewauction ${result.auctionData.auctionID}\`\`\`
\nProfit: \`${addNotation(
'oneLetters',
result.auctionData.profit
)} (${result.auctionData.percentProfit}%)\`
\nCost: \`${addNotation('oneLetters', result.auctionData.price)}\`
\nLBIN: \`${addNotation('oneLetters', result.auctionData.lbin)}\`
\nSales/Day: \`${addNotation(
'oneLetters',
result.auctionData.sales
)}\`
\nType: \`${result.auctionData.ahType}\`
\nAverage Price: \`${addNotation('oneLetters', averagePrice)}\``
);
await webhook.send({ }
username: process.env.webhook_name, } else if (result === "finished") {
avatarURL: process.env.webhook_profile_picture_link, doneWorkers++
embeds: [embed], if (doneWorkers === threadsToUse) {
}); doneWorkers = 0
} console.log(`Completed in ${(Date.now() - startingTime) / 1000} seconds`)
} else if (result === 'finished') { startingTime = 0
doneWorkers++; workers[0].emit("done")
if (doneWorkers === threadsToUse) { }
doneWorkers = 0; }
console.log( });
`Completed in ${(Date.now() - startingTime) / 1000} seconds` }
);
startingTime = 0;
workers[0].emit('done');
}
}
});
}
asyncInterval( asyncInterval(async () => {
async () => { await getLBINs()
await getLBINs(); workers.forEach((worker) => {
workers.forEach((worker) => { worker.postMessage({type: "moulberry", data: itemDatas})
worker.postMessage({ type: 'moulberry', data: itemDatas }); })
}); }, "lbin", 60000)
},
'lbin',
60000
);
asyncInterval( asyncInterval(async () => {
async () => { await getMoulberry()
await getMoulberry(); workers.forEach((worker) => {
workers.forEach((worker) => { worker.postMessage({type: "moulberry", data: itemDatas})
worker.postMessage({ type: 'moulberry', data: itemDatas }); })
}); }, "avg", 60e5)
},
'avg',
60e5
);
asyncInterval(
async () => { asyncInterval(async () => {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
const ahFirstPage = await axios.get( const ahFirstPage = await axios.get("https://api.hypixel.net/skyblock/auctions?page=0")
'https://api.hypixel.net/skyblock/auctions?page=0' const totalPages = ahFirstPage.data.totalPages
); if (ahFirstPage.data.lastUpdated === lastUpdated) {
const totalPages = ahFirstPage.data.totalPages; resolve()
if (ahFirstPage.data.lastUpdated === lastUpdated) { } else {
resolve(); lastUpdated = ahFirstPage.data.lastUpdated
} else { startingTime = Date.now()
lastUpdated = ahFirstPage.data.lastUpdated; console.log("Getting auctions..")
startingTime = Date.now(); workers.forEach((worker) => {
console.log('Getting auctions..'); worker.postMessage({type: "pageCount", data: totalPages})
workers.forEach((worker) => { })
worker.postMessage({ type: 'pageCount', data: totalPages }); workers[0].once("done", () => {
}); resolve()
workers[0].once('done', () => { })
resolve(); }
}); })
} }, "check", 0)
});
},
'check',
0
);
} }
async function getLBINs() { async function getLBINs() {
const lbins = await axios.get('https://moulberry.codes/lowestbin.json'); const lbins = await axios.get("https://moulberry.codes/lowestbin.json")
const lbinData = lbins.data; const lbinData = lbins.data
for (const item of Object.keys(lbinData)) { for (const item of Object.keys(lbinData)) {
if (!itemDatas[item]) itemDatas[item] = {}; if (!itemDatas[item]) itemDatas[item] = {}
itemDatas[item].lbin = lbinData[item]; itemDatas[item].lbin = lbinData[item]
} }
} }
async function getMoulberry() { async function getMoulberry() {
const moulberryAvgs = await axios.get( const moulberryAvgs = await axios.get("https://moulberry.codes/auction_averages/3day.json")
'https://moulberry.codes/auction_averages/3day.json' const avgData = moulberryAvgs.data
); for (const item of Object.keys(avgData)) {
const avgData = moulberryAvgs.data; itemDatas[item] = {}
const itemInfo = avgData[item]
const cleanPriceAvgs = await axios.get( if (itemInfo.sales !== undefined) {
'https://moulberry.codes/auction_averages_lbin/1day.json' itemDatas[item].sales = itemInfo.sales
); } else {
const cleanPriceData = cleanPriceAvgs.data; itemDatas[item].sales = 0
}
for (const item of Object.keys(avgData)) { if (itemInfo.clean_price) {
if (!itemDatas[item]) itemDatas[item] = {}; itemDatas[item].cleanPrice = itemInfo.clean_price
const itemInfo = avgData[item]; } else {
itemDatas[item].cleanPrice = itemInfo.price
itemDatas[item].sales = itemInfo.sales !== undefined ? itemInfo.sales : 0; }
itemDatas[item].cleanPrice = }
cleanPriceData[item] !== undefined
? Math.round(cleanPriceData[item])
: itemInfo.clean_price !== undefined
? itemInfo.clean_price
: itemInfo.price;
}
} }
async function getBzData() { async function getBzData() {
const bzData = await axios.get('https://api.hypixel.net/skyblock/bazaar'); const bzData = await axios.get("https://api.hypixel.net/skyblock/bazaar")
bazaarPrice['RECOMBOBULATOR_3000'] = bazaarPrice["RECOMBOBULATOR_3000"] = bzData.data.products.RECOMBOBULATOR_3000.quick_status.buyPrice
bzData.data.products.RECOMBOBULATOR_3000.quick_status.buyPrice; bazaarPrice["HOT_POTATO_BOOK"] = bzData.data.products.HOT_POTATO_BOOK.quick_status.buyPrice
bazaarPrice['HOT_POTATO_BOOK'] = bazaarPrice["FUMING_POTATO_BOOK"] = bzData.data.products.FUMING_POTATO_BOOK.quick_status.buyPrice
bzData.data.products.HOT_POTATO_BOOK.quick_status.buyPrice;
bazaarPrice['FUMING_POTATO_BOOK'] =
bzData.data.products.FUMING_POTATO_BOOK.quick_status.buyPrice;
} }
initialize();
initialize()

View file

@ -4,7 +4,7 @@
"dependencies": { "dependencies": {
"axios": "^0.24.0", "axios": "^0.24.0",
"copy-paste": "^1.3.0", "copy-paste": "^1.3.0",
"discord.js": "^14.16.3", "discord.js": "^12.5.3",
"express": "^4.17.1", "express": "^4.17.1",
"node-notifier": "^10.0.0", "node-notifier": "^10.0.0",
"open": "^8.4.0", "open": "^8.4.0",
@ -14,9 +14,10 @@
}, },
"description": "Hypixel Skyblock Auction House Flip Notifier", "description": "Hypixel Skyblock Auction House Flip Notifier",
"main": "index.js", "main": "index.js",
"devDependencies": {},
"scripts": { "scripts": {
"start": "node ." "start": "node ."
}, },
"keywords": [], "keywords": [],
"author": "DuckySoLucky + MashClashXD" "author": "DuckySoLucky"
} }

1191
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -90,25 +90,17 @@ function splitNumber (num = 1, parts = 1) {
function getRawCraft(item, bazaarPrice, lbins) { function getRawCraft(item, bazaarPrice, lbins) {
let price = 0 let price = 0
const ignoreMatch = Object.keys( const ignoreMatch = Object.keys(config.filters.rawCraftIgnoreEnchants).find((key) => {
config.filters.EnchantThresholdConditionalBypass if (item.itemData.id.includes(key)) return true
).find((key) => { })
if (item.itemData.id.includes(key)) return true;
});
if (item.auctionData.lbin < config.data.minPriceForRawcraft) return 0 if (item.auctionData.lbin < config.data.minPriceForRawcraft) return 0
let isInIgnore = ignoreMatch ? ignoreMatch : false let isInIgnore = ignoreMatch ? ignoreMatch : false
if (item.itemData.enchants && !item.itemData.id.includes(';')) { if (item.itemData.enchants && !item.itemData.id.includes(';')) {
for (const enchant of Object.keys(item.itemData.enchants)) { for (const enchant of Object.keys(item.itemData.enchants)) {
const degree = item.itemData.enchants[enchant] const degree = item.itemData.enchants[enchant]
const badEnchant = const badEnchant = typeof config.filters.badEnchants[enchant] === 'number' ? degree >= config.filters.badEnchants[enchant] : false
typeof config.filters.EnchantThreshold[enchant] === 'number'
? degree >= config.filters.EnchantThreshold[enchant]
: false;
if (isInIgnore) { if (isInIgnore) {
const enchantMinValue = const enchantMinValue = config.filters.rawCraftIgnoreEnchants[ignoreMatch][enchant]
config.filters.EnchantThresholdConditionalBypass[ignoreMatch][
enchant
];
if (enchantMinValue >= degree) continue if (enchantMinValue >= degree) continue
} }
if (badEnchant) { if (badEnchant) {