mineflayer bot stop lookAt #2810
Unanswered
MrFiend179
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Check setInterval doc, remove interval function
…On Wed, Oct 19, 2022, 19:33 Fiend ***@***.***> wrote:
Ok so Im making a botting app and im using mineflayer library to make the
bot, so the issue is I cant make the bot stop looking at player on the chat
`bot.on('chat', function(username, message) {
if(message === 'look'){
setInterval(()=>{
const entity = bot.nearestEntity()
if (entity !== null) {
if (entity.type === 'player') {
bot.lookAt(entity.position.offset(0, 1.6, 0))
}
}
},50)
}
else if(message === 'stop'){
bot.lookAt();
console.log('stopping')
}`
This is my code idk what am i doing wrong i tried setting the interval to
0 sec on stop message but that also did nothing
—
Reply to this email directly, view it on GitHub
<#2810>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437UFXXYKC5F6TEDEL3LWEAWGJANCNFSM6AAAAAARJLGAWQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
@rom1504 I tried it without |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ok so Im making a botting app and im using mineflayer library to make the bot, so the issue is I cant make the bot stop looking at player on the chat
bot.on('chat', function(username, message) { if(message === 'look'){ setInterval(()=>{ const entity = bot.nearestEntity() if (entity !== null) { if (entity.type === 'player') { bot.lookAt(entity.position.offset(0, 1.6, 0)) } } },50) } else if(message === 'stop'){ bot.lookAt(); console.log('stopping') }
This is my code idk what am i doing wrong i tried setting the interval to 0 sec on stop message but that also did nothing
Beta Was this translation helpful? Give feedback.
All reactions