Posted 14 April 2015 - 02:32 AM
I'm trying to make a color-based locking system, wherein you use the paint program to mark out a code using colors, which is then read by another program and used as a key.
Applying one of each color, and reading the file outside of the paint progrem i've made the key
Which is all fine.
this is my attempt at reading a file:
Now, maybe it simply can't read the file as it was created using paint, or maybe i'm doing something horrifically incorrect, sadly I'm unsure. So here I am, and help is appreciated.
Applying one of each color, and reading the file outside of the paint progrem i've made the key
white:0
orange:1
magenta:2
lightBlue:3
yellow:4
lightGreen:5
pink:6
grey:7
lightGrey:8
cyan:9
purple:a
blue:b
brown:c
green:d
red:e
black:f
Which is all fine.
this is my attempt at reading a file:
print("please input a file name for testing")
ftc = tostring(read())
io.open(ftc,"r")
comp = ftc:read()
ftc:close()
print(comp)
It fails at line 4: "comp = ftc:read()": attempt to call nillNow, maybe it simply can't read the file as it was created using paint, or maybe i'm doing something horrifically incorrect, sadly I'm unsure. So here I am, and help is appreciated.