Giter VIP home page Giter VIP logo

mineflayer-gui's Introduction

mineflayer-gui's People

Contributors

firejoust avatar nlanson avatar rider21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mineflayer-gui's Issues

advanceWindow() not working on Unix

Any idea why advanceWindow() is working perfectly when I run a mineflayer bot on Windows (navigating through an in-game gui), but when I run the same bot on my Unix VM (same node, npm, mineflayer, and mineflayer-gui versions), the advanceWindow() method seems to time out.

await new bot.gui.Query()
    .window(window)
    .matchBy('slot')
    .advanceWindow(12)
    .then(q => {
        return q.matchBy('slot').advanceWindow(15);
    })
    .then(q => {
        return q.matchBy('slot').mouseButton('left').clickItems(32);
    });
bot.closeWindow(window);

Classes imported from javascript returning undefined

When importing the library and referencing a class, it returns undefined.

/Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:184
                        assert_1.default.ok(path.length > 1 || !(path[0] instanceof prismarine_windows_1.Window), "Path must include at least one item.");
                                                                         ^

TypeError: Right-hand side of 'instanceof' is not an object
    at plugin.<anonymous> (/Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:184:74)
    at step (/Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:33:23)
    at Object.next (/Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:14:53)
    at /Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:4:12)
    at plugin.retreiveItem (/Users/mezza/Documents/GitHub/mineflayer-GUI/dist/index.js:178:16)
    at Object.<anonymous> (/Users/mezza/Documents/Mineflayer/GUI/gui_bot.js:11:5)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)

It doesn't work...

Hello. I have had so much trouble trying to click on a item in a window (in my case a gui for joining games) and I just can't do it so when I was searching for solutions I found this plugin, which game me a lot of hope. I tried this:

            bot.setQuickBarSlot(3);
            bot.activateItem();
            let game_selector = {
                type: `diamond_sword`, // The type of an item
                options: {
                    include: true, // Whether or not to check if an item includes a value rather than equating to it (Default: true)
                    delay: 450, // How long in milliseconds to wait before clicking an item (Default: 0)
                }
            }
            setTimeout(async () => {
                await bot.gui.clickItem(game_selector);
            }, 4000);

but it doesn't work (I also tried without settimeout and I tried to console log the result and its null..) and I know that the gui does open after the 2nd line and I know there is a diamond sword in this first gui. Please help me I am having so much trouble with this project..

EDIT: I tried it with name not type now and I think I got progress but still I have an issiue...
image
(The first error is a console.log from bot.on("error...)

Example is wrong

This line dose not work as it dose not make any sense.

await bot.once("windowOpen", response => window = response);

EventEmitter.prototype.once returns an instance of EventEmitter not a promise. await on a none promises dose nothing.

If the intent was to wait for the window to open before continuing you would write something like this

bot.once("windowOpen", (window) => {
  ...
})

or import once from the event api with const { once } = require('events') and using it like so

const [window] = await once(bot, 'windowOpen')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.