Create core.lua

This commit is contained in:
Funey 2015-05-02 20:24:10 +01:00
parent a4db7f7314
commit 639ed1c87e
1 changed files with 44 additions and 0 deletions

44
core.lua Normal file
View File

@ -0,0 +1,44 @@
rednet.open("front")
cmd = peripheral.wrap("left")
term.clear()
term.setCursorPos(1,1)
print("CubeCore v1")
print("Coded by MCFunRide")
print("All Rights Reserved.")
print()
print("Core Ready")
mon = peripheral.wrap("right")
shell.run("bg monitor right mon")
function say(string)
cmd.setCommand("say "..string)
cmd.runCommand()
end
cmd = peripheral.wrap("left")
function command(data)
cmd.setCommand(data)
cmd.runCommand()
end
while true do
local id, message = rednet.receive()
if id == 17 and message == "reboot" then
say("Rebooting...")
sleep(3)
os.reboot()
elseif id == 17 and message == "shutdown" then
say("Shutting down...")
sleep(3)
os.shutdown()
elseif id == 17 and message == "riot" then
cmd.setCommand("sudo @a c:&dヽ༼ຈل͜ຈ༽ノ &aR&bI&cO&dT&e! &dヽ༼ຈل͜ຈ༽ノ")
cmd.runCommand()
elseif id == 17 and message == "cmd" then
command(message)
else
if id == 17 then
say(message)
end
end
end