Ok, It's been too long since the last update, so I decided to make a pre-release of v1.0 to let you try it out and help me find any bugs.
I decided to make 3 different versions, so you can use the one that fits your needs.
Shared Features (for the 3 versions):
Spoiler
- Libs (known as apis in CraftOS) to make programming easier.- Buffered output, the screens redraw at 20 FPS (will add functions to change this later)
- Synchronized output on the terminal and the monitors (using the monitor and output programs)
- Processes and Threads!
Server
The server version has no users, so you don't need to login. It's purpouse is to be used as servers that need to run some programs each time it turns on, like gps towers or network routers/servers. It looks more like CraftOS, but with all the MysticOS libs.
Download: disk files
debug version
WorkStation
WorkStation is like a midpoint between Server and Home versions. You can have multiple users, but it has no gui. Each user can only access it's own files, and passwords are saved as sha256 hashes, so your files should be safe.
Download: disk files
debug version
Home
Home version, for those who don't like the command line. It has an easy to use gui, so you can access and use your programs easier.
It also has multiple users, so your files are safe.
Download: Coming soon…
I need to finish the gui lib before releasing this one, so you'll have to wait.
Installation:
1) Download bios.rar
2) Extract the files and move them to (minecraft_folder)/mods/ComputerCraft/lua/ (it will replace your bios.lua, but you can still use CraftOS).
3) Download the disk file for the version you want.
4) Extract the files and put them on a CC disk. (Create one in the game, and copy the files to (minecraft_folder)/saves/computer/disk/(Disk ID)/)
5) Put the disk on a disk drive, reboot the computer and the setup should appear.
6) Have fun with your new OS ^_^/>/>
Running CraftOS programs:
Spoiler
Most of the programs should work without changes, since most of the apis and functions have the same names.However, there's some things that work different, so you might have to do some changes:
Files:
Spoiler
Most of the fs lib functions will work. The only difference is in opening files, since fs.open returns an instance of the File class, instead of a file handle. So, every method called on the file must use a colon ( : ) instead of a point ( . ):
-- CraftOS
file.readLine()
-- MysticOS
file:readLine()
Also, each time you open a file, instead of checking if the handle is nil, you have to use the isOpen method:
-- CraftOS
local file = fs.open("Path/To/The/File", "mode")
if file then
-- use the file
end
-- MysticOS
local file = fs.open("Path/To/The/File", "mode")
if file:isOpen() then
-- use the file
end
Spoiler
The rednet api is replaced with the net lib. If your program uses rednet, it won't work in MysticOS.The net lib is easier to use than rednet, but it doesn't work with bundled cable.
Some examples of the net lib usage:
-- CraftOS
-- Start connection
rednet.open("side")
-- Stop connection
rednet.close("side")
-- Checking connection
rednet.isOpen("side")
-- Send messages
rednet.send(id, "Message")
rednet.broadcast("Message")
-- Send files
local file = fs.open("Path/To/File", "r")
if file then
rednet.send(id, file.readAll())
file.close()
end
-- Receiving messages
rednet.receive(timeout)
-- MysticOS
-- Start connection
net.connect()
-- Stop connection
net.disconnect()
-- Checking connection
net.isConnected()
-- Send messages
net.send(id, value)
net.broadcast(value)
-- Send files
net.sendFile(id, "Path/To/File")
-- Receiving messages
net.receive(timeout)
As you can see, it detects modems when connecting, so you don't need to specify the side. It even tries to reconnect when the modem is removed from the computer, so if there's another one it will instantly connect.Also, the send and broadcast functions can take any value as the message, not just strings. It automatically serializes the message and sends it, and when receiving it deserializes it and gives the original value back. So you can simply do:
net.connect()
net.broadcast("Hello")
net.broadcast(10)
local t = {}
t.value = 1
t[1] = "a"
t[2] = "b"
net.broadcast(t)
Spoiler
All the http functions are inside the net lib, so you have to use this functions:
net.httpRequest(url[, post])
net.httpGet(url)
net.httpPost(url, post)
They work exactly like the CraftOS http api.Any feedback and suggestions are welcome.
The project is now on GitHub! Feel free to make pull requests if you want to add something.
Changelog:
23/2 2012:
- Beta 1.0 release
- Fixed some bugs in the fs api
26/2 2012:
- Beta 1.1 release
- Fixed minor bugs
- Added colors, Keys, net, peripherals and rs APIs
17/7 2012:
- v1.0 pr1 release
- Rewrite of most apis and core files
- Server and WorkStation versions