firejoust / mineflayer-gui Goto Github PK
View Code? Open in Web Editor NEWManage nested GUI windows in mineflayer using a high level API
License: MIT License
Manage nested GUI windows in mineflayer using a high level API
License: MIT License
They have different lore, but I cant find any method for it :(
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);
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)
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...
(The first error is a console.log from bot.on("error...
)
This line dose not work as it dose not make any sense.
mineflayer-GUI/examples/simple.js
Line 50 in 1510c62
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')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.