Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Call this program 'startup'
- -- This program needs a second program called 'Broadcast'
- -- This program will send server messages and needs command blocks enabled in both CC and server.properties
- local function CheckVariables()
- if fs.exists("Variables") then
- readData = fs.open("Variables", "r")
- Side = readData.readLine()
- Amount = readData.readLine()
- Repeat = readData.readLine()
- for i = 1, Amount do
- Message[i] = readData.readLine()
- end
- readData.close()
- else
- term.setTextColor(colors.red)
- print("File Variables not found!")
- sleep(5)
- shell.run("Broadcast")
- end
- end
- local function Broadcast()
- Interval = Repeat*60
- commandBlock = peripheral.wrap(Side)
- for i = 1, Amount do
- commandBlock.setCommand("/say "..Message[i])
- commandBlock.runCommand()
- sleep(Interval)
- end
- Broadcast()
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- Message = {}
- CheckVariables()
- print("Now broadcasting messages to the server!")
- Broadcast()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement