Ever feel RedNet is insecure? Use MCMessaging and stop worrying about those wannabe hackers!
This is a platform to send messages to other computers over HTTP (ComputerCraft and OpenComputers).
External Libraries/Services Used:
- PHPUtils (all around personal library)
A LAMP setup is preferred, but you will need a server running PHP 5.6, and MySQL at a minimum.
- Refer to
/config/config.php
to input MySQL credentials. - Refer to the
/mysql
folder for table setups within mcmessaging schema. Run the/mysql/createSchema.sql
file first, then run/mysql/createTables.sql
to create the necessary tables.
The MySQL user only needs SELECT, INSERT, and UPDATE privileges on the mcmessaging schema.
- Put
/lua/OpenComputers/messages.lua
and/lua/OpenComputers/example
in the same directory on an OpenComputer - Run and experiment with the example program
local message = require("message")
for OpenComputers, or os.loadAPI("message.lua")
for ComputerCraft
message.setVerbose(bool)
- Whether or not to print out debug statements as to why a function returned false, default: truemessage.setLogin(id,password)
- Sets login credentials to use in sending/receiving messages. This doesn't validate them.message.getID()
- Returns a valid, and unused ID to register a new computer withmessage.register(id,password)
- Registers a new computer. Returns bool if successful or notmessage.send(toId,message)
- Sends a message to another id. Returns bool if successful or notmessage.getUnreadMessages()
- Returns a table containing all unread messages, or false if there are none
1. Sockets to receive, similar behavior to rednet.receive() in ComputerCraft
2. ComputerCraft implementation
For performance reasons, messages can only be up to 200 characters in length.