I found a few mistakes:
line 12: should be "if redstone.getOutput("back") then" instead of "if redstone.getOutput("back",true) then"
line 29: delete "then"
line 41: delete "end"
line 43: delete the " after false and the "end" at the end
all places in the code where you have "input" it should be "read()" (with parenthesis). "input" is not a function, and you need parenthesis to actually call the function.
setCursorPos only uses whole numbers
Also, because of this code,
local Yes = "Yes, yes"
local No = "No, no"
the user has to answer exactly either "Yes, yes" or "No, no". I think what you where trying to do was have the program accept lowercase or uppercase "yes" and "no", but it won't work like that. There are many ways to fix this, look below for one way I fixed it.
Here is the fully fixed version, which I tested and seems to work perfectly:
local ANSWERS = {Yes = true, yes = true, No = false, no = false}
local monitor = peripheral.wrap("right")
monitor.clear()
monitor.setTextScale(2)
monitor.setCursorPos(3,3)
monitor.write("Waterflow:")
while true do
term.clear()
term.setCursorPos(1,1)
print("Waterflow:")
if redstone.getOutput("back") then
print(" On")
monitor.setCursorPos(4,4)
monitor.clearLine()
monitor.write("Released")
term.setCursorPos(1,3)
term.clearLine()
print("Do you want to stop the flow?")
local response = ANSWERS[read()]
if response then
redstone.setOutput("back",false)
monitor.setCursorPos(3,4)
monitor.clearLine()
monitor.write("Unreleased")
elseif response == false then
redstone.setOutput("back", true)
end
else
print(" Off")
monitor.setCursorPos(3,4)
monitor.clearLine()
monitor.write("Unreleased")
term.setCursorPos(1,3)
term.clearLine()
print("Do you want to turn on the flow?")
local response = ANSWERS[read()]
if response then
redstone.setOutput("back",true)
monitor.setCursorPos(4,4)
monitor.clearLine()
monitor.write("Released")
elseif response == false then
redstone.setOutput("back", false)
end
end
end