-
Notifications
You must be signed in to change notification settings - Fork 0
Using Blooket.JS
To join a game using Blooket.js, use the following command:
game.join(PIN,"NAME","BLOOK")This runs the join function, which then connects you to the game.
Throughout the game, blooket.js emits events. For more information on these events, see Events at blooket.js.org
To answer a question, catch QuestionStart like so:
game.on("QuestionStart", function() {
game.answer(game.autocorrect())
})or
game.on("QuestionStart", function() {
game.answer(/* Number 1-4 */)
})The blooket.js package has 3 events only for Gold Quest. Those events are getgold, swap, and steal.
The getgold event is emitted after the correct event. It is emitted to tell you to collect your gold. When this event runs, you NEED to handle it with this function game.getgold(/* 1,2 or 3 */). So, a good example is the one below:
game.on("getgold", function() {
game.getgold(1)
})The swap event is emitted when the prize chosen by game.getgold() is a swap. While handling swap you MUST use the game.swap(/* Player name or example below*/) function, for a better example, see below:
game.on("swap", function(p) {
game.swap(Object.keys(p)[0]) /* This function steals from the first player received from the server. */
})Blooket.JS is by RedYetiDev
License Details
Blooket.JS is licensed under a Creative Commons Attribution 4.0 International License. This means means that you are free to share and adapt this package. BUT you are required to give appropriate credit to me (RedYetiDev), and anyone else you see fit. See the license file for details