Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.white)
- print("select time to wait between end of one order till next order. It have to bee higher than the ritual takes (seconds, default 300)")
- sdelay = read()
- if tonumber(sdelay) == "" then
- delay = 6000
- else
- if tonumber(sdelay) == nil then
- delay = 6000
- else
- delay = tonumber(sdelay) * 20
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.white)
- print("select the side where the redstone signal of the level emitter is attached (right,left,back,front,bottom,top)")
- err = true
- while err do
- side = read()
- if (side == "right") or (side == "left") or (side == "back") or (side == "front") or (side == "top") or (side == "bottom") then
- err = false
- else
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.red)
- print("Please choose one of the following: (right,left,back,front,bottom,top)")
- term.setTextColor(colors.white)
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.white)
- les = side
- print("select the side where the redstone signal of the heart detector is attached (right,left,back,front,bottom,top)")
- err = true
- while err do
- side = read()
- if (side == "right") or (side == "left") or (side == "back") or (side == "front") or (side == "top") or (side == "bottom") then
- err = false
- else
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.red)
- print("Please choose one of the following: (right,left,back,front,bottom,top)")
- term.setTextColor(colors.white)
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.white)
- hds = side
- print("select the side where the autonomous activator is attached (right,left,back,front,bottom,top)")
- err = true
- while err do
- side = read()
- if (side == "right") or (side == "left") or (side == "back") or (side == "front") or (side == "top") or (side == "bottom") then
- err = false
- else
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.red)
- print("Please choose one of the following: (right,left,back,front,bottom,top)")
- term.setTextColor(colors.white)
- end
- end
- aas = side
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.white)
- print("installing....")
- mf = fs.open("end", "w")
- mf.writeLine("delay = " .. delay)
- mf.writeLine("activatordel = 0.8")
- mf.writeLine("levelemitter = \"" .. les .. "\"")
- mf.writeLine("heartdetector = \"" .. hds .. "\"")
- mf.writeLine("activator = \"" .. aas .."\"")
- mf.writeLine("dsfr = fs.open(\"dsf\", \"r\")")
- mf.writeLine("dtext = dsfr.readLine()")
- mf.writeLine("dsf = fs.open(\"dsf\", \"w\")")
- mf.writeLine("dsf.writeLine(dtext)")
- mf.writeLine("dsf.flush()")
- mf.writeLine("cdelay = tonumber(dtext)")
- mf.writeLine("rsfr = fs.open(\"rsf\", \"r\")")
- mf.writeLine("rtext = rsfr.readLine()")
- mf.writeLine("rsf = fs.open(\"rsf\", \"w\")")
- mf.writeLine("rsf.writeLine(rtext)")
- mf.writeLine("rsf.flush()")
- mf.writeLine("if rtext == \"true\" then")
- mf.writeLine(" rq = true")
- mf.writeLine("else")
- mf.writeLine(" rq = false")
- mf.writeLine("end")
- mf.writeLine("le = false")
- mf.writeLine("print(\"Starting end script ...\"")
- mf.writeLine("print(\"Sucessfully started end script!\"")
- mf.writeLine("while true do ")
- mf.writeLine(" if cdelay > 0 then")
- mf.writeLine(" cdelay = cdelay - 1")
- mf.writeLine(" dsf = fs.open(\"dsf\",\"w\")")
- mf.writeLine(" dsf.write(cdelay)")
- mf.writeLine(" dsf.flush()")
- mf.writeLine(" end")
- mf.writeLine(" if redstone.getInput(heartdetector) == true then")
- mf.writeLine(" if le == true then")
- mf.writeLine(" redstone.setOutput(activator , true)")
- mf.writeLine(" sleep(activatordel)")
- mf.writeLine(" redstone.setOutput(activator , false)")
- mf.writeLine(" cdelay = 6000")
- mf.writeLine(" dsf = fs.open(\"dsf\", \"w\")")
- mf.writeLine(" dsf.write(\"6000\")")
- mf.writeLine(" dsf.flush()")
- mf.writeLine(" else")
- mf.writeLine(" rq = true")
- mf.writeLine(" rsf = fs.open(\"rsf\",\"w\")")
- mf.writeLine(" rsf.write(\"true\")")
- mf.writeLine(" rsf.flush()")
- mf.writeLine(" end")
- mf.writeLine(" end")
- mf.writeLine(" if redstone.getInput(levelemitter) == true then")
- mf.writeLine(" le = true")
- mf.writeLine(" if rq then")
- mf.writeLine(" redstone.setOutput(activator , true)")
- mf.writeLine(" sleep(activatordel)")
- mf.writeLine(" redstone.setOutput(activator , false)")
- mf.writeLine(" rq = false")
- mf.writeLine(" rsf = fs.open(\"rsf\" , \"w\")")
- mf.writeLine(" rsf.write(\"false\")")
- mf.writeLine(" rsf.flush()")
- mf.writeLine(" cdelay = 6000")
- mf.writeLine(" dsf = fs.open(\"dsf\",\"w\")")
- mf.writeLine(" dsf.write(\"6000\")")
- mf.writeLine(" dsf.flush()")
- mf.writeLine(" end")
- mf.writeLine(" if cdelay == 0 then")
- mf.writeLine(" redstone.setOutput(activator , true)")
- mf.writeLine(" sleep(activatordel)")
- mf.writeLine(" redstone.setOutput(activator , false)")
- mf.writeLine(" cdelay = 6000")
- mf.writeLine(" dsf = fs.open(\"dsf\",\"w\")")
- mf.writeLine(" dsf.write(\"6000\")")
- mf.writeLine(" dsf.flush()")
- mf.writeLine(" end")
- mf.writeLine(" else")
- mf.writeLine(" le = false ")
- mf.writeLine(" end")
- mf.writeLine(" sleep(0.5)")
- mf.writeLine("end")
- mf.close()
- dsf = fs.open("dsf", "w")
- dsf.writeLine("0")
- dsf.close()
- rsf = fs.open("rsf", "w")
- rsf.writeLine("false")
- rsf.close()
- stup = fs.open("startup","a")
- stup.writeLine("shell.run(\"end\")")
- stup.close()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.blue)
- print("INSTALL SCRIPT FOR AUTOMATIC END FARM 1.7.10")
- term.setTextColor(colors.green)
- print("finished")
- term.setTextColor(colors.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement