better trade
This commit is contained in:
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user