squiddev-cc / copy-cat Goto Github PK
View Code? Open in Web Editor NEWA ComputerCraft emulator for the web
Home Page: https://copy-cat.squiddev.cc/
License: MIT License
A ComputerCraft emulator for the web
Home Page: https://copy-cat.squiddev.cc/
License: MIT License
Well, I tried accessing this project, and it seems it doesn't work on Safari or my Kindle. Only on my iPad which is weird. On my kindle it says there isn't a secure connection while my iMac says cannot connect to server. I need help.
also, the side bar locks up completely (even the cog and i at the bottom), refreshing the page is a workaround though.
The emulator still works, until you try to interact with those folders (this is me redownloading the files)
the command is this wget run https://raw.githubusercontent.com/Lupus590-CC/LuaStoned/master/bootstrap.lua
here is a link to the file with the current commit (because I'm expecting that to change), the other files are not run or used in any way other than being downloaded
clean.lua for convinience
fs.delete(".luastoned")
fs.delete("startup/0_lua_stoned.lua")
It would be nice to be able to define the indentation settings.
It would be nice if copy cat would merged folders when unzipping uploaded files if the zip contains only one folder with the same name as the zip file at its root.
term.setPaletteColour
does not render the modified palette. Connecting to cloud-catcher renders it as expected, so it's not an issue on the Java/Lua end.
Edit: OK, this may only be an issue with white! Not quite sure.
Mobile keyboard does not work. Not sure if a physical one does.
Our resources make up ~700KiB of the main bundle. While they do compress well, I wonder if we should split them into a separate file (i.e. just a JSON dump of the file's contents). This might mean we can update the resources without having to recompile all of TeaVM, which might result in better caching.
This is a bit of a wacky idea and somewhat inspired by this CC:T issue.
I think
So what if you could go to the cloud catcher URL with ?computer_data=<url>
, and it would use that given URL as a source for the filesystem of the emulated computer.
Some issues I'm aware of:
fs.list
, wouldn't really work here.
.cloud-catcher-files
at root, use this to download files locally, ..., profit?Now, this isn't a complete solution for documentation. You don't want to load a web page, spin up a Lua VM, and start an emulator, just to see how to use a particular function. This is more for looking at the docs of a system, potentially interactively if the system lets you. I think it would open up a possibility and give an incentive to developers to give their programs really good in-game docs, which is beneficial for everyone.
Intended use:
For documentation, [run
myproject help
](cloud-catcher-url?computer_data=https://myproject.what/.../computer)
Alternatively, see the wiki for a reference to all functions.
...
<screenshots>
[You can also run these live](cloud-catcher-url?computer_data=https://myproject.what/.../demos)
This is very much a "feedback wanted"/"suggestion" issue... I don't know if it's feasible or even particularly useful. I just had "I wish I could do this" moment. I guess the biggest counter to this is "emulators and pastebin run ...
", which I'll be honest is a pretty good alternative, just not quite as slick, easy, or accessible in my opinion.
We currently have a Resources.java
file which is manually generated every time we update CC: Tweaked.
Ideally this could be done as part of the applyPatches
task. It should just be a matter of listing all resources and concatenating some strings.
Maybe we should have some have some tests for this...
Mostly intended for cc-tweaked/CC-Tweaked#982 - we really just need speaker.playAudio
, I think anything else is going to be too messy to implement (what does it mean to implement modems when there's only one computer?).
Performance of the Lua VM is iffy at best, poor at worst. It'd be nice to do some profiling and see what, if anything can be improved.
A couple of things possibly worth trying
We could also try using JSweet, JWebAssembly or Bytecoder, and see if they have any differences in performance. Not sure how production ready either of these are though...
The if condition in access.ts
is inverted, meaning we delete the children if there are no children. This is probably incorrect.
copy-cat/src/web/ts/computer/access.ts
Lines 85 to 89 in 6d30483
Like SquidDev-CC/cloud-catcher#1, this is probably going to end up with a lot of unchecked items. But it's a start.
web-min
package, with minified CSS and JS.index.html
.Exposing the dom to a copy-cat instance as a peripheral could allow to have essentially a lua runtime running on the background, and coding a webpage in lua instead of javascript
It should be enough to add width/height configuration options to the CC config, and then resize whenever such options change.
It appears that the demo CORS anywhere server is due to close soon (Rob--W/cors-anywhere#301). We really should have done this from the get-go, but we really should switch to a more long-term, non-demo proxy.
There's a couple of options here:
The last of those seems the most attractive.
I don't know if this is known or not, but copy-cat can't receive special characters like ร and drawing characters. I don't know what characters exactly it can't receive but at least those. They just get replaced by "?". (they work/print fine when they're backslash codes though so it's not the font)
The problem with using copy-cat for tweaked.cc is that often the emulator doesn't support the latest documented features. For instance, we don't support cc-tweaked/CC-Tweaked@4b09887, despite that being two weeks old now!
The alternative would be to move the TeaVM patches to their "actual" project:
projects/web
folder. tweaked.cc should then consume the output of that, rather than relying on copy-cat's embedding functionality.This however, does have some possible issues/caveats:
@LuaFunction
generation). Is that out of scope?Other options:
Do nothing.
Update copy-cat's build process to provide the ROM as a separate bundle. tweaked.cc could then provide the "latest" ROM instead. This does mean the emulator may entirely break in some cases as the Java code lags behind - something to be careful of!
Refactor CC:T to avoid our reliance on patches. This should definitely be better post-cc-tweaked/CC-Tweaked#1205 and related refactors, but some things are still painful.
That said, refactoring some bits will be hard:
ComputerThread
and TimeoutState
are pretty tightly coupled, and CobaltLuaMachine
has a heavy reliance on TimeoutState
- not sure how to solve that.HTTPAPI
is very reliant on Netty, and I don't think we can ever fix that. Maybe we're better off just replacing the whole HTTP API.As mentioned in #24, there's no way to disable (or change) the CORS proxy. We should probably export some configure
method from the embed interface which allows setting/changing the various config options.
Similar to how CC:T works!
This is mostly intended for embedded copy-cat (so, tweaked.cc). On the main site, you can drag-and-drop to the sidebar instead.
Possible we can get away with implementing this on the CC:T side - worth looking into.
I think this would be a cool idea to add, a user makes a custom rom then the emulator runs the custom rom.
When running fs.move("a","b") i get the error "lua[5]:1: Cannot move files", this also happens if i run "mv a b" in the shell but with the error "/rom/programs/move.lua:38: Cannot move files"
Steps to reproduce this issue:
Okay so I'm on mobile and I'm not sure what I did but I somehow removed rom. Also it'd be great if the filesystem on the left could be turned off because 1. its in the way and 2. its probably how I removed rom.
copy-cat.squiddev.cc-1561388719529.log
Log is Google chromes JavaScript console output, I think
This behavior may break functionality of programs such as benchmark tests, clocks, etc.
I believe that this could easily be fixed by wrapping the UTC clock with division or multiplication.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.