-- it would go
write "-> "
x = io.read()
--then
write "would you like to register"
-- so it would show up like this
->
what would you like to register
--but it was supposed to run like this
write "would you like to register"
write "->"
x = io.read()
please help me figure what is going on here!here is the full code
:
--this is going to identify any new login databases that join the network
function recieve()
event, param1 = os.pullEvent()
if event == "key" and param1 == "[" then
id, message = rednet.recieve()
end
end
-- this is going to send the login info to the database server
function server()
term.clear()
term.setCursorPos(8,1)
write "sending your login info to server!"
o = "New Login info"
id = register
ld = --put database id here
while true do
rednet.send(ld .. o .. "username: ".. h .. "password: ".. i)
end
--this is the registration procedure
function register()
term.clear()
write "what side is your modem on?"
term.setCursorPos(1,3)
write "->"
d = io.read()
write "thankyou"
rednet.open(d)
term.setCursorPos(1,2)
write "####################################"
term.setCursorPos(1,3)
write "# #"
term.setCursorPos(1,4)
write "# #"
term.setCursorPos(1,5)
write "# #"
term.setCursorPos(1,6)
write "# would you like to register? #"
term.setCursorPos(1,7)
write "# #"
term.setCursorPos(1,8)
write "# yes? no? #"
term.setCursorPos(1,9)
write "# #"
term.setCursorPos(1,10)
write "####################################"
term.setCursorPos(7,12)
write "type here ->"
term.setCursorPos(20,12)
x = io.read()
if x == "yes" then
write "ok"
sleep(1)
function regi()
term.clear()
term.setCursorPos(1,1)
write "what should your username be?"
term.setCursorPos(1,2)
write "nothing inappropiate"
term.setCursorPos(1,4)
write "->"
term.setCursorPos(4,4)
h = io.read()
term.setCursorPos(1,6)
print ("ok ["..h.."] will be your username")
sleep(2)
term.clear()
term.setCursorPos(1,1)
write "what should your passward be?"
term.setCursorPos(1,2)
write "again nothing innapropiate"
term.setCursorPos(1,4)
write "->"
term.setCursorPos(4,4)
i = io.read()
term.setCursorPos(1,6)
print ("ok ["..i.."] will be your passward")
term.clear()
term.setCursorPos(1,1)
write "ok. this is your info"
term.setCursorPos(1,3)
term.setTextColor(colors.red)
write ("UserName ->"..h)
term.setCursorPos(1,5)
term.setTextColor(colors.blue)
write ("PassWord ->"..i)
term.setCursorPos(7,7)
term.setTextColor(colors.white)
write "continue: Yes? No?"
term.setCursorPos(24,9)
write "->"
term.setCursorPos(26,9)
k = io.read()
if k == "yes"then
write "ok"
sleep(1)
server()
end
elseif k == "no" then
write "would you like to try again?"
g = io.read
if g == "yes" then
write "ok"
sleep (1)
regi()
elseif g == "no" then
write "ok"
sleep(1)
term.clear()
term.setCursorPos(1,1)
elseif x == "no" then
write "ok"
sleep(2)
term.clear()
term.setCursorPos(1,1)
end
end
end
end
parallel.waitForAny( recieve())