Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitors = {peripheral.find("monitor")}
- local mon = monitors[1]
- local StartX = 12
- local StartY = 4
- local state1 = "OFF"
- local state2 = "OFF"
- local state3 = "OFF"
- local state4 = "OFF"
- local state5 = "OFF"
- local state6 = "OFF"
- local state7 = "OFF"
- local state8 = "OFF"
- local state9 = "OFF"
- local state10 = "OFF"
- local state11 = "OFF"
- local state12 = "OFF"
- local state13 = "OFF"
- local state14 = "OFF"
- local state15 = "OFF"
- local state16 = "OFF"
- local state17 = "OFF"
- local state18 = "OFF"
- local state19 = "OFF"
- local state20 = "OFF"
- local state21 = "OFF"
- local state22 = "OFF"
- local state23 = "OFF"
- local state24 = "OFF"
- local state25 = "OFF"
- local state26 = "OFF"
- local state27 = "OFF"
- local state28 = "OFF"
- local state29 = "OFF"
- local state30 = "OFF"
- local state31 = "OFF"
- local state32 = "OFF"
- local synStateColor1 = colors.red
- local synStateColor2 = colors.red
- local synStateColor3 = colors.red
- local synStateColor4 = colors.red
- local synStateColor5 = colors.red
- local synStateColor6 = colors.red
- local synStateColor7 = colors.red
- local synStateColor8 = colors.red
- local synStateColor9 = colors.red
- local synStateColor10 = colors.red
- local synStateColor11 = colors.red
- local synStateColor12 = colors.red
- local synStateColor13 = colors.red
- local synStateColor14 = colors.red
- local synStateColor15 = colors.red
- local synStateColor16 = colors.red
- local synStateColor17 = colors.red
- local synStateColor18 = colors.red
- local synStateColor19 = colors.red
- local synStateColor20 = colors.red
- local synStateColor21 = colors.red
- local synStateColor22 = colors.red
- local synStateColor23 = colors.red
- local synStateColor24 = colors.red
- local synStateColor25 = colors.red
- local synStateColor26 = colors.red
- local synStateColor27 = colors.red
- local synStateColor28 = colors.red
- local synStateColor29 = colors.red
- local synStateColor30 = colors.red
- local synStateColor31 = colors.red
- local synStateColor32 = colors.red
- local synColor1 = 0
- local synColor2 = 0
- local synColor3 = 0
- local synColor4 = 0
- local synColor5 = 0
- local synColor6 = 0
- local synColor7 = 0
- local synColor8 = 0
- local synColor9 = 0
- local synColor10 = 0
- local synColor11 = 0
- local synColor12 = 0
- local synColor13 = 0
- local synColor14 = 0
- local synColor15 = 0
- local synColor16 = 0
- local synColor17 = 0
- local synColor18 = 0
- local synColor19 = 0
- local synColor20 = 0
- local synColor21 = 0
- local synColor22 = 0
- local synColor23 = 0
- local synColor24 = 0
- local synColor25 = 0
- local synColor26 = 0
- local synColor27 = 0
- local synColor28 = 0
- local synColor29 = 0
- local synColor30 = 0
- local synColor31 = 0
- local synColor32 = 0
- term.clear()
- mon.setTextScale(0.5)
- term.setCursorPos(1,1)
- term.write("Server ID: "..os.getComputerID())
- term.setCursorPos(1,2)
- term.write("Waiting for input from Pocket Computer...")
- term.setCursorPos(1,3)
- local fileName = "server"
- --Save Code
- function saveGame()
- fs.delete("saves/"..fileName)
- local file = fs.open("saves/"..fileName,"a")
- file.writeLine(fileName)
- file.writeLine(status1)
- file.writeLine(status2)
- file.writeLine(status3)
- file.writeLine(status4)
- file.writeLine(status5)
- file.writeLine(status6)
- file.writeLine(status7)
- file.writeLine(status8)
- file.writeLine(status9)
- file.writeLine(status10)
- file.writeLine(status11)
- file.writeLine(status12)
- file.writeLine(status13)
- file.writeLine(status14)
- file.writeLine(status15)
- file.writeLine(status16)
- file.writeLine(status17)
- file.writeLine(status18)
- file.writeLine(status19)
- file.writeLine(status20)
- file.writeLine(status21)
- file.writeLine(status22)
- file.writeLine(status23)
- file.writeLine(status24)
- file.writeLine(status25)
- file.writeLine(status26)
- file.writeLine(status27)
- file.writeLine(status28)
- file.writeLine(status29)
- file.writeLine(status30)
- file.writeLine(status31)
- file.writeLine(status32)
- file.close()
- saveGame2()
- end
- function saveGame2()
- fs.delete("saves/"..fileName.."2")
- local file = fs.open("saves/"..fileName.."2","a")
- file.writeLine(synStateColor1)
- file.writeLine(synStateColor2)
- file.writeLine(synStateColor3)
- file.writeLine(synStateColor4)
- file.writeLine(synStateColor5)
- file.writeLine(synStateColor6)
- file.writeLine(synStateColor7)
- file.writeLine(synStateColor8)
- file.writeLine(synStateColor9)
- file.writeLine(synStateColor10)
- file.writeLine(synStateColor11)
- file.writeLine(synStateColor12)
- file.writeLine(synStateColor13)
- file.writeLine(synStateColor14)
- file.writeLine(synStateColor15)
- file.writeLine(synStateColor16)
- file.writeLine(synStateColor17)
- file.writeLine(synStateColor18)
- file.writeLine(synStateColor19)
- file.writeLine(synStateColor20)
- file.writeLine(synStateColor21)
- file.writeLine(synStateColor22)
- file.writeLine(synStateColor23)
- file.writeLine(synStateColor24)
- file.writeLine(synStateColor25)
- file.writeLine(synStateColor26)
- file.writeLine(synStateColor27)
- file.writeLine(synStateColor28)
- file.writeLine(synStateColor29)
- file.writeLine(synStateColor30)
- file.writeLine(synStateColor31)
- file.writeLine(synStateColor32)
- file.close()
- saveGame3()
- end
- function saveGame3()
- fs.delete("saves/"..fileName.."3")
- local file = fs.open("saves/"..fileName.."3","a")
- file.writeLine(synColor1)
- file.writeLine(synColor2)
- file.writeLine(synColor3)
- file.writeLine(synColor4)
- file.writeLine(synColor5)
- file.writeLine(synColor6)
- file.writeLine(synColor7)
- file.writeLine(synColor8)
- file.writeLine(synColor9)
- file.writeLine(synColor10)
- file.writeLine(synColor11)
- file.writeLine(synColor12)
- file.writeLine(synColor13)
- file.writeLine(synColor14)
- file.writeLine(synColor15)
- file.writeLine(synColor16)
- file.writeLine(synColor17)
- file.writeLine(synColor18)
- file.writeLine(synColor19)
- file.writeLine(synColor20)
- file.writeLine(synColor21)
- file.writeLine(synColor22)
- file.writeLine(synColor23)
- file.writeLine(synColor24)
- file.writeLine(synColor25)
- file.writeLine(synColor26)
- file.writeLine(synColor27)
- file.writeLine(synColor28)
- file.writeLine(synColor29)
- file.writeLine(synColor30)
- file.writeLine(synColor31)
- file.writeLine(synColor32)
- file.close()
- end
- function loadSave1()
- -- Load Save
- local file = fs.open("saves/"..fileName,"r")
- local fileData = {}
- local line = file.readLine()
- repeat
- table.insert(fileData,line)
- line = file.readLine()
- until line == nil
- local fileName = fileData[1]
- state1 = fileData[2]
- state2 = fileData[3]
- state3 = fileData[4]
- state4 = fileData[5]
- state5 = fileData[6]
- state6 = fileData[7]
- state7 = fileData[8]
- state8 = fileData[9]
- state9 = fileData[10]
- state10 = fileData[11]
- state11 = fileData[12]
- state12 = fileData[13]
- state13 = fileData[14]
- state14 = fileData[15]
- state15 = fileData[16]
- state16 = fileData[17]
- state17 = fileData[18]
- state18 = fileData[19]
- state19 = fileData[20]
- state20 = fileData[21]
- state21 = fileData[22]
- state22 = fileData[23]
- state23 = fileData[24]
- state24 = fileData[25]
- state25 = fileData[26]
- state26 = fileData[27]
- state27 = fileData[28]
- state28 = fileData[29]
- state29 = fileData[30]
- state30 = fileData[31]
- state31 = fileData[32]
- state32 = fileData[33]
- file.close()
- loadSave2()
- end
- function loadSave2()
- -- Load Save
- local file = fs.open("saves/"..fileName.."2","r")
- local fileData = {}
- local line = file.readLine()
- repeat
- table.insert(fileData,line)
- line = file.readLine()
- until line == nil
- synStateColor1 = fileData[1]
- synStateColor2 = fileData[2]
- synStateColor3 = fileData[3]
- synStateColor4 = fileData[4]
- synStateColor5 = fileData[5]
- synStateColor6 = fileData[6]
- synStateColor7 = fileData[7]
- synStateColor8 = fileData[8]
- synStateColor9 = fileData[9]
- synStateColor10 = fileData[10]
- synStateColor11 = fileData[11]
- synStateColor12 = fileData[12]
- synStateColor13 = fileData[13]
- synStateColor14 = fileData[14]
- synStateColor15 = fileData[15]
- synStateColor16 = fileData[16]
- synStateColor17 = fileData[17]
- synStateColor18 = fileData[18]
- synStateColor19 = fileData[19]
- synStateColor20 = fileData[20]
- synStateColor21 = fileData[21]
- synStateColor22 = fileData[22]
- synStateColor23 = fileData[23]
- synStateColor24 = fileData[24]
- synStateColor25 = fileData[25]
- synStateColor26 = fileData[26]
- synStateColor27 = fileData[27]
- synStateColor28 = fileData[28]
- synStateColor29 = fileData[29]
- synStateColor30 = fileData[30]
- synStateColor31 = fileData[31]
- synStateColor32 = fileData[32]
- file.close()
- loadSave3()
- end
- function loadSave3()
- -- Load Save
- local file = fs.open("saves/"..fileName.."3","r")
- local fileData = {}
- local line = file.readLine()
- repeat
- table.insert(fileData,line)
- line = file.readLine()
- until line == nil
- synColor1 = fileData[1]
- synColor2 = fileData[2]
- synColor3 = fileData[3]
- synColor4 = fileData[4]
- synColor5 = fileData[5]
- synColor6 = fileData[6]
- synColor7 = fileData[7]
- synColor8 = fileData[8]
- synColor9 = fileData[9]
- synColor10 = fileData[10]
- synColor11 = fileData[11]
- synColor12 = fileData[12]
- synColor13 = fileData[13]
- synColor14 = fileData[14]
- synColor15 = fileData[15]
- synColor16 = fileData[16]
- synColor17 = fileData[17]
- synColor18 = fileData[18]
- synColor19 = fileData[19]
- synColor20 = fileData[20]
- synColor21 = fileData[21]
- synColor22 = fileData[22]
- synColor23 = fileData[23]
- synColor24 = fileData[24]
- synColor25 = fileData[25]
- synColor26 = fileData[26]
- synColor27 = fileData[27]
- synColor28 = fileData[28]
- synColor29 = fileData[29]
- synColor30 = fileData[30]
- synColor31 = fileData[31]
- synColor32 = fileData[32]
- file.close()
- loadSave4()
- end
- function loadSave4()
- synStateColor1 = tonumber(synStateColor1)
- synStateColor2 = tonumber(synStateColor2)
- synStateColor3 = tonumber(synStateColor3)
- synStateColor4 = tonumber(synStateColor4)
- synStateColor5 = tonumber(synStateColor5)
- synStateColor6 = tonumber(synStateColor6)
- synStateColor7 = tonumber(synStateColor7)
- synStateColor8 = tonumber(synStateColor8)
- synStateColor9 = tonumber(synStateColor9)
- synStateColor10 = tonumber(synStateColor10)
- synStateColor11 = tonumber(synStateColor11)
- synStateColor12 = tonumber(synStateColor12)
- synStateColor13 = tonumber(synStateColor13)
- synStateColor14 = tonumber(synStateColor14)
- synStateColor15 = tonumber(synStateColor15)
- synStateColor16 = tonumber(synStateColor16)
- synStateColor17 = tonumber(synStateColor17)
- synStateColor18 = tonumber(synStateColor18)
- synStateColor19 = tonumber(synStateColor19)
- synStateColor20 = tonumber(synStateColor20)
- synStateColor21 = tonumber(synStateColor21)
- synStateColor22 = tonumber(synStateColor22)
- synStateColor23 = tonumber(synStateColor23)
- synStateColor24 = tonumber(synStateColor24)
- synStateColor25 = tonumber(synStateColor25)
- synStateColor26 = tonumber(synStateColor26)
- synStateColor27 = tonumber(synStateColor27)
- synStateColor28 = tonumber(synStateColor28)
- synStateColor29 = tonumber(synStateColor29)
- synStateColor30 = tonumber(synStateColor30)
- synStateColor31 = tonumber(synStateColor31)
- synStateColor32 = tonumber(synStateColor32)
- loadSave5()
- end
- function loadSave5()
- synColor1 = tonumber(synColor1)
- synColor2 = tonumber(synColor2)
- synColor3 = tonumber(synColor3)
- synColor4 = tonumber(synColor4)
- synColor5 = tonumber(synColor5)
- synColor6 = tonumber(synColor6)
- synColor7 = tonumber(synColor7)
- synColor8 = tonumber(synColor8)
- synColor9 = tonumber(synColor9)
- synColor10 = tonumber(synColor10)
- synColor11 = tonumber(synColor11)
- synColor12 = tonumber(synColor12)
- synColor13 = tonumber(synColor13)
- synColor14 = tonumber(synColor14)
- synColor15 = tonumber(synColor15)
- synColor16 = tonumber(synColor16)
- synColor17 = tonumber(synColor17)
- synColor18 = tonumber(synColor18)
- synColor19 = tonumber(synColor19)
- synColor20 = tonumber(synColor20)
- synColor21 = tonumber(synColor21)
- synColor22 = tonumber(synColor22)
- synColor23 = tonumber(synColor23)
- synColor24 = tonumber(synColor24)
- synColor25 = tonumber(synColor25)
- synColor26 = tonumber(synColor26)
- synColor27 = tonumber(synColor27)
- synColor28 = tonumber(synColor28)
- synColor29 = tonumber(synColor29)
- synColor30 = tonumber(synColor30)
- synColor31 = tonumber(synColor31)
- synColor32 = tonumber(synColor32)
- end
- function loadSave6()
- -- Make New Save
- local file = fs.open("saves/"..fileName,"a")
- file.writeLine(fileName)
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.writeLine("OFF")
- file.close()
- loadSave7()
- end
- function loadSave7()
- -- Make New Save
- local file = fs.open("saves/"..fileName.."2","a")
- file.writeLine(synStateColor1)
- file.writeLine(synStateColor2)
- file.writeLine(synStateColor3)
- file.writeLine(synStateColor4)
- file.writeLine(synStateColor5)
- file.writeLine(synStateColor6)
- file.writeLine(synStateColor7)
- file.writeLine(synStateColor8)
- file.writeLine(synStateColor9)
- file.writeLine(synStateColor10)
- file.writeLine(synStateColor11)
- file.writeLine(synStateColor12)
- file.writeLine(synStateColor13)
- file.writeLine(synStateColor14)
- file.writeLine(synStateColor15)
- file.writeLine(synStateColor16)
- file.writeLine(synStateColor17)
- file.writeLine(synStateColor18)
- file.writeLine(synStateColor19)
- file.writeLine(synStateColor20)
- file.writeLine(synStateColor21)
- file.writeLine(synStateColor22)
- file.writeLine(synStateColor23)
- file.writeLine(synStateColor24)
- file.writeLine(synStateColor25)
- file.writeLine(synStateColor26)
- file.writeLine(synStateColor27)
- file.writeLine(synStateColor28)
- file.writeLine(synStateColor29)
- file.writeLine(synStateColor30)
- file.writeLine(synStateColor31)
- file.writeLine(synStateColor32)
- file.close()
- loadSave8()
- end
- function loadSave8()
- -- Make New Save
- local file = fs.open("saves/"..fileName.."3","a")
- file.writeLine(synColor1)
- file.writeLine(synColor2)
- file.writeLine(synColor3)
- file.writeLine(synColor4)
- file.writeLine(synColor5)
- file.writeLine(synColor6)
- file.writeLine(synColor7)
- file.writeLine(synColor8)
- file.writeLine(synColor9)
- file.writeLine(synColor10)
- file.writeLine(synColor11)
- file.writeLine(synColor12)
- file.writeLine(synColor13)
- file.writeLine(synColor14)
- file.writeLine(synColor15)
- file.writeLine(synColor16)
- file.writeLine(synColor17)
- file.writeLine(synColor18)
- file.writeLine(synColor19)
- file.writeLine(synColor20)
- file.writeLine(synColor21)
- file.writeLine(synColor22)
- file.writeLine(synColor23)
- file.writeLine(synColor24)
- file.writeLine(synColor25)
- file.writeLine(synColor26)
- file.writeLine(synColor27)
- file.writeLine(synColor28)
- file.writeLine(synColor29)
- file.writeLine(synColor30)
- file.writeLine(synColor31)
- file.writeLine(synColor32)
- file.close()
- os.sleep(2)
- loadSave()
- end
- --Load Code
- function loadSave()
- -- Check if Saves folder Exists
- if fs.exists("saves") then
- -- Check if Save exists
- if fs.exists("saves/"..fileName) and fs.exists("saves/"..fileName.."2") and fs.exists("saves/"..fileName.."3") then
- loadSave1()
- else
- loadSave6()
- end
- else
- -- Make Folder
- fs.makeDir("saves")
- os.sleep(2)
- loadSave()
- end
- end
- function checkState()
- if state1 == "ON " then
- synStateColor1 = colors.lime
- synColor1 = colors.blue
- elseif state1 == "OFF" then
- synStateColor1 = colors.red
- synColor1 = 0
- end
- if state2 == "ON " then
- synStateColor2 = colors.lime
- synColor2 = colors.lightBlue
- elseif state2 == "OFF" then
- synStateColor2 = colors.red
- synColor2 = 0
- end
- if state3 == "ON " then
- synStateColor3 = colors.lime
- synColor3 = colors.pink
- elseif state3 == "OFF" then
- synStateColor3 = colors.red
- synColor3 = 0
- end
- if state4 == "ON " then
- synStateColor4 = colors.lime
- synColor4 = colors.red
- elseif state4 == "OFF" then
- synStateColor4 = colors.red
- synColor4 = 0
- end
- if state5 == "ON " then
- synStateColor5 = colors.lime
- synColor5 = colors.purple
- elseif state5 == "OFF" then
- synStateColor5 = colors.red
- synColor5 = 0
- end
- if state6 == "ON " then
- synStateColor6 = colors.lime
- synColor6 = colors.cyan
- elseif state6 == "OFF" then
- synStateColor6 = colors.red
- synColor6 = 0
- end
- if state7 == "ON " then
- synStateColor7 = colors.lime
- synColor7 = colors.orange
- elseif state7 == "OFF" then
- synStateColor7 = colors.red
- synColor7 = 0
- end
- if state8 == "ON " then
- synStateColor8 = colors.lime
- synColor8 = colors.magenta
- elseif state8 == "OFF" then
- synStateColor8 = colors.red
- synColor8 = 0
- end
- if state9 == "ON " then
- synStateColor9 = colors.lime
- synColor9 = colors.black
- elseif state9 == "OFF" then
- synStateColor9 = colors.red
- synColor9 = 0
- end
- if state10 == "ON " then
- synStateColor10 = colors.lime
- synColor10 = colors.green
- elseif state10 == "OFF" then
- synStateColor10 = colors.red
- synColor10 = 0
- end
- if state11 == "ON " then
- synStateColor11 = colors.lime
- synColor11 = colors.brown
- elseif state11 == "OFF" then
- synStateColor11 = colors.red
- synColor11 = 0
- end
- if state12 == "ON " then
- synStateColor12 = colors.lime
- synColor12 = colors.white
- elseif state12 == "OFF" then
- synStateColor12 = colors.red
- synColor12 = 0
- end
- if state13 == "ON " then
- synStateColor13 = colors.lime
- synColor13 = colors.lightGray
- elseif state13 == "OFF" then
- synStateColor13 = colors.red
- synColor13 = 0
- end
- if state14 == "ON " then
- synStateColor14 = colors.lime
- synColor14 = colors.gray
- elseif state14 == "OFF" then
- synStateColor14 = colors.red
- synColor14 = 0
- end
- if state15 == "ON " then
- synStateColor15 = colors.lime
- synColor15 = colors.lime
- elseif state15 == "OFF" then
- synStateColor15 = colors.red
- synColor15 = 0
- end
- if state16 == "ON " then
- synStateColor16 = colors.lime
- synColor16 = colors.yellow
- elseif state16 == "OFF" then
- synStateColor16 = colors.red
- synColor16 = 0
- end
- checkState2()
- end
- function checkState2()
- if state17 == "ON " then
- synStateColor17 = colors.lime
- synColor17 = colors.blue
- elseif state17 == "OFF" then
- synStateColor17 = colors.red
- synColor17 = 0
- end
- if state18 == "ON " then
- synStateColor18 = colors.lime
- synColor18 = colors.lightBlue
- elseif state18 == "OFF" then
- synStateColor18 = colors.red
- synColor18 = 0
- end
- if state19 == "ON " then
- synStateColor19 = colors.lime
- synColor19 = colors.pink
- elseif state19 == "OFF" then
- synStateColor19 = colors.red
- synColor19 = 0
- end
- if state20 == "ON " then
- synStateColor20 = colors.lime
- synColor20 = colors.red
- elseif state20 == "OFF" then
- synStateColor20 = colors.red
- synColor20 = 0
- end
- if state21 == "ON " then
- synStateColor21 = colors.lime
- synColor21 = colors.purple
- elseif state21 == "OFF" then
- synStateColor21 = colors.red
- synColor21 = 0
- end
- if state22 == "ON " then
- synStateColor22 = colors.lime
- synColor22 = colors.cyan
- elseif state22 == "OFF" then
- synStateColor22 = colors.red
- synColor22 = 0
- end
- if state23 == "ON " then
- synStateColor23 = colors.lime
- synColor23 = colors.orange
- elseif state23 == "OFF" then
- synStateColor23 = colors.red
- synColor23 = 0
- end
- if state24 == "ON " then
- synStateColor24 = colors.lime
- synColor24 = colors.magenta
- elseif state24 == "OFF" then
- synStateColor24 = colors.red
- synColor24 = 0
- end
- if state25 == "ON " then
- synStateColor25 = colors.lime
- synColor25 = colors.black
- elseif state25 == "OFF" then
- synStateColor25 = colors.red
- synColor25 = 0
- end
- if state26 == "ON " then
- synStateColor26 = colors.lime
- synColor26 = colors.green
- elseif state26 == "OFF" then
- synStateColor26 = colors.red
- synColor26 = 0
- end
- if state27 == "ON " then
- synStateColor27 = colors.lime
- synColor27 = colors.brown
- elseif state27 == "OFF" then
- synStateColor27 = colors.red
- synColor27 = 0
- end
- if state28 == "ON " then
- synStateColor28 = colors.lime
- synColor28 = colors.white
- elseif state28 == "OFF" then
- synStateColor28 = colors.red
- synColor28 = 0
- end
- if state29 == "ON " then
- synStateColor29 = colors.lime
- synColor29 = colors.lightGray
- elseif state29 == "OFF" then
- synStateColor29 = colors.red
- synColor29 = 0
- end
- if state30 == "ON " then
- synStateColor30 = colors.lime
- synColor30 = colors.gray
- elseif state30 == "OFF" then
- synStateColor30 = colors.red
- synColor30 = 0
- end
- if state31 == "ON " then
- synStateColor31 = colors.lime
- synColor31 = colors.lime
- elseif state31 == "OFF" then
- synStateColor31 = colors.red
- synColor31 = 0
- end
- if state32 == "ON " then
- synStateColor32 = colors.lime
- synColor32 = colors.yellow
- elseif state32 == "OFF" then
- synStateColor32 = colors.red
- synColor32 = 0
- end
- end
- function setStateViaColor()
- if synStateColor1 == colors.lime then
- state1 = "ON "
- elseif synStateColor1 == colors.red then
- state1 = "OFF"
- end
- if synStateColor2 == colors.lime then
- state2 = "ON "
- elseif synStateColor2 == colors.red then
- state2 = "OFF"
- end
- if synStateColor3 == colors.lime then
- state3 = "ON "
- elseif synStateColor3 == colors.red then
- state3 = "OFF"
- end
- if synStateColor4 == colors.lime then
- state4 = "ON "
- elseif synStateColor4 == colors.red then
- state4 = "OFF"
- end
- if synStateColor5 == colors.lime then
- state5 = "ON "
- elseif synStateColor5 == colors.red then
- state5 = "OFF"
- end
- if synStateColor6 == colors.lime then
- state6 = "ON "
- elseif synStateColor6 == colors.red then
- state6 = "OFF"
- end
- if synStateColor7 == colors.lime then
- state7 = "ON "
- elseif synStateColor7 == colors.red then
- state7 = "OFF"
- end
- if synStateColor8 == colors.lime then
- state8 = "ON "
- elseif synStateColor8 == colors.red then
- state8 = "OFF"
- end
- if synStateColor9 == colors.lime then
- state9 = "ON "
- elseif synStateColor9 == colors.red then
- state9 = "OFF"
- end
- if synStateColor10 == colors.lime then
- state10 = "ON "
- elseif synStateColor10 == colors.red then
- state10 = "OFF"
- end
- if synStateColor11 == colors.lime then
- state11 = "ON "
- elseif synStateColor11 == colors.red then
- state11 = "OFF"
- end
- if synStateColor12 == colors.lime then
- state12 = "ON "
- elseif synStateColor12 == colors.red then
- state12 = "OFF"
- end
- if synStateColor13 == colors.lime then
- state13 = "ON "
- elseif synStateColor13 == colors.red then
- state13 = "OFF"
- end
- if synStateColor14 == colors.lime then
- state14 = "ON "
- elseif synStateColor14 == colors.red then
- state14 = "OFF"
- end
- if synStateColor15 == colors.lime then
- state15 = "ON "
- elseif synStateColor15 == colors.red then
- state15 = "OFF"
- end
- if synStateColor16 == colors.lime then
- state16 = "ON "
- elseif synStateColor16 == colors.red then
- state16 = "OFF"
- end
- setStateViaColor2()
- end
- function setStateViaColor2()
- if synStateColor17 == colors.lime then
- state17 = "ON "
- elseif synStateColor17 == colors.red then
- state17 = "OFF"
- end
- if synStateColor18 == colors.lime then
- state18 = "ON "
- elseif synStateColor18 == colors.red then
- state18 = "OFF"
- end
- if synStateColor19 == colors.lime then
- state19 = "ON "
- elseif synStateColor19 == colors.red then
- state19 = "OFF"
- end
- if synStateColor20 == colors.lime then
- state20 = "ON "
- elseif synStateColor20 == colors.red then
- state20 = "OFF"
- end
- if synStateColor21 == colors.lime then
- state21 = "ON "
- elseif synStateColor21 == colors.red then
- state21 = "OFF"
- end
- if synStateColor22 == colors.lime then
- state22 = "ON "
- elseif synStateColor22 == colors.red then
- state22 = "OFF"
- end
- if synStateColor23 == colors.lime then
- state23 = "ON "
- elseif synStateColor23 == colors.red then
- state23 = "OFF"
- end
- if synStateColor24 == colors.lime then
- state24 = "ON "
- elseif synStateColor24 == colors.red then
- state24 = "OFF"
- end
- if synStateColor25 == colors.lime then
- state25 = "ON "
- elseif synStateColor25 == colors.red then
- state25 = "OFF"
- end
- if synStateColor26 == colors.lime then
- state26 = "ON "
- elseif synStateColor26 == colors.red then
- state26 = "OFF"
- end
- if synStateColor27 == colors.lime then
- state27 = "ON "
- elseif synStateColor27 == colors.red then
- state27 = "OFF"
- end
- if synStateColor28 == colors.lime then
- state28 = "ON "
- elseif synStateColor28 == colors.red then
- state28 = "OFF"
- end
- if synStateColor29 == colors.lime then
- state29 = "ON "
- elseif synStateColor29 == colors.red then
- state29 = "OFF"
- end
- if synStateColor30 == colors.lime then
- state30 = "ON "
- elseif synStateColor30 == colors.red then
- state30 = "OFF"
- end
- if synStateColor31 == colors.lime then
- state31 = "ON "
- elseif synStateColor31 == colors.red then
- state31 = "OFF"
- end
- if synStateColor32 == colors.lime then
- state32 = "ON "
- elseif synStateColor32 == colors.red then
- state32 = "OFF"
- end
- end
- function writeSyn1()
- mon.clear()
- term.redirect(mon)
- paintutils.drawFilledBox(1, 1, 71, 35, colors.black)
- paintutils.drawBox(2, 2, 54, 36, colors.lightGray)
- paintutils.drawLine(28, 3, 28, 36, colors.lightGray)
- paintutils.drawPixel(56, 66, colors.red)
- paintutils.drawPixel(26, StartY, synStateColor1)
- paintutils.drawPixel(26, StartY + 2, synStateColor2)
- paintutils.drawPixel(26, StartY + 4, synStateColor3)
- paintutils.drawPixel(26, StartY + 6, synStateColor4)
- paintutils.drawPixel(26, StartY + 8, synStateColor5)
- paintutils.drawPixel(26, StartY + 10, synStateColor6)
- paintutils.drawPixel(26, StartY + 12, synStateColor7)
- paintutils.drawPixel(26, StartY + 14, synStateColor8)
- paintutils.drawPixel(26, StartY + 16, synStateColor9)
- paintutils.drawPixel(26, StartY + 18, synStateColor10)
- paintutils.drawPixel(26, StartY + 20, synStateColor11)
- paintutils.drawPixel(26, StartY + 22, synStateColor12)
- paintutils.drawPixel(26, StartY + 24, synStateColor13)
- paintutils.drawPixel(26, StartY + 26, synStateColor14)
- paintutils.drawPixel(26, StartY + 28, synStateColor15)
- paintutils.drawPixel(26, StartY + 30, synStateColor16)
- paintutils.drawPixel(52, StartY, synStateColor17)
- paintutils.drawPixel(52, StartY + 2, synStateColor18)
- paintutils.drawPixel(52, StartY + 4, synStateColor19)
- paintutils.drawPixel(52, StartY + 6, synStateColor20)
- paintutils.drawPixel(52, StartY + 8, synStateColor21)
- paintutils.drawPixel(52, StartY + 10, synStateColor22)
- paintutils.drawPixel(52, StartY + 12, synStateColor23)
- paintutils.drawPixel(52, StartY + 14, synStateColor24)
- paintutils.drawPixel(52, StartY + 16, synStateColor25)
- paintutils.drawPixel(52, StartY + 18, synStateColor26)
- paintutils.drawPixel(52, StartY + 20, synStateColor27)
- paintutils.drawPixel(52, StartY + 22, synStateColor28)
- paintutils.drawPixel(52, StartY + 24, synStateColor29)
- paintutils.drawPixel(52, StartY + 26, synStateColor30)
- paintutils.drawPixel(52, StartY + 28, synStateColor31)
- paintutils.drawPixel(52, StartY + 30, synStateColor32)
- paintutils.drawPixel(71, 35, colors.black)
- writeSyn2()
- end
- function writeSyn2()
- mon.setCursorPos(4,StartY)
- mon.write("Iron Golem:")
- mon.setCursorPos(StartX + 10,StartY)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY)
- mon.write(state1)
- mon.setCursorPos(4,StartY + 2)
- mon.write("Wither Skeleton:")
- mon.setCursorPos(StartX + 10,StartY + 2)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 2)
- mon.write(state2)
- mon.setCursorPos(4,StartY + 4)
- mon.write("Blaze:")
- mon.setCursorPos(StartX + 10,StartY + 4)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 4)
- mon.write(state3)
- mon.setCursorPos(4,StartY + 6)
- mon.write("Zombie Pigman:")
- mon.setCursorPos(StartX + 10,StartY + 6)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 6)
- mon.write(state4)
- mon.setCursorPos(4,StartY + 8)
- mon.write("Enderman:")
- mon.setCursorPos(StartX + 10,StartY + 8)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 8)
- mon.write(state5)
- mon.setCursorPos(4,StartY + 10)
- mon.write("Ghast:")
- mon.setCursorPos(StartX + 10,StartY + 10)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 10)
- mon.write(state6)
- mon.setCursorPos(4,StartY + 12)
- mon.write("Witch:")
- mon.setCursorPos(StartX + 10,StartY + 12)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 12)
- mon.write(state7)
- mon.setCursorPos(4,StartY + 14)
- mon.write("Spider:")
- mon.setCursorPos(StartX + 10,StartY + 14)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 14)
- mon.write(state8)
- mon.setCursorPos(4,StartY + 16)
- mon.write("Mooshroom:")
- mon.setCursorPos(StartX + 10,StartY + 16)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 16)
- mon.write(state9)
- mon.setCursorPos(4,StartY + 18)
- mon.write("Creeper:")
- mon.setCursorPos(StartX + 10,StartY + 18)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 18)
- mon.write(state10)
- mon.setCursorPos(4,StartY + 20)
- mon.write("Pech:")
- mon.setCursorPos(StartX + 10,StartY + 20)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 20)
- mon.write(state11)
- mon.setCursorPos(4,StartY + 22)
- mon.write("Crimson Cleric:")
- mon.setCursorPos(StartX + 10,StartY + 22)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 22)
- mon.write(state12)
- mon.setCursorPos(4,StartY + 24)
- mon.write("Crimson Knight:")
- mon.setCursorPos(StartX + 10,StartY + 24)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 24)
- mon.write(state13)
- mon.setCursorPos(4,StartY + 26)
- mon.write("Fire Elemental:")
- mon.setCursorPos(StartX + 10,StartY + 26)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 26)
- mon.write(state14)
- mon.setCursorPos(4,StartY + 28)
- mon.write("Wisp:")
- mon.setCursorPos(StartX + 10,StartY + 28)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 28)
- mon.write(state15)
- mon.setCursorPos(4,StartY + 30)
- mon.write("Pink Slime:")
- mon.setCursorPos(StartX + 10,StartY + 30)
- mon.write("OFF")
- mon.setCursorPos(StartX + 10,StartY + 30)
- mon.write(state16)
- writeSyn3()
- end
- function writeSyn3()
- local StartX = 20
- mon.setCursorPos(30,StartY)
- mon.write("Spawner 17:")
- mon.setCursorPos(StartX + 28,StartY)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY)
- mon.write(state17)
- mon.setCursorPos(30,StartY + 2)
- mon.write("Spawner 18:")
- mon.setCursorPos(StartX + 28,StartY + 2)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 2)
- mon.write(state18)
- mon.setCursorPos(30,StartY + 4)
- mon.write("Spawner 19:")
- mon.setCursorPos(StartX + 28,StartY + 4)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 4)
- mon.write(state19)
- mon.setCursorPos(30,StartY + 6)
- mon.write("Spawner 20:")
- mon.setCursorPos(StartX + 28,StartY + 6)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 6)
- mon.write(state20)
- mon.setCursorPos(30,StartY + 8)
- mon.write("Spawner 21:")
- mon.setCursorPos(StartX + 28,StartY + 8)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 8)
- mon.write(state21)
- mon.setCursorPos(30,StartY + 10)
- mon.write("Spawner 22:")
- mon.setCursorPos(StartX + 28,StartY + 10)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 10)
- mon.write(state22)
- mon.setCursorPos(30,StartY + 12)
- mon.write("Spawner 23:")
- mon.setCursorPos(StartX + 28,StartY + 12)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 12)
- mon.write(state23)
- mon.setCursorPos(30,StartY + 14)
- mon.write("Spawner 24:")
- mon.setCursorPos(StartX + 28,StartY + 14)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 14)
- mon.write(state24)
- mon.setCursorPos(30,StartY + 16)
- mon.write("Spawner 25:")
- mon.setCursorPos(StartX + 28,StartY + 16)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 16)
- mon.write(state25)
- mon.setCursorPos(30,StartY + 18)
- mon.write("Spawner 26:")
- mon.setCursorPos(StartX + 28,StartY + 18)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 18)
- mon.write(state26)
- mon.setCursorPos(30,StartY + 20)
- mon.write("Spawner 27:")
- mon.setCursorPos(StartX + 28,StartY + 20)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 20)
- mon.write(state27)
- mon.setCursorPos(30,StartY + 22)
- mon.write("Spawner 28:")
- mon.setCursorPos(StartX + 28,StartY + 22)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 22)
- mon.write(state28)
- mon.setCursorPos(30,StartY + 24)
- mon.write("Spawner 29:")
- mon.setCursorPos(StartX + 28,StartY + 24)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 24)
- mon.write(state29)
- mon.setCursorPos(30,StartY + 26)
- mon.write("Spawner 30:")
- mon.setCursorPos(StartX + 28,StartY + 26)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 26)
- mon.write(state30)
- mon.setCursorPos(30,StartY + 28)
- mon.write("Spawner 31:")
- mon.setCursorPos(StartX + 28,StartY + 28)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 28)
- mon.write(state31)
- mon.setCursorPos(30,StartY + 30)
- mon.write("Spawner 32:")
- mon.setCursorPos(StartX + 28,StartY + 30)
- mon.write("OFF")
- mon.setCursorPos(StartX + 28,StartY + 30)
- mon.write(state32)
- end
- function setState()
- rs.setBundledOutput("left", colors.combine(synColor1, synColor2, synColor3, synColor4, synColor5, synColor6, synColor7, synColor8, synColor9, synColor10, synColor11, synColor12, synColor13, synColor14, synColor15, synColor16))
- setState2()
- end
- function setState2()
- rs.setBundledOutput("right", colors.combine(synColor17, synColor18, synColor19, synColor20, synColor21, synColor22, synColor23, synColor24, synColor25, synColor26, synColor27, synColor28, synColor29, synColor30, synColor31, synColor32))
- end
- function writeSyn()
- checkState()
- setState()
- saveGame()
- writeSyn1()
- end
- loadSave()
- setStateViaColor()
- writeSyn()
- while true do
- writeSyn()
- rednet.open("back")
- id,message = rednet.receive()
- if id == 215 and message == "Toggle1" and state1 == "OFF" then
- state1 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle1" and state1 == "ON " then
- state1 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle2" and state2 == "OFF" then
- state2 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle2" and state2 == "ON " then
- state2 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle3" and state3 == "OFF" then
- state3 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle3" and state3 == "ON " then
- state3 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle4" and state4 == "OFF" then
- state4 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle4" and state4 == "ON " then
- state4 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle5" and state5 == "OFF" then
- state5 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle5" and state5 == "ON " then
- state5 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle6" and state6 == "OFF" then
- state6= "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle6" and state6 == "ON " then
- state6 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle7" and state7 == "OFF" then
- state7 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle7" and state7 == "ON " then
- state7 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle8" and state8 == "OFF" then
- state8 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle8" and state8 == "ON " then
- state8 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle9" and state9 == "OFF" then
- state9 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle9" and state9 == "ON " then
- state9 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle10" and state10 == "OFF" then
- state10 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle10" and state10 == "ON " then
- state10 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle11" and state11 == "OFF" then
- state11 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle11" and state11 == "ON " then
- state11 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle12" and state12 == "OFF" then
- state12 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle12" and state12 == "ON " then
- state12 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle13" and state13 == "OFF" then
- state13 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle13" and state13 == "ON " then
- state13 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle14" and state14 == "OFF" then
- state14 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle14" and state14 == "ON " then
- state14 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle15" and state15 == "OFF" then
- state15 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle15" and state15 == "ON " then
- state15 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle16" and state16 == "OFF" then
- state16 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle16" and state16 == "ON " then
- state16 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle17" and state17 == "OFF" then
- state17 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle17" and state17 == "ON " then
- state17 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle18" and state18 == "OFF" then
- state18 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle18" and state18 == "ON " then
- state18 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle19" and state19 == "OFF" then
- state19 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle19" and state19 == "ON " then
- state19 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle20" and state20 == "OFF" then
- state20 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle20" and state20 == "ON " then
- state20 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle21" and state21 == "OFF" then
- state21 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle21" and state21 == "ON " then
- state21 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle22" and state22 == "OFF" then
- state22 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle22" and state22 == "ON " then
- state22 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle23" and state23 == "OFF" then
- state23 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle23" and state23 == "ON " then
- state23 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle24" and state24 == "OFF" then
- state24 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle24" and state24 == "ON " then
- state24 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle25" and state25 == "OFF" then
- state25 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle25" and state25 == "ON " then
- state25 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle26" and state26 == "OFF" then
- state26 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle26" and state26 == "ON " then
- state26 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle27" and state27== "OFF" then
- state27 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle27" and state27 == "ON " then
- state27 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle28" and state28 == "OFF" then
- state28 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle28" and state28 == "ON " then
- state28 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle29" and state29 == "OFF" then
- state29 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle29" and state29 == "ON " then
- state29 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle30" and state30 == "OFF" then
- state30 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle30" and state30 == "ON " then
- state30 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle31" and state31 == "OFF" then
- state31 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle31" and state31 == "ON " then
- state31 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Toggle32" and state32 == "OFF" then
- state32 = "ON "
- writeSyn()
- elseif id == 215 and message == "Toggle32" and state32 == "ON " then
- state32 = "OFF"
- writeSyn()
- elseif id == 215 and message == "Reset" then
- paintutils.drawFilledBox(1, 1, 99, 99, colors.black)
- shell.run("rm " .. "saves")
- shell.run("startup")
- elseif id == 216 and message == "Toggle1" and state1 == "OFF" then
- state1 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle1" and state1 == "ON " then
- state1 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle2" and state2 == "OFF" then
- state2 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle2" and state2 == "ON " then
- state2 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle3" and state3 == "OFF" then
- state3 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle3" and state3 == "ON " then
- state3 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle4" and state4 == "OFF" then
- state4 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle4" and state4 == "ON " then
- state4 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle5" and state5 == "OFF" then
- state5 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle5" and state5 == "ON " then
- state5 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle6" and state6 == "OFF" then
- state6= "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle6" and state6 == "ON " then
- state6 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle7" and state7 == "OFF" then
- state7 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle7" and state7 == "ON " then
- state7 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle8" and state8 == "OFF" then
- state8 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle8" and state8 == "ON " then
- state8 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle9" and state9 == "OFF" then
- state9 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle9" and state9 == "ON " then
- state9 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle10" and state10 == "OFF" then
- state10 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle10" and state10 == "ON " then
- state10 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle11" and state11 == "OFF" then
- state11 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle11" and state11 == "ON " then
- state11 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle12" and state12 == "OFF" then
- state12 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle12" and state12 == "ON " then
- state12 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle13" and state13 == "OFF" then
- state13 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle13" and state13 == "ON " then
- state13 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle14" and state14 == "OFF" then
- state14 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle14" and state14 == "ON " then
- state14 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle15" and state15 == "OFF" then
- state15 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle15" and state15 == "ON " then
- state15 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle16" and state16 == "OFF" then
- state16 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle16" and state16 == "ON " then
- state16 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle17" and state17 == "OFF" then
- state17 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle17" and state17 == "ON " then
- state17 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle18" and state18 == "OFF" then
- state18 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle18" and state18 == "ON " then
- state18 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle19" and state19 == "OFF" then
- state19 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle19" and state19 == "ON " then
- state19 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle20" and state20 == "OFF" then
- state20 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle20" and state20 == "ON " then
- state20 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle21" and state21 == "OFF" then
- state21 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle21" and state21 == "ON " then
- state21 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle22" and state22 == "OFF" then
- state22 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle22" and state22 == "ON " then
- state22 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle23" and state23 == "OFF" then
- state23 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle23" and state23 == "ON " then
- state23 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle24" and state24 == "OFF" then
- state24 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle24" and state24 == "ON " then
- state24 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle25" and state25 == "OFF" then
- state25 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle25" and state25 == "ON " then
- state25 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle26" and state26 == "OFF" then
- state26 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle26" and state26 == "ON " then
- state26 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle27" and state27== "OFF" then
- state27 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle27" and state27 == "ON " then
- state27 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle28" and state28 == "OFF" then
- state28 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle28" and state28 == "ON " then
- state28 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle29" and state29 == "OFF" then
- state29 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle29" and state29 == "ON " then
- state29 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle30" and state30 == "OFF" then
- state30 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle30" and state30 == "ON " then
- state30 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle31" and state31 == "OFF" then
- state31 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle31" and state31 == "ON " then
- state31 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Toggle32" and state32 == "OFF" then
- state32 = "ON "
- writeSyn()
- elseif id == 216 and message == "Toggle32" and state32 == "ON " then
- state32 = "OFF"
- writeSyn()
- elseif id == 216 and message == "Reset" then
- paintutils.drawFilledBox(1, 1, 99, 99, colors.black)
- shell.run("rm " .. "saves")
- shell.run("startup")
- else
- print("Error")
- end
- rednet.close("back")
- end
Add Comment
Please, Sign In to add comment