Posted 17 February 2013 - 10:29 PM
Topic: Touchscreen Password
Hello, ich have a problem with my new Touchscreen Password programm. May somebody can help me?
The error is:
Here is my code:
Sorry for my bad english, but I am German :-)
Hello, ich have a problem with my new Touchscreen Password programm. May somebody can help me?
The error is:
bios:338: [string "pw"]:94: "<eof>" expected
Here is my code:
passwort = 1218
count = 0
a = 0
b = 0
c = 0
d = 0
eingabe = 0
zugang = 0
function Rahmen()
shell.run("clear")
term.setBackgroundColor(colors.green)
term.setCursorPos(3,2)
print("123")
term.setCursorPos(3,3)
print("456")
term.setCursorPos(3,4)
print("789")
end
term.setBackgroundColor(colors.black)
function Eingabe()
while count < 4 do
event,side,x,y = os.pullEvent()
if event == "monitor_touch" then
if x == 3 and y == 2 then
count = count + 1
a = 1
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 1
write("*")
elseif count == 3 then
c = 1
write("x")
elseif count == 4 then
d = 1
write("*")
end
end
if x == 4 and y == 2 then
count = count + 1
a = 2
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 2
write("*")
elseif count == 3 then
c = 2
write("x")
elseif count == 4 then
d = 2
write("*")
end
end
if x == 5 and y == 2 then
count = count + 1
a = 3
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 3
write("*")
elseif count == 3 then
c = 3
write("x")
elseif count == 4 then
d = 3
write("*")
end
end
if x == 3 and y == 3 then
count = count + 1
a = 4
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 4
write("*")
elseif count == 3 then
c = 4
write("x")
elseif count == 4 then
d = 4
write("*")
end
end
if x == 4 and y == 3 then
count = count + 1
a = 5
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 5
write("*")
elseif count == 3 then
c = 5
write("x")
elseif count == 4 then
d = 5
write("*")
end
end
if x == 5 and y == 3 then
count = count + 1
a = 6
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 6
write("*")
elseif count == 3 then
c = 6
write("x")
elseif count == 4 then
d = 6
write("*")
end
end
if x == 3 and y == 4 then
count = count + 1
a = 7
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 7
write("*")
elseif count == 3 then
c = 7
write("x")
elseif count == 4 then
d = 7
write("*")
end
end
if x == 4 and y == 4 then
count = count + 1
a = 8
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 8
write("*")
elseif count == 3 then
c = 8
write("x")
elseif count == 4 then
d = 8
write("*")
end
end
if x == 5 and y == 4 then
count = count + 1
a = 9
term.setBackgroundColor(colors.black)
write("*")
elseif count == 2 then
b = 9
write("*")
elseif count == 3 then
c = 9
write("x")
elseif count == 4 then
d = 9
write("*")
end
end
end
count = 0
end
while true do
Rahmen()
Eingabe()
eingabe = (""..a..""..b..""..c..""..d..")
zugang = (passwort-eingbe)
if zugang == 0 then
write("OK")
rs.setOutput("bottom", true)
sleep(2.5)
rs.setOutput("bottom", false)
else write("FALSCH")
end
sleep(3)
term.setBackgroundColor(colors.black)
end
Sorry for my bad english, but I am German :-)