Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Copyright 2015 Max Thor <thormax5@gmail.com>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- --]]
- for k, v in pairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- rednet.open(v)
- end
- end
- local w, h = term.getSize()
- function cPrint(sText, y)
- local x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
- term.setCursorPos(x, y)
- print(sText)
- end
- function cWrite(sText, y)
- local x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
- term.setCursorPos(x, y)
- term.write(sText)
- end
- function main()
- term.clear()
- cPrint("Music DJ", 2)
- cPrint("-------------", 3)
- cPrint("1: Far", 5)
- cPrint("2: Chirp", 6)
- cPrint("3: Strad", 7)
- cPrint("-------------", 9)
- cWrite("> ", 11)
- local tune = read()
- rednet.send(268, tune)
- main()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement