Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = { ... }
- local sendPort = [PORT]
- local personID = [ID]
- local commands = {rain = "startRain",
- clear = "stopRain",
- day = "sunrise",
- night = "moonrise"}
- if table.getn(arg) ~= 1 or commands[arg[1]] == nil then
- print("Usage: weather <state>")
- print("Available states: rain, clear, day, night")
- return
- end
- local modem = peripheral.wrap("back")
- local message = personID .. commands[arg[1]]
- modem.transmit(sendPort, 0, message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement