Create core.lua
This commit is contained in:
parent
a4db7f7314
commit
639ed1c87e
|
@ -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
|
Loading…
Reference in New Issue