Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Call this program 'Broadcast'
- -- it needs a second program to be called 'startup'
- -- This program will ask for messages to send as the server console and needs a command block (enabled in CC and server.properties)
- local function Variables()
- print("Command block will be on which side of the computer?")
- print("left, right, front, back, top or bottom?")
- Side = read()
- print("How many different messages do you want to alternate?")
- Amount = read()
- Message = {}
- for i = 1, Amount do
- print("Message("..i..") to be broadcast?")
- Message[i] = read()
- end
- print("Repeat in minutes?")
- Repeat = read()
- print()
- print("I will broadcast the following messages:")
- for i = 1, Amount do
- print(Message[i])
- end
- print("Interval will be "..Repeat.." minutes.")
- end
- local function StoreData()
- writeData = fs.open("Variables", "w")
- writeData.writeLine(Side)
- writeData.writeLine(Amount)
- writeData.writeLine(Repeat)
- for i = 1, Amount do
- writeData.writeLine(Message[i])
- end
- writeData.close()
- term.setTextColor(colors.red)
- print("Data stored!")
- sleep(5)
- end
- local function Broadcast()
- shell.run("startup")
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- Variables()
- StoreData()
- Broadcast()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement