Posted 21 February 2016 - 06:39 PM
so im writing a menu for an apartment building in my city world and im trying to call functions but i dont know how? this is my code btw
function MainMenu()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Who Are You? |")
print("| |")
print("| Owner Or Customer? |")
print("| |")
print("| Reply by typing owner or customer |")
print("+—————————————-+")
write("Answer: ")
answer = read("*")
if answer == "owner" then
call(OwnerAccess) –this calling isnt working
else
call(CustomerMenu) –this calling isnt working
end
function OwnerAccess()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("|To Access Owner Files Please type the |")
print("| Correct Password |")
print("+—————————————-+")
print("Status: Unknown")
OwnerPass = read("*")
if OwnerPass == "test" then
– i need to call functions
end
function CustomerMenu()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Customer Options |")
print("| room 1 |")
print("| room 2 |")
print("| room 3 |")
print("| Reply by typing owner or customer |")
print("+—————————————-+")
write("rooms: ")
end
function OwnerPassCorrect()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Password Correct |")
print("| Welcome Bharhal |")
print("+—————————————-+")
print("Status: Owner")
sleep(5)
function OwnerOptions()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Options: |")
print("| Edit Code |")
print("+—————————————-+")
print("Status: Owner")
write("Owner: ")
OwnerPass = read("*")
if EditPass == "TEST" then
term.clear()
end
end
end
end
function MainMenu()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Who Are You? |")
print("| |")
print("| Owner Or Customer? |")
print("| |")
print("| Reply by typing owner or customer |")
print("+—————————————-+")
write("Answer: ")
answer = read("*")
if answer == "owner" then
call(OwnerAccess) –this calling isnt working
else
call(CustomerMenu) –this calling isnt working
end
function OwnerAccess()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("|To Access Owner Files Please type the |")
print("| Correct Password |")
print("+—————————————-+")
print("Status: Unknown")
OwnerPass = read("*")
if OwnerPass == "test" then
– i need to call functions
end
function CustomerMenu()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Customer Options |")
print("| room 1 |")
print("| room 2 |")
print("| room 3 |")
print("| Reply by typing owner or customer |")
print("+—————————————-+")
write("rooms: ")
end
function OwnerPassCorrect()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Password Correct |")
print("| Welcome Bharhal |")
print("+—————————————-+")
print("Status: Owner")
sleep(5)
function OwnerOptions()
term.clear()
term.setCursorPos(1,1)
print("+——–CraftCity Apartment's———–+")
print("| Options: |")
print("| Edit Code |")
print("+—————————————-+")
print("Status: Owner")
write("Owner: ")
OwnerPass = read("*")
if EditPass == "TEST" then
term.clear()
end
end
end
end