Posted 30 January 2013 - 08:49 AM
io.read() seems to always output to the variable as text, and I need it as an integer to sanitize and interpret the input for use in my functions. I've never used Lua prior to last night, so any help would be appreciated.
The code in question(I commented out the parts in question so I could test other functions)
shell.run('clear')
print("How long do you want the quarry to be?")
length = io.read()
–if length>64 or length<8 then
– print("Please input a number between 8 and 64:")
– length = io.read()
–end
print("How wide do you want the quarry to be?")
width = io.read()
–if width>64 or width<8 then
– print("Please input a number between 8 and 64:")
– width = io.read()
–end
The code in question(I commented out the parts in question so I could test other functions)
shell.run('clear')
print("How long do you want the quarry to be?")
length = io.read()
–if length>64 or length<8 then
– print("Please input a number between 8 and 64:")
– length = io.read()
–end
print("How wide do you want the quarry to be?")
width = io.read()
–if width>64 or width<8 then
– print("Please input a number between 8 and 64:")
– width = io.read()
–end