Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("back")
- local Data = {}
- local Pos = {"rcsteamturbinetile_5" = {1,"right"},"rcsteamturbinetile_4"= {1,"left"},"rcsteamturbinetile_3"= {2,"right"},"rcsteamturbinetile_6"= {2,"left"},"rcsteamturbinetile_7" = {3,"right"},"rcsteamturbinetile_2"= {3,"left"},"rcsteamturbinetile_8" = {4,"right"},"rcsteamturbinetile_1"= {4,"left"},"rcsteamturbinetile_9" = {5,"right"},"rcsteamturbinetile_0"= {5,"left"}}
- modem.open(666)
- function Maj()
- for i =1,#peripheral.getNames() do
- if peripheral.getNames()[i] ~= "back" and peripheral.getNames()[i] ~= "turtle_0" then
- Data[i] = {}
- Data[i]["Side"] = peripheral.getNames()[i]
- Data[i]["Etat"] = peripheral.call(Data[i]["side"],"getTurbineRotorSatus")
- if Data[i]["Etat"] == nil then
- for o = 1,#Pos do
- if Data[i]["Side"] == Pos[o] then
- modem.transmit(666,105,textutils.serialize(Pos[Data[i]["Side"]]))
- end
- end
- end
- end
- end
- end
- while true do
- Maj()
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment