-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
53 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports=(bot,options)=>{ | ||
let loginTime; | ||
bot.on('spawn',()=>loginTime=new Date); | ||
bot.on('health',()=>{ | ||
if(((new Date)-loginTime)<10000) return; | ||
if(bot.food==20) return; | ||
bot.equip(mcData.itemsByName.cooked_beef.id, 'hand', (err) => { | ||
if (err) { | ||
console.log("LOOKS LIKE I HAVE RUN OUT OF FOOD! err:",err,"health:",bot.health,"food level:",bot.food) | ||
return; | ||
} | ||
bot.consume(err=>console.log("CONSUME ERR:",err)) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports=(bot,options)=>{ | ||
let loginTime; | ||
bot.on('spawn',()=>loginTime=new Date); | ||
bot.on('health',()=>{ | ||
if(((new Date)-loginTime)<10000) return; | ||
if(bot.health>4) return; | ||
bot.chat("AFK session end, health is below 4. disconnecting!"); | ||
console.log('Health too low, disconnecting!'); | ||
bot.quit(); | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports=(bot,options)=>{ | ||
moveTimeout=setTimeout(()=>{}); | ||
bot.on('forcedMove',()=>{ | ||
clearTimeout(moveTimeout) | ||
moveTimeout=setTimeout(()=>{ | ||
if(options.exact) block=bot.findBlock({matching:block=>block.name==options.name}) | ||
else block=bot.findBlock({matching:(block)=>block.name.includes(options.name)}) | ||
if(!block) console.log("BLOCK NOT FOUND!"); | ||
else bot.activateBlock(block); | ||
},5000) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports=(bot,options)=>{ | ||
let switched=false; | ||
bot.on('spawn',()=>{ | ||
if(switched) return; | ||
switched=true; | ||
options.messagesOnJoin.forEach(bot.chat); | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports=(bot,options)=>{ | ||
bot.on('chat',(username,message)=>console.log((new Date).toTimeString(),'CHAT MESSAGE',username,':',message)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters