This commit is contained in:
2026-07-12 17:26:59 -04:00
parent 60663b8d4a
commit ba1bef8ff9
25 changed files with 158880 additions and 1529 deletions
+15 -7
View File
@@ -55,8 +55,9 @@ module.exports = {
}
}
// Confirm and log trade
this.bot.moveSlotItem(37, 37);
// Confirm and log trade — single left-click (moveSlotItem's
// pickup+putdown pair trips anti-cheat on cancelled GUI slots)
try { await this.bot.clickWindow(37, 0, 0); } catch (e) { /* ignore */ }
// Wait for trade to complete
await this.once('windowClose');
@@ -91,16 +92,23 @@ module.exports = {
// If the process is taking to long, just stop
let timeoutCheck = setTimeout(()=>{
this.bot.closeWindow('window');
this.bot.removeAllListeners('windowOpen');
try{ this.bot.closeWindow(window); }catch(e){ /* ignore */ }
this.whisper(from, `I have things to do, I cant wait on you all day!`)
}, 120000);
// Check to see if the remote user has agreed to the trade.
// Click once, only while the window is actually open — repeat
// clicks and clicks on closed windows trip anti-cheat.
let confirmed = false;
let confirmationCheck = setInterval(async ()=>{
if(window.containerItems().filter(item => item?.slot == 53)[0].name == 'lime_dye'){
this.bot.moveSlotItem(37, 37);
}
try{
if(confirmed || this.bot.currentWindow !== window) return;
const indicator = window.slots[53];
if(indicator && indicator.name === 'lime_dye'){
confirmed = true;
await this.bot.clickWindow(37, 0, 0);
}
}catch(e){ /* window may have closed */ }
}, 500);
// Clean up when the trade is done