Posted 26 November 2012 - 11:40 PM
Hey Guys,
I have this little code here and I was wonder if I may get a litle help with it. Basicly Im trying to set up a little automated information desk with some of our most common questsions.
*All the print ( ) is because that is the only way I know how to make a new line/space :P/>/>
print ("Hi! How can I help you today?")
print ("please type what you need help with exactly as it is below")
print ( )
print ("I have been Griefed")
print ("How do I earn money?")
print ("How do I protect my house?")
print ("How do I make a town?")
input = read()
if input == "I have been Griefed" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("OH NO!! that is no good at all, lets see if we can fix that for you. Please stand by the missing items/blocks looking directly where they were and submit a ticket /ticket new I have been griefed and I am missing {item/blocks you are missing}")
elseif input == "How do I earn money?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You earn money from having a job. We have many jobs avable simple type /jobs browse to view them. When you have found a job for you type /job join {job name}")
elseif input == "How do I protect my house?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You can protect your house by joining a town or making a town. To join a town you must be invited by the mayor or assistant. To make a town please type How do I make a town")
elseif input == "How do I make a town?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("towns are a great way to protect your items and your house. They are also great for your friends too. To make a town you must be 20 chunks away, to see if you are 20 chunks away have a look at the live server map on the website. When you are 20 chunks away type /t new {town Name}")
elseif input == "I have been Griefed" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("OH NO!! that is no good at all, lets see if we can fix that for you. Please stand by the missing items/blocks looking directly where they were and submit a ticket /ticket new I have been griefed and I am missing {item/blocks you are missing}")
elseif input == "How do I earn money?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You earn money from having a job. We have many jobs avable simple type /jobs browse to view them. When you have found a job for you type /job join {job name}")
elseif input == "how do I protect my house?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You can protect your house by joining a town or making a town. To join a town you must be invited by the mayor or assistant. To make a town please type How do I make a town")
elseif input == "how do I make a town?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("towns are a great way to protect your items and your house. They are also great for your friends too. To make a town you must be 20 chunks away, to see if you are 20 chunks away have a look at the live server map on the website. When you are 20 chunks away type /t new {town Name}")
end
print ( )
print ( )
print ("Is there anything else I can help you with?")
print ("Yes/No")
input = read()
if input == "Yes" then
print ( )
print ("Want can I help you with?")
elseif input == "No" then
print ( )
print ("Thank you for visting the Kiosk")
end
print ("Goodbye!")
Im having a little trouble with printcenter. There are a few things namely
If I do
I get a error "attempt to call nil" on the computer
I am also wondering if there is away to have it loop back when it gets back to
I would like it to loop back to
Thanks in advance for you help guys, I am a great noob when it comes to LUA XD
I have this little code here and I was wonder if I may get a litle help with it. Basicly Im trying to set up a little automated information desk with some of our most common questsions.
*All the print ( ) is because that is the only way I know how to make a new line/space :P/>/>
Spoiler
local inputprint ("Hi! How can I help you today?")
print ("please type what you need help with exactly as it is below")
print ( )
print ("I have been Griefed")
print ("How do I earn money?")
print ("How do I protect my house?")
print ("How do I make a town?")
input = read()
if input == "I have been Griefed" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("OH NO!! that is no good at all, lets see if we can fix that for you. Please stand by the missing items/blocks looking directly where they were and submit a ticket /ticket new I have been griefed and I am missing {item/blocks you are missing}")
elseif input == "How do I earn money?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You earn money from having a job. We have many jobs avable simple type /jobs browse to view them. When you have found a job for you type /job join {job name}")
elseif input == "How do I protect my house?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You can protect your house by joining a town or making a town. To join a town you must be invited by the mayor or assistant. To make a town please type How do I make a town")
elseif input == "How do I make a town?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("towns are a great way to protect your items and your house. They are also great for your friends too. To make a town you must be 20 chunks away, to see if you are 20 chunks away have a look at the live server map on the website. When you are 20 chunks away type /t new {town Name}")
elseif input == "I have been Griefed" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("OH NO!! that is no good at all, lets see if we can fix that for you. Please stand by the missing items/blocks looking directly where they were and submit a ticket /ticket new I have been griefed and I am missing {item/blocks you are missing}")
elseif input == "How do I earn money?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You earn money from having a job. We have many jobs avable simple type /jobs browse to view them. When you have found a job for you type /job join {job name}")
elseif input == "how do I protect my house?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("You can protect your house by joining a town or making a town. To join a town you must be invited by the mayor or assistant. To make a town please type How do I make a town")
elseif input == "how do I make a town?" then
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ( )
print ("towns are a great way to protect your items and your house. They are also great for your friends too. To make a town you must be 20 chunks away, to see if you are 20 chunks away have a look at the live server map on the website. When you are 20 chunks away type /t new {town Name}")
end
print ( )
print ( )
print ("Is there anything else I can help you with?")
print ("Yes/No")
input = read()
if input == "Yes" then
print ( )
print ("Want can I help you with?")
elseif input == "No" then
print ( )
print ("Thank you for visting the Kiosk")
end
print ("Goodbye!")
Im having a little trouble with printcenter. There are a few things namely
print ("Hi! How can I help you today?")
print ("please type what you need help with exactly as it is below")
If I do
printcenter ("Hi! How can I help you today?")
printcenter ("please type what you need help with exactly as it is below")
I get a error "attempt to call nil" on the computer
I am also wondering if there is away to have it loop back when it gets back to
if input == "Yes" then
print ( )
print ("Want can I help you with?")
elseif input == "No" then
print ( )
print ("Thank you for visting the Kiosk")
I would like it to loop back to
print ("I have been Griefed")
print ("How do I earn money?")
print ("How do I protect my house?")
print ("How do I make a town?")
If they answer yes, and I would like it to close the GUI if they answer no. Is there anyway to do this?Thanks in advance for you help guys, I am a great noob when it comes to LUA XD