Posted 22 September 2012 - 08:55 PM
Hey! I have this problem with my System:
i've made a Login system, that works fine…. but.
when i reach to a specific code/line in the code, then it dosent works that i'd think it should do…..
in my Startup menu, i've made a "Choose-an-option" system,
like this:
"
> Login
Exit
"
but i'd use this feature alot of times, but… when i made a double of that trick, it just dosent works.
look at the code, and find the markers i'd make….. can u fix the problem????
if u can… please tell me what i have to change.
this is the feature:
"
> Close/Open Doors
Exit
"
when i enter the "Close/Open Doors" then:
"
> 1 = "-" <– this is not a fail, but here i cannot move the ">"
2 = "-"
3 = "!"
4 = "-"
"
PLEASE HELP!
i've made a Login system, that works fine…. but.
when i reach to a specific code/line in the code, then it dosent works that i'd think it should do…..
in my Startup menu, i've made a "Choose-an-option" system,
like this:
"
> Login
Exit
"
but i'd use this feature alot of times, but… when i made a double of that trick, it just dosent works.
look at the code, and find the markers i'd make….. can u fix the problem????
if u can… please tell me what i have to change.
this is the feature:
"
> Close/Open Doors
Exit
"
when i enter the "Close/Open Doors" then:
"
> 1 = "-" <– this is not a fail, but here i cannot move the ">"
2 = "-"
3 = "!"
4 = "-"
"
PLEASE HELP!
Spoiler
---[[ CursorPos
function Pos(dm1,dm2)
term.setCursorPos(dm1,dm2)
end
---]]
---[[ D(Number)
D1 = "-"
D2 = "-"
D3 = "-"
D4 = "-"
D5 = "-"
D6 = "-"
D7 = "-"
D8 = "-"
D9 = "-"
D0 = "-"
DX1 = "!"
DX2 = "!"
---]]
---[[ Options
Line1 = 0
Line2 = 0
function Opt1(id, text)
if Line2 == id then
write"> "
elseif Line2 == 1 then
write""
end
print(text)
end
function Opt(id, text)
if Line1 == id then
write"> "
elseif Line1 == 1 then
write""
end
print(text)
end
function Optia1()
while true do
Pos(13,4)
Opt(0, "Close/Open Doors")
Pos(13,5)
Opt(1, "Exit")
event, key = os.pullEvent("key")
if key == 200 then
if Line2 > 0 then
Line2 = Line1 - 1
end
elseif key == 208 then
if Line2 < 1 then
Line2 = Line2 + 1
end
elseif key == 28 then
if Line2 == 0 then
Pos(8,6)
elseif Line2 == 0 then
return false
elseif Line2 == 1 then
os.shutdown()
end
return false
end
end
end
Jost = 0
---]]Here i have the problem:
function Continue12()
if Line1 == 0 then
term.clear()
Jost = 1
Pos(8,9)
term.clearLine()
Opt1(0, "1 = "..D1.."")
Pos(8,10)
term.clearLine()
Opt1(1, "2 = "..D2.."")
Pos(8,11)
term.clearLine()
Opt1(2, "3 = "..D3.."")
Pos(8,12)
term.clearLine()
Opt1(3, "4 = "..D4.."")
event, key = os.pullEvent("key")
if key == 200 then
if Line2 > 0 then
Line2 = Line2 - 1
end
elseif key == 208 then
if Line2 < 1 then
Line2 = Line2 + 1
end
elseif key == 28 then
if Line2 == 0 then
Pos(8,6)
return true
elseif Line2 == 1 then
return true
end
elseif Line2 == 2 then
return true
end
elseif Line2 == 3 then
return true
end
return true
end
function Optia()
while true do
if Jost == 0 then
Pos(13,7)
term.clearLine()
Opt(0, "Close/Open Doors")
Pos(13,8)
term.clearLine()
Opt(1, "Exit")
event, key = os.pullEvent("key")
if key == 200 then
if Line1 > 0 then
Line1 = Line1 - 1
end
elseif key == 208 then
if Line1 < 1 then
Line1 = Line1 + 1
end
elseif key == 28 then
if Line1 == 0 then
Continue12() <-- here i did make a feature, that does the
"choose-an-option" system again, but when
it reach that part of the code, then i cannot move
to another Option.... why?
Jost = 1
elseif Line1 == 0 then
return false
elseif Line1 == 1 then
os.shutdown()
end
return false
end
end
end
end
---]] the problem is between theese markers. ^
---]]
---[[ Jail System (terminal doorShow)
x = 0
function JailStart()
if Jost == 0 then
term.clear()
Pos(1,1)
print(" +---+---+---+---+---+---+---+---+---+---+")
sleep(0.2)
print(" + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 +")
sleep(0.3)
---[[ RepeatZone
repeat
if Jost == 0 then
Pos(1,3)
print(" +-"..D1.."-+-"..D2.."-+-"..D3.."-+-"..D4.."-+-"..D5.."-+-"..D6.."-+-"..D7.."-+-"..D8.."-+-"..D9.."-+-"..D0.."-+")
print("+---+")
Pos(1,5)
print(""..DX1.." "..DX2.."")
print("+---+")
sleep(2)
x = x+1
Optia()
Jost = 1
end
until x == 4
--]]
end
end
---]]
---[[ Main System (Login)
CHE = 0
function LogIn()
term.clear()
term.setCursorPos(1,1)
print("+----------------------+")
print("+ Enter Username! +")
print("+----------------------+")
term.setCursorPos(3,2)
UserName = read()
if UserName == "Admin1" then
term.setCursorPos(3,2)
print("Welcome "..UserName.." +") --Correct Username
sleep(3)
term.setCursorPos(1,4)
print("+----------------------+")
print("+ Enter Password +")
print("+----------------------+")
sleep(2)
term.setCursorPos(3,5)
PassWord = read("#")
term.setCursorPos(3,5)
if PassWord == "MoSie" then
term.setCursorPos(3,5)
print("Password is Correct, "..UserName.."")
sleep(0.1)
print("+----------------------+")
print("+ Booting Jail System! +")
print("+----------------------+")
sleep(4)
JailStart()
elseif PassWord ~= "MoSie" then
term.setCursorPos(3,5)
print("Password is Incorrect+ Acces denied!")
sleep(3)
LogIn()
end
elseif UserName ~= "Admin1" then
term.setCursorPos(3,2)
print("Username not founded!+")
sleep(3)
LogIn()
end
end
function menu(id, text)
if CHE == id then
write"> "
elseif CHE == 1 then
write""
end
print(text)
end
while true do
term.clear()
term.setCursorPos(2,1)
menu(0, "Login")
term.setCursorPos(2,2)
menu(1, "Exit")
event, key = os.pullEvent("key")
if key == 200 then
if CHE > 0 then
CHE = CHE - 1
end
elseif key == 208 then
if CHE < 1 then
CHE = CHE + 1
end
elseif key == 28 then
if CHE == 0 then --Login System Automation
LogIn()
elseif CHE == 0 then
return false
elseif CHE == 1 then
os.shutdown()
end
return false
end
end
---]]