Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local shield = peripheral.find("warpdriveForceFieldProjector")
- local state = true
- -- initial message
- print("Redstone Control Online, Press C to Configure")
- while true do
- os.sleep(0.5)
- local event = os.pullEvent()
- if event == "redstone" then
- if state == true then
- shield.enable(true)
- state = false
- else
- shield.enable(false)
- state = true
- end
- elseif event == "key" then
- local _, key = os.pullEvent("key")
- -- keys are represented by numbers, the number for 'C' is 46
- if key == 46 then
- print("C key pressed, running 'conf' script...")
- shell.run("conf")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement