better trade

This commit is contained in:
2023-06-06 12:50:53 -04:00
parent d6c003850d
commit 77513c4c8d
5 changed files with 273 additions and 1757 deletions

View File

@ -55,7 +55,6 @@ let sites = {
german: {
bot: 'linda',
desc: `Get an invite you Germans area.`,
allowed: ['wmantly', 'useless666', 'tux4242', 'owenshorts', 'VinceNL', 'Ethan63020', 'Ethan63021', 'pi_chef', 'YTMatze', 'mytzor', 'pi_chef', '1_cut', 'nootbot'],
allowed: ['wmantly', 'useless666', 'tux4242', 'owenshorts', 'VinceNL', 'Ethan63020', 'Ethan63021', 'pi_chef', 'YTMatze', 'mytzor', 'pi_chef', '1_cut', 'nootbot', 'Lost_Imback',],
},
}

View File

@ -10,7 +10,7 @@ const customerSlots = [5, 6, 7, 8, 14, 15, 16, 17, 23, 24, 25, 26];
function findChestBySign(bot, text){
let sign = bot.bot.findBlock({
useExtraInfo: true,
// maxDistance: 1,
maxDistance: 32,
matching: (block)=> {
if(block.name.includes('sign') && block.signText.includes(text)){
return true;
@ -49,7 +49,7 @@ module.exports = {
this.bot.closeWindow('window');
this.bot.removeAllListeners('windowOpen');
this.whisper(from, `I have things to do, I cant wait on you all day!`)
}, 30000);
}, 120000);
// Check to see if the remote user has agreed to the trade.
let confirmationCheck = setInterval(async ()=>{
@ -64,15 +64,30 @@ module.exports = {
// If the trade took so long it timed out, just kill the whole thing.
if(timeoutCheck._destroyed) return;
console.log('clearing timeout');
clearTimeout(timeoutCheck)
// Give MC a moment
await sleep(1000);
// await sleep(1000);
let goBack = await this.goToReturn({where: chestBlock, reTry: true})
let isPutAway = await this.dumpToChest(chestBlock)
await goBack();
await this.whisper(from, `I put ${isPutAway ? 'all' : 'some'} items in your chest.`);
}
},
'test': {
desc: 'go away',
allowed: ['useless666'],
async function(from){
let chestBlock = findChestBySign(this, from);
}
}
}

View File

@ -21,11 +21,16 @@ for(let name in conf.mc.bots){
}
bot.on('onReady', async function(argument) {
inventoryViewer(bot.bot);
// inventoryViewer(bot.bot);
await sleep(1000);
bot.bot.setControlState('jump', true);
console.log(bot.bot.entity);
setTimeout(()=> bot.bot.setControlState('jump', false), 5000)
})
// bot.on('message', function(...args){
// console.log('message | ', ...args)
// })
}
(async ()=>{