-
Автор темы
- #1
- Выберите загрузчик игры
- Прочие моды
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Бот для анализа цен на аукционе сервера mc.funtime.su. Отслеживает цены предметов, учитывая их характеристики, зачарования и количество.
# Возможности
Ну как игрушка думаю пойдет :0
SS ->


CODE
# Возможности
- Анализ цен предметов с учетом их чар (пытался чет сделать но забил, под дефолт предметы работает)
- Отслеживание не нормальных цен
- Расчет медианной цены и рекомендуемой максимальной цены
- Сохранение истории цен в JSON файл
Ну как игрушка думаю пойдет :0
SS ->


CODE
JavaScript:
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: 'mc.funtime.su',
username: 'Qipuloyahej_',
version: '1.16.5',
hideErrors: true,
})
const priceHistory = new Map()
function calculateMedianPrice(prices) {
if (prices.length === 0) return 0
const sortedPrices = [...prices].sort((a, b) => a - b)
const cutoff = Math.floor(sortedPrices.length * 0.1)
const filteredPrices = sortedPrices.slice(cutoff, sortedPrices.length - cutoff)
if (filteredPrices.length === 0) return sortedPrices[0]
const mid = Math.floor(filteredPrices.length / 2)
return filteredPrices.length % 2 === 0
? (filteredPrices[mid - 1] + filteredPrices[mid]) / 2
: filteredPrices[mid]
}
function isPriceAnomaly(price, itemName) {
const history = priceHistory.get(itemName)
if (!history || history.length < 5) return false
const median = calculateMedianPrice(history)
return price > median * 3 || price < median / 3
}
function getItemKey(item) {
let key = item.name
let stats = []
let count = item.count || 1
if (item.enchants) {
Object.entries(item.enchants).forEach(([enchName, level]) => {
stats.push(`${enchName}=${level}`)
})
}
try {
if (item.customLore) {
item.customLore.forEach(loreLine => {
try {
const loreJson = JSON.parse(loreLine)
if (loreJson.extra) {
loreJson.extra.forEach(extraItem => {
if (extraItem.text) {
const text = extraItem.text.trim()
const countMatch = text.match(/[xх](\d+)/i)
if (countMatch) {
count = parseInt(countMatch[1])
}
if (
text.includes('Сила') ||
text.includes('Здоровье') ||
text.includes('Защита') ||
text.includes('Скорость') ||
text.includes('Урон') ||
text.includes('Острота') ||
text.includes('Защита') ||
text.includes('Эффективность') ||
text.includes('Прочность')
) {
const cleanText = text.replace(/§[0-9a-fk-or]/g, '').trim()
if (cleanText) {
stats.push(cleanText)
}
}
const romanNumerals = text.match(/\s[IVX]+\b/)
if (romanNumerals) {
stats[stats.length - 1] += romanNumerals[0].trim()
}
}
})
}
} catch (e) {}
})
}
} catch (e) {}
key += `#count=${count}`
if (stats.length > 0) {
stats = [...new Set(stats)].sort()
key += '#stats=' + stats.join('|')
}
return { key, count, stats }
}
function analyzePriceAndUpdate(item, price) {
const { key: itemKey, count, stats } = getItemKey(item)
if (!priceHistory.has(itemKey)) {
priceHistory.set(itemKey, [])
}
const pricePerItem = Math.round(price / count)
const history = priceHistory.get(itemKey)
history.push(pricePerItem)
if (history.length > 100) {
history.shift()
}
const median = calculateMedianPrice(history)
const isAnomaly = isPriceAnomaly(pricePerItem, itemKey)
saveStatsToJson()
return {
currentPrice: price,
pricePerItem,
count,
stats,
medianPrice: median,
medianTotalPrice: median * count,
isAnomaly,
pricesAnalyzed: history.length,
recommendedMaxPrice: median * 1.2 * count,
itemKey
}
}
function saveStatsToJson() {
const stats = {}
for (const [itemKey, prices] of priceHistory.entries()) {
const [itemName, ...params] = itemKey.split('#')
const count = parseInt(params.find(p => p.startsWith('count='))?.split('=')[1] || 1)
stats[itemKey] = {
itemName,
count,
medianPricePerItem: calculateMedianPrice(prices),
medianTotalPrice: calculateMedianPrice(prices) * count,
minPricePerItem: Math.min(...prices),
maxPricePerItem: Math.max(...prices),
pricesAnalyzed: prices.length,
lastUpdate: new Date().toISOString(),
priceHistory: prices.slice(-50)
}
}
require('fs').writeFileSync('price_stats.json', JSON.stringify(stats, null, 2))
}
bot.once('spawn', () => {
console.log('Бот заспавнился!')
bot.chat('/an103')
setTimeout(() => {
bot.chat('/ah')
}, 11000)
})
bot.on('windowOpen', async (window) => {
if (window.title.includes('Аукцион')) {
console.log('Аукцион открыт!')
for (const item of window.slots) {
if (!item) continue
if (item.customLore) {
try {
const itemLore = item.customLore
let price = ''
let seller = ''
itemLore.forEach(loreLine => {
try {
const loreJson = JSON.parse(loreLine)
if (loreJson.extra) {
loreJson.extra.forEach(extraItem => {
if (extraItem.text && extraItem.text.includes('$')) {
const cleanPrice = extraItem.text.replace('$', '').replace(/,/g, '')
if (!isNaN(cleanPrice)) {
price = parseInt(cleanPrice)
}
}
})
}
if (loreJson.extra) {
loreJson.extra.forEach(extraItem => {
if (extraItem.text && extraItem.color === 'gold') {
seller = extraItem.text.trim()
}
})
}
} catch (e) {}
})
if (price) {
const analysis = analyzePriceAndUpdate(item, price)
console.log(`Предмет: ${item.name} (x${analysis.count})`)
if (analysis.stats && analysis.stats.length > 0) {
console.log('Характеристики:')
analysis.stats.forEach(stat => console.log(` - ${stat}`))
} else {
console.log('Характеристики: нет')
}
console.log(`Текущая цена: ${price} (${analysis.pricePerItem} за штуку)`)
console.log(`Медианная цена: ${analysis.medianPrice} за штуку`)
console.log(`Медианная цена за все: ${analysis.medianTotalPrice}`)
console.log(`Рекомендуемая макс. цена: ${analysis.recommendedMaxPrice}`)
if (analysis.isAnomaly) {
console.log('⚠ ВНИМАНИЕ: Подозрительная цена!')
}
console.log(`Проанализировано цен: ${analysis.pricesAnalyzed}`)
if (seller) console.log('Истекает через:', seller)
console.log('-------------------')
}
} catch (error) {}
}
}
await new Promise(resolve => setTimeout(resolve, 1000))
bot.simpleClick.leftMouse(49).catch(() => {})
}
})
bot.on('message', (message) => {
const msg = message.toString()
try {
if (msg.includes('customLore')) {
const itemLore = msg
const jsonString = `[${itemLore}]`
const loreArray = JSON.parse(jsonString)
let price = ''
loreArray.forEach(item => {
if (item.extra) {
item.extra.forEach((extraItem) => {
if (extraItem.text) {
if (extraItem.text.includes('Ценa') || extraItem.text.includes('$')) {
price += extraItem.text.trim() + ' '
}
}
})
}
})
if (price) {
console.log('Найдена цена:', price)
}
}
} catch (error) {}
})
bot.on('error', (err) => {
console.error('Произошла ошибка:', err)
})
bot.on('kicked', (reason) => {
console.log('Бот был кикнут:', reason)
})
bot.on('end', () => {
console.log('Бот отключился от сервера')
})