Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- All of these are capactitors hooked up to the deisel
- -- generator from immersive engineering, one for each
- -- output post provided. Then, each capacitor is hooked to
- -- a computer with a wired modem and network cable running
- -- this program.
- -- Written for Forgecraft the Modpack 1.1.1 (minecraft 1.7.10)
- -- it's best to verify the names of the caps in the interactive
- -- lua shell with the command:
- -- peripheral.getNames()
- leg1,leg2,leg3 = nil
- modem = peripheral.wrap("top")
- modem.open(3)
- samplingTimer = os.startTimer(1)
- while true do
- event = os.pullEvent()
- if event == "timer" then
- leg1 = peripheral.call("immersiveengineering_capacitorhv_1","getStoredEnergy")
- leg2 = peripheral.call("immersiveengineering_capacitorhv_2","getStoredEnergy")
- leg3 = peripheral.call("immersiveengineering_capacitorhv_3","getStoredEnergy")
- -- I listen for the capacitor readings on another computer so I string them together
- -- and put them on the network (space delimited)
- modem.transmit(3,3,leg1.." "..leg2.." "..leg3)
- --Then we set another timer and do it again in 1 second
- samplingTimer = os.startTimer(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement