This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Greenwolf25's profile picture

[ERROR] io:5: unsupported format

Started by Greenwolf25, 14 May 2013 - 10:49 PM
Greenwolf25 #1
Posted 15 May 2013 - 12:49 AM
When I run my program it gives me the error io:5: unsuported format after I enter the username can some one help?


	-- var
	local Usern = 0
	local Passw = 0
	local iUsern = 0
	local iPassw = 0
	USER = 0
	-- table
	local UN = {"greenwolf","aim","potassium"}
	local PW = {"test","~","~"}
	-- function
	function UserC()
	  for i = 1,3 do
		 if UN[i] == iUsern then
			 Usern = i
		 end
	   end
	end
	function PassC()
		if PW[Usern] == iPassw and PW[Usern] ~= "~" then
			print("Welcome "..UN[Usern])
		else
			print("*Error* Wrong Password")
			sleep(1)
			print("Rebooting")
			reboot()
		end
	end
	-- codecls
	write ("Login: ")
	iUsern = io.read()
	UserC()
	write ("Password: ")
	iPassw = io.read("*")
	PassC()
	USER = Usern

MudkipTheEpic #2
Posted 15 May 2013 - 12:54 AM
Replace your io.read's with read's, then it should work.
Greenwolf25 #3
Posted 15 May 2013 - 08:01 PM
Replace your io.read's with read's, then it should work.
Thanks!