Git Product home page Git Product logo

mimic's Introduction

Mimic

Mimic is no longer being maintained (if you haven't figured it out already).

No Maintenance Intended

A fully featured emulator for the Minecraft mod ComputerCraft that runs straight in your browser.

Mimic makes use of

  • Emscripten - allowing a direct port of Lua 5.1 into JavaScript
  • asm.js - the engine behind Emscripten
  • lua5.1.js - a library built by Emscripten
  • Jquery - a masterful DOM manipulation library
  • Ace Editor - a pure JavaScript editor
  • Bootstrap - a CSS framework
  • BrowserFS.js - an emulation of the Node.JS filesystem API using LocalStorage and read-only ZIP backends
  • Purl - parsing of URL parameters
  • PrefixFree - removes the need for vendor prefixes in CSS
  • xdRequest - allows cross site HTTP requests
  • FileSaver.js Polyfill - library to download content to the computer
  • Blob.js Polyfill - a FileSaver.js dependency
  • The default rom files that come with ComputerCraft

Credits

License

Mimic is (as of October 2016, now) licensed under The MIT license

Copyright (c) 2016 Jason Chu (1lann) and Bennett Anderson (GravityScore).

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Note this license does not (necessarily) apply for material used in Mimic that we do not own.

lua5.1.js License

lua5.1.js is licensed under the MIT license, shown above.

lua5.1.js: Copyright (c) 2013, LogicEditor <[email protected]>
           Copyright (c) 2013, lua5.1.js authors (see AUTHORS)

Link: lua5.1.js

Emscripten License

Emscripten is licensed under the MIT license, shown above.

Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.

Link: Emscripten

Purl License

Purl is licensed under the MIT license, shown above.

Copyright (c) 2012 Mark Perkins, http://allmarkedup.com/

Link: Purl

mimic's People

Contributors

1lann avatar dmarcuse avatar nevercast avatar richiecakes avatar tyraeis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mimic's Issues

Custom screen sizes

At the moment I'm working on OneCode, it's a bit like XCode in that it will have a drag and drop interface designer.

However, if possible I'd like to be able to have a version (on Mimic) that can run in a larger screen size so the user can see the entire preview as well as the various panels.

Also I'd love it if this can be provided as a URL argument (my concept requires it really) as you've done with Pastebin.

It would also be good for turtle and pocket computer interface testing.

Really sorry if it's already in somewhere, although I couldn't find it.

Modems

After multiple computers has been implemented

filesystem.move doesnt exists

This function gets called on core.js line 93, which causes to let the page hang on the loading page. Please fix this critical error soon :p

I killed it!

Don't ask why I decided to do this... I just did

local file = fs.open( "derp", "w" )
for i = 1, 255 do
    file.writeLine( string.char( i ) )
    sleep( 0 )
end
file.close()

screen shot 2014-07-08 at 9 50 23 pm

coroutine.yield ignores all except its first argument

I noticed that coroutine.resume just returned 1 of the arguments passed to coroutine.yield,
whereas they where all returned when executing in ComputerCraft:
screenshot 215

It turns out that you overwrite the original coroutine.yield and just passing the first argument to the original yield function, so I fixed the issue by catching every additional arguments for coroutine.yield and passing them to nativeYield:
screenshot 216

Other minor discrepancies

gamax92:

os.setComputerLabel should also accept nil
os.clock returns numbers not in steps of 0.05
debug api is there
string.gfind is there
math.mod is there
the bios identifies itself as "CraftOS 1.5", not 1.6
fs.find("*") is not adding "rom"
Invalid characters render as spaces, not question marks.
character 96 (0x60) renders, it should be hidden
Everything is rendered one scaled pixel too low and one scaled pixel too right
Labels are being trimmed
path cleaning cannot handle backslashes properly: fs.combine("a//\//b","") -> "a////b"
Blinking is not every 1/4s

HTTP API

Finishing the HTTP API. Progress will be posted here.

Current progress: HTTP requests work, need to decide on how to implement the wrapper.

State saving

Remembering what state a terminal is in on page load, saving it, and loading it again when the page reloads.
Is this even possible?

iPhone incompatibility?

For some reason, when I use this on my iPhone 5S (Jailbroken 7.0.6), the computer starts out frozen with no blinking cursor. When I tap the screen, this error appears in the developer console:

[Log] Intialization Error:  Redirect object is missing method isColour. (computer.js, line 132)
[Log] Trace:  Redirect object is missing method isColour. (computer.js, line 133)
[Log] Thread closed (computer.js, line 134)
[Error] ReferenceError: Can't find variable: thread
launch (computer.js, line 135)
afterSetup (core.js, line 130)
onload (render.js, line 44)
[Log] Error:  cannot resume non-suspended coroutine (computer.js, line 185)

I'll try to examine the code and see what's up, but it would be nice to have some support from the people who made the application. :P

(cross posted on ComputerCraft forums)

Mac OSX TextEdit character incompatibility.

Annoyingly enough, TextEdit uses “ instead of ", causing all sorts of errors if I try to test my scripts...

print( string.byte( [[]] ) )
print( string.byte( [["]] ) )

It errors like so in most scripts (not the example since it's in a string, but still ):

string[ "name" ]:ln: unexpected symbol near 

Ctrl Keys

Adding Ctrl + R, S, T and V would be good.

Also, if you do add Ctrl + V, having Cmd + V would be really good to.

Mouse interaction oddities

For the mouse_drag events, the mouse button parameter seems to be shifted down by one. (Left button = 0, right 1, middle 2, instead of left 1, right 2, and middle 3)

Additionally, the context menu still shows on right click.

Edit: You also may want to override control key-combos. Holding ctrl + t spams about 100 new tabs

Redo UI

Not happy with it currently.

Characters >127 show up as blank

In CC, typing an ASCII character with a byte value of over 127 will show up as one (or several) question marks. In the emulator, it shows up completely blank, like a space.

No Rendering in Safari

Safari 7.0.2
OS X 10.9.2

Flashes up with 'Loading...' for half a second but does not progress further.

Console output as follows

[Error] [object Object]
    init (filer.min.js, line 9)
    setup (fs.js, line 26)
    setup (computercraft.js, line 234)
    main (computercraft.js, line 319)
    (anonymous function) (render.js, line 87)

Auto-run a script on page load

So people can link to Mimic in their forum threads, and get people to try out their programs without having to download it. Add a ?pastebin= to the URL, or ?url= for programs not on pastebin.

Tab key also switches focus

Pressing "tab" will sent an event to the emulator, but also change the focus to the next field/anchor/etc

FS API discrepancies

gamax92:

fs.delete will give "Access denied" rather then "Access Denied"
fs api doesn't check for Invalid paths, like ".." or "../something"
fs.move("f","f\a") will succeed and the folder is lost, CC will error "Can't move a directory inside itself"
fs.copy("f","f\a") will succeed and nothing happens, CC will error "Can't copy a directory inside itself"
fs.move will succeed if the first path doesn't exist, CC will error "No such file"
fs.move will succeed if the second path exists and do nothing, CC will error "File exists"
fs.copy will succeed if the first path doesn't exist, CC will error "No such file"
fs.copy will succeed if the second path exists and do nothing, CC will error "File exists"
fs.copy("rom","rom") will succeed, CC will error "Access denied" (Yes, denied is supposed to be lowercase)
fs.move("rom","sdfs") will crash the emulator, CC will error "Access denied"
fs.move("rom","rom") will succeed, CC will error "Access denied"
fs.makeDir will succeed on files, CC will error "File exists"
fs.makeDir will succeed on "rom" or "rom/sda" and do nothing, CC will error "Access Denied"
fs.getFreeSpace returns nothing
fs.getSize always returns 2097152
fs.getDrive does nothing
fs.getName should give "root" if the name is ""
fs.list crashes the emulator if a file is specified
fs.find doesn't clean paths
when cleaning paths, the following characters are dropped: ":<>?|
Incase there is confusion, thats double quote, colon, left triangle bracket, right triangle bracket, question mark, and pipe
fs.getDir should give ".." if the name is ""
when cleaning paths, if your piece is ".." and the stack is empty or the last piece is also a "..", then add it to the stack
fs.find("*") is not adding "rom"

corsproxy

Consider using corsproxy.com to allow http requests to everywhere. For example, requesting google.com does not work even with the weird dynamic script tag thing.

bit API discrepancies

gamax92:

bit api can return negative numbers
bit api will accept numbers larger than (2^32)-1, CC will error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.