Posted 24 July 2018 - 09:05 AM
So I am trying to make a Yes/No menu function, and I am trying to get it so one or more of the args in the function call allows a different line of code, so for example:
Main reason is so I can reuse the same YesNo function with different results based on the context of the situation
function YesNo(a,B)/>
print("Do you want to continue?")
print("Y/N:")
write(" ")
local answer = read()
if answer == "Yes" then
print("Ok. Continuing.")
(Somehow put arg one here)
elseif answer == "No" then
("Ok, Canceling.")
(Somehow arg two here)
end
end
print("Delete system32?")
YesNo(fs.delete("system32"), os.reboot())
Main reason is so I can reuse the same YesNo function with different results based on the context of the situation