Skip to content

runi95/turtle-control-panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle Control Panel

A control panel that lets you monitor and control your ComputerCraft and/or ComputerCraft: Tweaked turtles through a WebSocket connection.

Dashboard

The turtles show up on the dashboard where their online status, activities and fuel consumption can be easily monitored.

Turtle

Clicking on a specific turtle brings you to that turtle's control panel where you can monitor it, change its current activity, manipulate its inventory or simply watch it move around in the world.

The 3D map only shows you what the turtle can see (or have seen) and may not be a realistic interpretation of the world as it may have changed since the last time the turtle inspected the blocks. It is highly recommended to use this control panel along side with Advanced Peripherals as it allows for much more rapid world discovery by utilizing the Geo Scanner peripheral.

Setup

Before you begin make sure that Node.js is installed, then clone the project with git clone and make sure your working directory is within the cloned project.

Server

# Change the working directory
cd server

# Install dependencies
npm install

# Build the server
npm run build

# Start the server
npm start

Or optionally run as dev

# Change the working directory
cd server

# Install dependencies
npm install

# Start the server in development mode
npm run dev

Environment variables (all optional)

  • WSS_PORT - Port for the WebSocket server used by the portal (defaults to 6868)
  • TURTLE_WSS_PORT - Port for the second WebSocket server used by the turtles (defaults to 5757)
  • LOG_LEVEL - Log level for the server (defaults to info). Possible values are: emerg, alert, crit, error, warning, notice, info, debug
  • TURTLE_LOG_LEVEL - Log level for the connected turtles (defaults to INFO). Possible values are ERROR, WARNING, INFO, DEBUG

Portal

# Change the working directory
cd portal

# Install dependencies
npm install

# Start the portal
npm start

Environment variables (all optional)

  • REACT_APP_HTTP_SERVER_URL - URL to use when connecting to the HTTP server (defaults to http://localhost:6868)
  • REACT_APP_WSS_SERVER_URL - URL to use when connecting to the WebSocket server (defaults to ws://localhost:6868)

Turtle

Get the contents of startup.lua onto the turtle. This can be achieved by either uploading the contents onto pastebin and running the pastebin get <code> startup on the turtle itself (recommended) or by copying the contents of the file, running edit startup on the turtle and pasting the content line by line.

Alternatively if pastebin is down you can run the following inside your turtle:

> lua
lua> file = fs.open("startup.lua", "w")
lua> file.write(http.get("https://raw.githubusercontent.com/runi95/turtle-control-panel/master/turtle/startup.lua").readAll())
lua> exit()
> edit startup.lua

NOTE: If you ran the above code, make sure that you edit the first line containing the "connectionURL" variable to the host for the server you're running.

Once the turtle has the correct startup file simply restart the turtle with reboot and it should attempt to connect to your running server.

NOTE: Make sure to edit the connectionURL variable in startup.lua to your own IP address (or server URL). If you want to run this on a local server on localhost then check out this CC:Tweaked guide on Allowing access to local IPs.