turtle-gambit
turtle-gambit copied to clipboard
will you make a tutorial on how to use this amazing piece of code?
will you make a tutorial on how to use this amazing piece of code?
I can give you some pointers, though I am completely unfamiliar with NodeJS, JavaScript and typescript, so I can't help you on the issues you will face. Hopefully someone else with an understanding of JavaScript can provide some insight. This "tutorial" will be mostly aimed at Linux as that's what I use, but I will try to include Windows instructions as well.
Prerequisites
First you need NodeJS, yarn and typescript installed on your system. You will also likely need chrome / chromium, though any web browser might be sufficient - I haven't tested without chromium installed. If you don't want to install npm packages globally, omit the -g
flag from the commands!
For Ubuntu and derivatives
Open me!
You will need to add the yarn repository to your sources. The yarn package included by default in the Ubuntu repos is an outdated version called "cmdtest."
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
The following installs yarn, NodeJS and NPM (the latter two are requirements of yarn, so they are installed as well. If you already have NodeJS and NPM, use the --no-install-recommends flag to prevent yarn from installing NodeJS and NPM.)
sudo apt update
sudo apt install yarn
Now you need to install typescript.
sudo npm install -g typescript
sudo npm install -g puppeteer-core
For Fedora, CentOS and RHEL
Open me!
You can install yarn through yum, just add the repo and install.
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
If you're on CentOS or RHEL, use the following.
sudo yum install yarn
If you're on Fedora, use the following.
sudo dnf install yarn
These should install yarn NPM and NodeJS, but I'm not entirely sure. If you use RHEL systems you should be able to figure out how to install NodeJS yourself, they might be in the yum repo as well - in which case just replace yarn with NodeJS.
Now you need to install typescript and puppeteer core.
sudo npm install -g typescript
sudo npm install -g puppeteer-core
For Windows / macOS
Open me!
You can use the official installers to download NodeJS and NPM. You should use the long term support version, but you can try the latest as well.
Afterwards, open a cmd prompt or terminal and put in the following. You may need to preface with sudo on macOS, and run with admin privileges on Windows.
npm install -g yarn
npm install -g typescript
npm install -g puppeteer-core
Try the above without the -g flag if it fails, I'm unsure if you need to specify global installation on macOS or Windows.
Actually using the program
Now that these are installed, you need to clone this repository. You can either do this by downloading the zip and extracting it from the main page or by using git:
git clone https://github.com/ottomated/turtle-gambit
Place the repo wherever you wish, and cd into the directory.
cd /path/to/cloned/repo/
Now run the following.
yarn
yarn dev
And you're golden. It should launch a web browser with the following link http://localhost:3000 or http://127.0.0.1:3000, which is a link to the program running on your computer. Theoretically, you can now open computer craft, run the startup.lua as Ottomated did in his video (paste turtle/startup.lua onto a pastebin and download it onto a floppy in CC) and it should work!
EDIT: My issue was to do with missing dependencies. I now get a different but smaller error related to puppeteer-core and Carlo. I've put that in at the bottom and added the additional dependencies to install above.
So, I actually haven't gotten it to work. As I said, I'm entirely unfamiliar with NodeJS, just giving you instructions in case you want to figure it out on your own or someone else familiar with NodeJS is kind enough to come along and debug. For those interested, my log is below:
Old Error log
yarn run v1.22.5
$ tsc && node lib/index.js
(node:6115) UnhandledPromiseRejectionWarning: Error: net::ERR_CONNECTION_REFUSED at http://localhost:3000/
at navigate (/home/rick/Documents/turtle-gambit/node_modules/carlo/node_modules/puppeteer-core/lib/FrameManager.js:101:37)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async FrameManager.navigateFrame (/home/rick/Documents/turtle-gambit/node_modules/carlo/node_modules/puppeteer-core/lib/FrameManager.js:75:17)
at async Frame.goto (/home/rick/Documents/turtle-gambit/node_modules/carlo/node_modules/puppeteer-core/lib/FrameManager.js:385:12)
at async Page.goto (/home/rick/Documents/turtle-gambit/node_modules/carlo/node_modules/puppeteer-core/lib/Page.js:662:12)
at async Window.load (/home/rick/Documents/turtle-gambit/node_modules/carlo/lib/carlo.js:347:5)
-- ASYNC --
at Frame.
New Error log
(node:29495) UnhandledPromiseRejectionWarning: Error: Protocol error (Browser.grantPermissions): Unknown permission type: clipboardRead
at /home/rick/Documents/turtle-gambit/node_modules/carlo/node_modules/puppeteer-core/lib/Connection.js:74:56
at new Promise (
So, I actually haven't gotten it to work. As I said, I'm entirely unfamiliar with NodeJS, just giving you instructions in case you want to figure it out on your own or someone else familiar with NodeJS is kind enough to come along and debug. For those interested, my log is below:
You need to navigate to the frontend folder and run yarn
+ yarn dev
or build it and serve it via a webserver like apache/nginx
The error you are getting is it can't connect to the frontend (frontend isn't running the websocket, that's handled by another process, really they two could be built together)
I've done everything here but I keep getting the error "TypeError: window.refreshData is not a function". I can't seem to find the fix to this. Can anyone help me? Thank you.
What system are you running and what version of yarn and NodeJS did you install? (Check with node --version and yarn --version)
I have the same problem. Im using Windows 10 2004 Build 19041.685, Node v14.15.0 and Yarn 1.22.10
I have also checked if its running on Node v12.20.0 Same Error
What system are you running and what version of yarn and NodeJS did you install? (Check with node --version and yarn --version)
I'm using Node v14.15.3 and Yarn v1.22.10
ill try using Node v15.5.0 and see if it fixes the issue
I also tried using 15.5.0 now and it shows the same error for me
What system are you running and what version of yarn and NodeJS did you install? (Check with node --version and yarn --version)
I'm using Node v14.15.3 and Yarn v1.22.10
ill try using Node v15.5.0 and see if it fixes the issue
Node v15.5.0 is not working either
I have some experience in JS and TS but no experience in React or Next.js. From what i can see there is no function called window.refreshData(). The custom window the frontend uses has refreshData() but it's just void and not a function.
if you needed to see the exact error here it is.
I found this block of code in the main .\turtle-gambit-master\src\index.ts (L34-37) that exposes the a refreshData() function on the web app. This might be the function that is trying to be invoked in .\turtle-gambit-master\frontend\pages\index.ts
We should probably open a new issue for this, just to keep things organized for the future - since the maintainer won't. Anyone up to forking and actually implementing edits?
Yeah, imma make a new Issue, maybe someone will find a fix
@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
Yeah, imma make a new Issue, maybe someone will find a fix
New issue for the above bug: https://github.com/ottomated/turtle-gambit/issues/7
See my comment in issue #7 for a fix.
Another part you probably want to do is: Get an empty world.json file. check #8 for this, i actually have no idea how, i only get a matrix error, lemme see if i can reproduce problem.
We definetely need some kind of clear info. I tried setting it up myself, but I faced two errors:
First one being the localhost refusing connecction on port 3000. I opened the port on my local network, not sure what is causing the error (more than probably a failed build) The second error saying that a module called "daterial-ui/core/Typography" cannot be found. However, trying to manually install it using yarn or npm does not work at all. Google does not return anything about this module.
you need to launch the frontend first, go into the /frontend/ folder and run yarn, and then yarn dev. only then go into the root and run yarn dev.
you need to launch the frontend first, go into the /frontend/ folder and run yarn, and then yarn dev. only then go into the root and run yarn dev. …
I actually found out all errors were related because I had the turtle-gambit on my secondary drive rather than the C: drive, moving it actually fixed all of my issues
weird, i actually have everything on my D:\ drive...
and i am using windows aswell, so i do have a C:
but its good that your error is fixed :)
I found this block of code in the main .\turtle-gambit-master\src\index.ts (L34-37) that exposes the a refreshData() function on the web app. This might be the function that is trying to be invoked in .\turtle-gambit-master\frontend\pages\index.ts
any luck on fixing this? this is the last error I have atm
I found this block of code in the main .\turtle-gambit-master\src\index.ts (L34-37) that exposes the a refreshData() function on the web app. This might be the function that is trying to be invoked in .\turtle-gambit-master\frontend\pages\index.ts
any luck on fixing this? this is the last error I have atm
Look at the closed issues. There's already one that was made for this error
See my comment in issue #7 for a fix.
so I have no idea how any of this works and am wondering if someone could help me to get this program started #20
Install the turtle Lua files on the turtle, set it up like how it was setup in the video.
On your pc, install yarn, npm, and NodeJS, this is what I know for the moment, don't have proper tools setup with my right now, but one of the folders you need to run with NodeJS, check documentation for NodeJS, yarn, and npm to find out more.
On Tue, Feb 9, 2021, 12:10 PM MatthewBoi123 [email protected] wrote:
so I have no idea how any of this works and am wondering if someone could help me to get this program started #20 https://github.com/ottomated/turtle-gambit/issues/20
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776211461, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPQOXVRZSVNSPZCPLAVT7DS6GJCNANCNFSM4URNE3JQ .
uhh, man thats quite a bit ago, but you need to run yarn dev in the /frontend/ and root "/" folder, then your side should work. the turtle... you need to open a ngrok tunnel to your localhost on a certain port (maybe 5959, not sure) and edit some line past 100 from "ottomated smth smth" to the ngrok link, which leads to your computers 127.0.0.1, if you are running the turtle on your own computer, you might aswell jut ignore ngrok and put "127.0.0.1" in there instead.
greetings, Cubic Person who is slightly annoyed at having forgotten to turn email notifications off.
Am Di., 9. Feb. 2021 um 21:34 Uhr schrieb Merith [email protected]:
Install the turtle Lua files on the turtle, set it up like how it was setup in the video.
On your pc, install yarn, npm, and NodeJS, this is what I know for the moment, don't have proper tools setup with my right now, but one of the folders you need to run with NodeJS, check documentation for NodeJS, yarn, and npm to find out more.
On Tue, Feb 9, 2021, 12:10 PM MatthewBoi123 [email protected] wrote:
so I have no idea how any of this works and am wondering if someone could help me to get this program started #20 https://github.com/ottomated/turtle-gambit/issues/20
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776211461 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACPQOXVRZSVNSPZCPLAVT7DS6GJCNANCNFSM4URNE3JQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776225188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHNO5DUROLE55YLRTFBMG3S6GL4RANCNFSM4URNE3JQ .
I've tested this, it needs an http server in between the front-end, and the turtle, so you need to use something like ngrok anyways... Idfk why, it just is.
My setup may have gone totally fekked during setup so I may be wrong, but it's what I had to do for it...
On Tue, Feb 9, 2021, 11:50 PM Cuboid404 [email protected] wrote:
uhh, man thats quite a bit ago, but you need to run yarn dev in the /frontend/ and root "/" folder, then your side should work. the turtle... you need to open a ngrok tunnel to your localhost on a certain port (maybe 5959, not sure) and edit some line past 100 from "ottomated smth smth" to the ngrok link, which leads to your computers 127.0.0.1, if you are running the turtle on your own computer, you might aswell jut ignore ngrok and put "127.0.0.1" in there instead.
greetings, Cubic Person who is slightly annoyed at having forgotten to turn email notifications off.
Am Di., 9. Feb. 2021 um 21:34 Uhr schrieb Merith <[email protected]
:
Install the turtle Lua files on the turtle, set it up like how it was setup in the video.
On your pc, install yarn, npm, and NodeJS, this is what I know for the moment, don't have proper tools setup with my right now, but one of the folders you need to run with NodeJS, check documentation for NodeJS, yarn, and npm to find out more.
On Tue, Feb 9, 2021, 12:10 PM MatthewBoi123 [email protected] wrote:
so I have no idea how any of this works and am wondering if someone could help me to get this program started #20 https://github.com/ottomated/turtle-gambit/issues/20
— You are receiving this because you commented. Reply to this email directly, view it on GitHub <
https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776211461
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ACPQOXVRZSVNSPZCPLAVT7DS6GJCNANCNFSM4URNE3JQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776225188 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AQHNO5DUROLE55YLRTFBMG3S6GL4RANCNFSM4URNE3JQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776514969, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPQOXXFIQHRVRU3VTXECW3S6I3F7ANCNFSM4URNE3JQ .
Awesome, thanks!
/ this message was automatically generated by gmail.
Am Mi., 10. Feb. 2021 um 08:53 Uhr schrieb Merith <[email protected]
:
I've tested this, it needs an http server in between the front-end, and the turtle, so you need to use something like ngrok anyways... Idfk why, it just is.
My setup may have gone totally fekked during setup so I may be wrong, but it's what I had to do for it...
On Tue, Feb 9, 2021, 11:50 PM Cuboid404 [email protected] wrote:
uhh, man thats quite a bit ago, but you need to run yarn dev in the /frontend/ and root "/" folder, then your side should work. the turtle... you need to open a ngrok tunnel to your localhost on a certain port (maybe 5959, not sure) and edit some line past 100 from "ottomated smth smth" to the ngrok link, which leads to your computers 127.0.0.1, if you are running the turtle on your own computer, you might aswell jut ignore ngrok and put "127.0.0.1" in there instead.
greetings, Cubic Person who is slightly annoyed at having forgotten to turn email notifications off.
Am Di., 9. Feb. 2021 um 21:34 Uhr schrieb Merith < [email protected]
:
Install the turtle Lua files on the turtle, set it up like how it was setup in the video.
On your pc, install yarn, npm, and NodeJS, this is what I know for the moment, don't have proper tools setup with my right now, but one of the folders you need to run with NodeJS, check documentation for NodeJS, yarn, and npm to find out more.
On Tue, Feb 9, 2021, 12:10 PM MatthewBoi123 [email protected] wrote:
so I have no idea how any of this works and am wondering if someone could help me to get this program started #20 https://github.com/ottomated/turtle-gambit/issues/20
— You are receiving this because you commented. Reply to this email directly, view it on GitHub <
https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776211461
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ACPQOXVRZSVNSPZCPLAVT7DS6GJCNANCNFSM4URNE3JQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub <
https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776225188
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AQHNO5DUROLE55YLRTFBMG3S6GL4RANCNFSM4URNE3JQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776514969 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACPQOXXFIQHRVRU3VTXECW3S6I3F7ANCNFSM4URNE3JQ
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ottomated/turtle-gambit/issues/3#issuecomment-776516332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHNO5AT7KDQXDWYCI6BPWDS6I3RHANCNFSM4URNE3JQ .