Mimic - ComputerCraft Web Emulator (HTML5)
1lann 25 Feb 2014
Mimic Web Emulator
Version 1.0
Hi
So full release of Mimic, GravityScore's and my web emulator written in JavaScript using HTML5
Use it here!
Features
- Full ComputerCraft emulator in your web browser
- CC 1.63 support
- Mobile (iOS and Android) support
- Edit files easily in browser using Ace (stripped out version of Sublime Text in JS)
- Persistent filesystem
- Save screenshots
- Download files
- Startup scripts! Demo your own CC programs to others through just one click! Let Mimic load your program from Pastebin and run it automatically
- Auto save while editing files
- Pasting support
- Control T, S, and R, as well as corresponding buttons
- Fullscreen mode
- Hierarchical, collapsable file sidebar
- Startup scripts can't use the shell API yet
- Screenshots seem to capture past images of the terminal
- Files sometimes destroy empty lines at the end of them
- Files download multiple times when clicking the download button
- The drop down menu moves behind the computer depending on the screen size
- http.post doesn't work at all
- Redstone API isn't implemented
- No storage size limit
- Haven't tested on Android yet, only iOS
- Oh I broke pasting just then...
Spoiler
Spoiler
Spoiler
Link
Here!
Edited by 1lann, 07 June 2014 - 09:11 PM.
gamax92 25 Feb 2014
I think the concept is a great idea. A web emulator prevents the problems caused by having to install software, since some environments don't allow you to. It's also a quick way to go test something in CC and for me, runs faster than real CC.
I'll just put a list of problems, please don't feel overwhelmed, its just things I've ran into before with my own emulator.
The ones with a * are kinda just "It doesn't matter if you fix this or not."
Edited by gamax92, 25 February 2014 - 10:05 AM.
I'll just put a list of problems, please don't feel overwhelmed, its just things I've ran into before with my own emulator.
The ones with a * are kinda just "It doesn't matter if you fix this or not."
Spoiler
Edited by gamax92, 25 February 2014 - 10:05 AM.
awsmazinggenius 25 Feb 2014
I like the concept of an in-browser CC emulator. Maybe, just maybe, it will work with iPad Air + Chrome App.
Note that I would have the first post if my WiFi signal wasn't cut off by me microwaving something :/
EDIT: Lua instead of LuaJ?
Edited by awsmazinggenius, 25 February 2014 - 10:07 AM.
Note that I would have the first post if my WiFi signal wasn't cut off by me microwaving something :/
EDIT: Lua instead of LuaJ?
Edited by awsmazinggenius, 25 February 2014 - 10:07 AM.
LDShadowLord 25 Feb 2014
My only complaint is that when I type on it (I use a UK keyboard...because i'm from the UK...) it defaults to the US keyboard so instead of typing Shift+2 for " I have to type Shift+# for ". Which is kinda irritating, any way to put in localisation? Or detect what keyboard is being used or something? Other than than, great job
1lann 25 Feb 2014
gamax92, on 25 February 2014 - 10:03 AM, said:
- snip -
LDShadowLord, on 25 February 2014 - 10:45 AM, said:
My only complaint is that when I type on it (I use a UK keyboard...because i'm from the UK...) it defaults to the US keyboard so instead of typing Shift+2 for " I have to type Shift+# for ". Which is kinda irritating, any way to put in localisation? Or detect what keyboard is being used or something? Other than than, great job
Also it does run on Android (Tested on Chrome on a Nexus 5, but you can't use keyboard inputs), so I'm sure it can run on Chrome on an iOS device, though I don't have one to test on.
Also for those wondering, the Lua engine I'm using is this: https://github.com/l...-com/lua5.1.js/
Edited by 1lann, 25 February 2014 - 11:13 AM.
6677 25 Feb 2014
1lann, on 25 February 2014 - 11:12 AM, said:
Also it does run on Android (Tested on Chrome on a Nexus 5, but you can't use keyboard inputs), so I'm sure it can run on Chrome on an iOS device, though I don't have one to test on.
On the plus side, I decided to see what happens when you use internet explorer 11 on windows 8.1 simply because you said IE was unsupported. It seemed to work and then internet explorer intercepted my pressing of the backspace key as a cue to go back to my homepage.
I normally use chrome, but I personally find that IE10 and 11 dont deserve the poor rep IE has gained over the years, chrome is still better but they are at least serviceable browsers now.
amtra5 26 Feb 2014
Damn, beat me to it
Good work though.
Also, this could be the very first truly cross platform emulator...
Good work though.
Also, this could be the very first truly cross platform emulator...
oeed 26 Feb 2014
How does this differ from GravityScore's standalone(ish) version?
https://github.com/GravityScore/Mimic
GravityScore's has pretty much everything implemented, why the change?
Anyway, it's really nice to be able use it in browser, although I'd recommend releasing a standalone version (you could just make a Java WebKit viewer).
Also, for me the text in white is a little blurry, but error messages are fine.
Using OS X 10.9, Chrome 33
https://github.com/GravityScore/Mimic
GravityScore's has pretty much everything implemented, why the change?
Anyway, it's really nice to be able use it in browser, although I'd recommend releasing a standalone version (you could just make a Java WebKit viewer).
Also, for me the text in white is a little blurry, but error messages are fine.
Using OS X 10.9, Chrome 33
awsmazinggenius 26 Feb 2014
1lann 26 Feb 2014
oeed, on 26 February 2014 - 05:53 AM, said:
How does this differ from GravityScore's standalone(ish) version?
https://github.com/GravityScore/Mimic
GravityScore's has pretty much everything implemented, why the change?
Anyway, it's really nice to be able use it in browser, although I'd recommend releasing a standalone version (you could just make a Java WebKit viewer).
Also, for me the text in white is a little blurry, but error messages are fine.
https://github.com/GravityScore/Mimic
GravityScore's has pretty much everything implemented, why the change?
Anyway, it's really nice to be able use it in browser, although I'd recommend releasing a standalone version (you could just make a Java WebKit viewer).
Also, for me the text in white is a little blurry, but error messages are fine.
GravityScore's used Node-Webkit, a standalone implementation of Node.js and Chrome (basically). Gravs used Node.js libraries, including one that allowed him to run Java from it, which is how he did his emulator, through Java. Whereas mine can run straight in the browser with JavaScript. They're 2 completely different approaches in fact. I have to re-write the entire mod from scratch, whereas Gravs doesn't. Also it's blurry because I cannot disable anti-aliasing of fonts for canvases. The color red is actually in fact anti-aliased, its just that it's so close to the color black you don't notice it. I set the font size to a size that reduces the anti-aliasing effect as much as possible. Grav's version did not have this problem, as he used images instead of a font to display on the canvas, which can have anti-aliasing disabled when drawing.
Also Node-Webkit is a standalone website (Chrome renderer) viewer. So I can just use that as a standalone version.
awsmazinggenius, on 26 February 2014 - 05:59 AM, said:
I realize that, but LuaJ is kinda what CC uses, so I thought me might as well use that (link with CC.jar to get it, or though some other way.)
Edited by 1lann, 26 February 2014 - 07:46 AM.
GravityScore 26 Feb 2014
Just to clarify, my JS emulator started a separate Java process and communicated with it through std in/out.
oeed 26 Feb 2014
1lann, on 26 February 2014 - 07:45 AM, said:
oeed, on 26 February 2014 - 05:53 AM, said:
How does this differ from GravityScore's standalone(ish) version?
https://github.com/GravityScore/Mimic
GravityScore's has pretty much everything implemented, why the change?
Anyway, it's really nice to be able use it in browser, although I'd recommend releasing a standalone version (you could just make a Java WebKit viewer).
Also, for me the text in white is a little blurry, but error messages are fine.
https://github.com/GravityScore/Mimic
GravityScore's has pretty much everything implemented, why the change?
Anyway, it's really nice to be able use it in browser, although I'd recommend releasing a standalone version (you could just make a Java WebKit viewer).
Also, for me the text in white is a little blurry, but error messages are fine.
GravityScore's used Node-Webkit, a standalone implementation of Node.js and Chrome (basically). Gravs used Node.js libraries, including one that allowed him to run Java from it, which is how he did his emulator, through Java. Whereas mine can run straight in the browser with JavaScript. They're 2 completely different approaches in fact. I have to re-write the entire mod from scratch, whereas Gravs doesn't. Also it's blurry because I cannot disable anti-aliasing of fonts for canvases. The color red is actually in fact anti-aliased, its just that it's so close to the color black you don't notice it. I set the font size to a size that reduces the anti-aliasing effect as much as possible. Grav's version did not have this problem, as he used images instead of a font to display on the canvas, which can have anti-aliasing disabled when drawing.
Also Node-Webkit is a standalone website (Chrome renderer) viewer. So I can just use that as a standalone version.
awsmazinggenius, on 26 February 2014 - 05:59 AM, said:
I realize that, but LuaJ is kinda what CC uses, so I thought me might as well use that (link with CC.jar to get it, or though some other way.)
Oh, I see. So apart from the name they're basically completely different.
1lann 26 Feb 2014
oeed, on 26 February 2014 - 08:19 AM, said:
Oh, I see. So apart from the name they're basically completely different.
Edited by 1lann, 26 February 2014 - 10:48 AM.
Shazz 27 Feb 2014
Ir7_o, on 27 February 2014 - 12:51 PM, said:
Very cool but a major risk of cross site scripting?
All the code is executed within a Lua VM. As long as the 'native' APIs (term, fs, etc.) are coded properly then it's fine. Also, there is really nothing damaging that you can achieve with cross site scripting in this case.
1lann 27 Feb 2014
MostwantedRBX 19 Mar 2014
Works very well, even without the other APIs. One thing that annoys me: There is no cursor movement functionality, but that isn't needed really in a Lua prompt. However, I think it'd be a great if you added the up arrow on the keyboard to access previously submitted code, just an idea. I think you are on the right track, though. Great job!