Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SquidDev-CC/copy-cat
A ComputerCraft emulator for the web
https://github.com/SquidDev-CC/copy-cat
computercraft emulator
Last synced: about 1 month ago
JSON representation
A ComputerCraft emulator for the web
- Host: GitHub
- URL: https://github.com/SquidDev-CC/copy-cat
- Owner: SquidDev-CC
- License: mit
- Created: 2019-04-27T11:04:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-11T19:13:52.000Z (3 months ago)
- Last Synced: 2024-09-12T05:31:18.928Z (3 months ago)
- Topics: computercraft, emulator
- Language: TypeScript
- Homepage: https://copy-cat.squiddev.cc/
- Size: 1.46 MB
- Stars: 40
- Watchers: 3
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-computercraft - Copy Cat - A CC:T emulator that runs in a web browser. (Non-Lua programs / Emulators)
README
# Copy Cat
[Copy Cat][copycat] is a ComputerCraft emulator for the web, heavily inspired by
the a similar project [Mimic][mimic]. However, unlike Mimic, it's built from the
mod's source code - ensuring that it's always 1 as accurate as
possible.The interface is essentially the same as [Cloud Catcher][cloud], but with the
computer running right in your browser rather than a server!---
1. While we try to keep as close as we can, there are some elements
which are impossible to emulate due to the restricted environment of a browser.For instance, the `http` API has been entirely recreated, and some functionality
(such as setting specific headers or requesting some sites) is not possible. As
with any emulator, there will be subtle differences in how input events (key
presses, mouse clicks, etc...) are handled, so do not rely on our behaviour.And yes, this disclaimer was longer than the actual description.
## Screenshots
![The emulator in action](img/startup-url.png "The emulator in action")![Editing a file](img/editor.png "Editing a file")
## Embedding
It's possible to embed copy-cat within another website. This may be useful if
you want to show off your programs on their own site.```html
// Tell requirejs to load copycat/* from the website.
require.config({ paths: { copycat: "https://copy-cat.squiddev.cc/" } });
// Find our #embed-computer element and inject a computer terminal into it.
require(["copycat/embed"], setup => setup(document.getElementById("embed-computer")));```
The setup function also accepts several arguments, which are demonstrated in
[this example](src/web/example/index.html).## Build it yourself
Due to the nature of this project, Copy Cat has a rather strange build setup. We
take sources of [[CC: Tweaked][cct], modify them to work in a Javascript
environment, and then compile them to JS. Thankfully, this is all automated by
Gradle. However, it does require a bit of setup:Before getting started, you will need the JDK (Java Development Kit), and NodeJS
installed and on the path.- Clone Copy Cat with submodules: `git clone --recursive https://github.com/SquidDev-CC/copy-cat`
- Install NodeJS packages: `npm install`
- Build: `./gradlew assemble`. You can also automatically build everything when
a file changes using `./gradlew assemble --continuous`.The resulting website should be in `build/web`.
Use `git submodule foreach git pull` in order to update all source repositories.
You will probably need to apply and then regenerate patches after doing so.[copycat]: https://copy-cat.squiddev.cc "Try Copy Cat online"
[mimic]: https://gravlann.github.io/ "The Mimic ComputerCraft emulator"
[cloud]: https://github.com/SquidDev-CC/cloud-catcher "The Cloud Catcher repository"
[cct]: https://github.com/cc-tweaked/CC-Tweaked "The CC: Tweaked repository"