Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rasm(leftf,rightf,frontf,backf,topf,bottomf)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- term.setCursorPos(3,3)
- ID = os.getComputerID()
- print("ID:"..tostring(ID))
- f1 = fs.open(leftf,"r")
- f2 = fs.open(rightf,"r")
- f3 = fs.open(frontf,"r")
- f4 = fs.open(backf,"r")
- f5 = fs.open(topf,"r")
- f6 = fs.open(bottomf,"r")
- leftc = f1.readAll()
- rightc = f2.readAll()
- frontc = f3.readAll()
- backc = f4.readAll()
- topc = f5.readAll()
- bottomc = f6.readAll()
- f1.close()
- f2.close()
- f3.close()
- f4.close()
- f5.close()
- f6.close()
- if leftc == "0" then
- leftc = "no"
- else if leftc == "1" then
- leftc = "yes"
- end
- end
- if rightc == "0" then
- rightc = "no"
- else if rightc == "1" then
- rightc = "yes"
- end
- end
- if frontc == "0" then
- frontc = "no"
- else if leftc == "1" then
- frontc = "yes"
- end
- end
- if backc == "0" then
- backc = "no"
- else if backc == "1" then
- backc = "yes"
- end
- end
- if topc == "0" then
- topc = "no"
- else if topc == "1" then
- topc = "yes"
- end
- end
- if bottomc == "0" then
- bottomc = "no"
- else if bottomc == "1" then
- bottomc = "yes"
- end
- end
- term.setCursorPos(3,5)
- print(leftc)
- term.setCursorPos(3,7)
- print(rightc)
- term.setCursorPos(3,9)
- print(frontc)
- term.setCursorPos(3,11)
- print(backc)
- term.setCursorPos(3,13)
- print(topc)
- term.setCursorPos(3,15)
- print(bottomc)
- rednet.open("top")
- senderId,msg = rednet.receive()
- rednet.close("top")
- if msg == "cr" then
- rednet.open("top")
- rednet.send(senderId,"y")
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "lon" then
- f = fs.open(leftf,"w")
- f.write("1")
- f.close()
- redstone.setOutput("left",true)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "loff" then
- f = fs.open(leftf,"w")
- f.write("0")
- f.close()
- redstone.setOutput("left",false)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "ron" then
- f = fs.open(rightf,"w")
- f.write("1")
- f.close()
- redstone.setOutput("right",true)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "roff" then
- f = fs.open(rightf,"w")
- f.write("0")
- f.close()
- redstone.setOutput("right",false)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "fon" then
- f = fs.open(frontf,"w")
- f.write("1")
- f.close()
- redstone.setOutput("front",true)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "foff" then
- f = fs.open(frontf,"w")
- f.write("0")
- f.close()
- redstone.setOutput("front",false)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "baon" then
- f = fs.open(backf,"w")
- f.write("1")
- f.close()
- redstone.setOutput("back",true)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "baoff" then
- f = fs.open(backf,"w")
- f.write("0")
- f.close()
- redstone.setOutput("back",false)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "ton" then
- f = fs.open(topf,"w")
- f.write("1")
- f.close()
- redstone.setOutput("top",true)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "toff" then
- f = fs.open(topf,"w")
- f.write("0")
- f.close()
- redstone.setOutput("top",false)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "boon" then
- f = fs.open(bottomf,"w")
- f.write("1")
- f.close()
- redstone.setOutput("bottom",true)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- if msg == "booff" then
- f = fs.open(bottomf,"w")
- f.write("0")
- f.close()
- redstone.setOutput("bottom",false)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
- end
- term.clear()
- term.setTextColor(colors.red)
- term.setCursorPos(1,1)
- print("Starting Red Alert Server")
- f = fs.open("/RASD","r")
- rasd = f.readAll()
- f.close()
- print(rasd)
- rasdt = rasd.."temp"
- print(rasdt)
- fs.makeDir(rasdt)
- rasdf = rasd.."temp/"
- print(rasdf)
- leftf = rasdf.."left"
- rightf = rasdf.."right"
- frontf = rasdf.."front"
- backf = rasdf.."back"
- topf = rasdf.."top"
- bottomf = rasdf.."bottom"
- print(leftf)
- print(rightf)
- print(frontf)
- print(backf)
- print(topf)
- print(bottomf)
- f1 = fs.open(leftf,"w")
- f2 = fs.open(rightf,"w")
- f3 = fs.open(frontf,"w")
- f4 = fs.open(backf,"w")
- f5 = fs.open(topf,"w")
- f6 = fs.open(bottomf,"w")
- f1.write("0")
- f2.write("0")
- f3.write("0")
- f4.write("0")
- f5.write("0")
- f6.write("0")
- f1.close()
- f2.close()
- f3.close()
- f4.close()
- f5.close()
- f6.close()
- print("Successfully started Red Alert Server 1.0")
- sleep(3)
- rasm(leftf,rightf,frontf,backf,topf,bottomf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement