Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Copyright 2012 John Paul Alcala
- --
- -- 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.
- local args = { ... }
- local coverOpen=colors.green
- local coverClose=colors.red
- local cableLocation="bottom"
- local controlCover = function(cableLocation, op)
- for i=1,2 do
- redstone.setBundledOutput(cableLocation, op)
- sleep(0.100)
- redstone.setBundledOutput(cableLocation, 0)
- sleep(0.900)
- end
- end
- local open = function()
- if redstone.testBundledInput(cableLocation, coverClose) then
- controlCover(coverOpen)
- else
- print("Nuclear Reactor Cover already opened!")
- end
- end
- local close = function()
- if redstone.testBundledInput(cableLocation, coverClose) ~= true then
- controlCover(coverClose)
- else
- print("Nuclear Reactor Cover already closed!")
- end
- end
- local checkArguments = function()
- local action = args[1]
- local doorType = args[2]
- if action == "open" then
- open()
- elseif action == "close" then
- close()
- end
- end
- -- check arguments
- if #args > 1 then
- checkArguments()
- else
- print("cover [open/close]")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement