Advertisement
Guest User

Untitled

a guest
Jan 26th, 2019
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. const Item=require("prismarine-item")("1.8");
  2. const delay = require('delay')
  3. const mineflayer = require('mineflayer')
  4. const mcData=require("minecraft-data")("1.8.8")
  5.  
  6. const lava=new Item(327,1,0)
  7.  
  8. if (process.argv.length < 4 || process.argv.length > 6) {
  9. console.log('Usage : node echo.js <host> <port> [<name>] [<password>]')
  10. process.exit(1)
  11. }
  12.  
  13. const bot = mineflayer.createBot({
  14. host: process.argv[2],
  15. port: parseInt(process.argv[3]),
  16. username: process.argv[4] ? process.argv[4] : 'echo',
  17. password: process.argv[5],
  18. verbose: true
  19. })
  20.  
  21. bot.once('login', () => {
  22. console.log('Wszedlem na serwer')
  23. delay(1000)
  24. console.log(bot.username)
  25. bot.chat('/login muszka123')
  26. console.log('Proba zalogowania')
  27. delay(1000)
  28. bot.setQuickBarSlot(0)
  29. console.log('Proba zmiany slotu na komapas')
  30. delay(1000)
  31. bot.activateItem()
  32.  
  33. })
  34.  
  35. function checkIfEquipped (err) {
  36. if (err) {
  37. console.log(`cannot`)
  38. } else {
  39. console.log(`can`)
  40. }
  41. }
  42.  
  43. bot.on('windowOpen', (window) => {
  44. console.log('Otworzylem kompas')
  45. bot.moveSlotItem(1,2, checkIfEquipped)
  46. console.log('Wybralem lave ?')
  47. })
  48.  
  49. bot.on('windowClose', (window) => {
  50. console.log('Zamknalem okno')
  51. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement