ottomated / turtle-gambit

[OLD] code to connect to minecraft turtles
234 stars 64 forks source link

Function window.refreshData is not a function: Error #7

Closed AuroraBee closed 3 years ago

AuroraBee commented 3 years ago

TypeError: window.refreshData is not a function image image

derrickmehaffy commented 3 years ago

Copying my comment from the old issue:

@Rick1029 I have an open fork that I can take some PRs on, though undecided if I want to act as a core maintainer. If someone else wants to take maintainership it might be better.

https://github.com/derrickmehaffy/turtle-gambit

Myoozik commented 3 years ago

I have found a way to remedy the problem that you can see below.

TypeError: window.refreshData is not a function image

When running the command "yarn dev" in ./turtle-gambit-master/ with the frontend also running (use command "yarn dev' as well in ./turtle-gambit-master/frontend/ ) a popup application window will appear. It will load the frontend and if no turtles are connected the screen it will stay blank. If you try to then access https://localhost:3000 in a browser it will return an error because the frontend is not loaded in a Carlo application instance where the exposed function refreshWindow() is accessible to ./turtle-gambit-master/frontend/pages/index.ts.

Below: Code snippet of the exposed carlo window refreshWindow() function.

image

In order to get turtles connected to the backend/frontend interface via WS I have used ngrok a proxy/tunneling software that Ottomated used in his streams.

To use ngrok:

  1. Download ngrok from https://dashboard.ngrok.com/get-started/setup and signup.
  2. Once ngrok is setup, run this command "ngrok http (PORT)" where the port number is the one being used in ./turtle-gambit-master/src/index.ts line 9. image
  3. In ./turtle-gambit-master/turtle/startup.lua edit where it says >http.websocket("(ADDRESS)") image

    to the URL that ngrok gives you upon executing the aforementioned command image but changing the protocol from http or https to WS so it'll become ws://2c44c8bc3928.ngrok.io

  4. Save the lua file and copy it into the turtle or put it on pastebin for the turtle to access that way.
AuroraBee commented 3 years ago

@Myoozik mind making this easier to understand? i literally understood half of it, and im still getting the same error, ngrok is set-up and all the files changed accordingly.

AuroraBee commented 3 years ago

oh, i am just stupid; duh. you need to:

  1. run "yarn dev" in Turtle-Gambit\frontend\
  2. run "yarn dev" in Turtle-Gambit\

step 1. starts the Frontend by itself. step 2. opens a Chrome window using said Frontend, thus not causing this error. the rest: install ngrok, do above steps.

Myoozik commented 3 years ago

Yes, sorry for my lack of communication.

Step 1: Generates the views (frontend files) that display the turtle interface. Step 2: The Frontend is then served in a application instance (something of the sort) where certain functions such as the one causing the error above are not void, accessible to be called.

AuroraBee commented 3 years ago

this issue is done, if someone still needs help with this, please make your own issue.

32bitmeterpreterwastaken commented 2 years ago

i cant belive you guys are falling for this ngrok is a virus as virus total says

AuroraBee commented 2 years ago

Oh Dear...

ngrok is NOT a virus, virustotal most likely says it is BECAUSE it opens a imperfectly protected http tunnel between a ngrok website with an obscure address on a port which is usually not for rdp/ssh/http/https. otherwise: there are plenty alternatives, just search for some open source ones and check the code yourself if you dont want to risk installing a "virus"

but i guess you would know something about viruses, having created a password + cookie stealer yourself, watisdakalikffffali.

AND PLEASE: this issue is CLOSED: make your own issue if you have problems!

32bitmeterpreterwastaken commented 2 years ago

the first time someone replyed to me on this repository im suprised