RedYetiDev / blooket.js

Blooket.JS. An API for the Blooket service. This is currently in development.
https://blooket.js.org
1 stars 0 forks source link

Only Works In repl.it, not VSCode | Randomizer Issue #5

Closed Justiniscoding closed 3 years ago

Justiniscoding commented 3 years ago

i was testing this in vscode and i got an error saying it is an invalid pin. i used the exact same script in repl.it and it worked perfectly. why did i get the error.

RedYetiDev commented 3 years ago

Can you please give more information. The issue might be that Visual Studio Code does not allow access to the network. Try running the following snippet and see what is logged

const ws = require("ws");
var socket = new ws("wss://echo.websocket.org")
socket.on("message", function(d) {
console.log(d)
})
socket.on("open", function() {
socket.send("Test Message")
})
RedYetiDev commented 3 years ago

I fixed the comment. (Sorry for accidentally closing the issue)

RedYetiDev commented 3 years ago

Any luck?

RedYetiDev commented 3 years ago

The issue might be a in the Blooket.JS Script. in modules/socket.js, around line 83

var socket = new WebSocket(wss:// ... )

Should be

var socket = new WebSocket(sockets[4])

This issue will be fixed in version 1.2.0

Justiniscoding commented 3 years ago

ok, any plans on when it will be out?

RedYetiDev commented 3 years ago

Later today.

Justiniscoding commented 3 years ago

ok

RedYetiDev commented 3 years ago

I just need to finish up allowing support for the new Tower Defense Game Mode

Justiniscoding commented 3 years ago

yes, that will be hard. i tried it and it is very intuitive. not the best for bots

RedYetiDev commented 3 years ago

Well, The bot is not going to "playing" the game, well, at least not in version 1.2, but it will be giving 1 point to the player each time a question is answered, kind of skipping the whole "defense" concept. This might be changed, but for now, this is what works

Justiniscoding commented 3 years ago

@RedYetiDev line 100 in blooket.js is wrong. It was like that for me because i used .replace(). you have to change it so that each underscore becomes a space. for example: Snowy_Owl should be Snowy Owl

RedYetiDev commented 3 years ago

Will fix, I converted it to a list incorrectly.

RedYetiDev commented 3 years ago

Patched in next update.

Justiniscoding commented 3 years ago

@RedYetiDev Sorry for the delay, i ran it and i got Test Message! in the console

Justiniscoding commented 3 years ago

@RedYetiDev i tested it now it works!

RedYetiDev commented 3 years ago

Odd, The original issue might be caused by the "socket.js" issue

RedYetiDev commented 3 years ago

PS: Sorry that it originally took me 10 hours to give my first response on this issue, I was working on my website and Jekyll Theme. For comments regarding to them, make issues on their repos.

Justiniscoding commented 3 years ago

@RedYetiDev update to the randomized issue: i used game.randomblook() and got unreturned object promise as my blook

RedYetiDev commented 3 years ago

Please resubmit this as a bug report