pokenew1 = 0
slot2 = 0
for pokenew = 1, 6 do
	if pokemon[pokenew].MAX_HP == 0 and pokenew1 == 0 then
		slot2 = pokenew
		pokenew1 = 1
		slot = pokenew * 100	
	end

end

blue = Color.new(56,172,236)
a = 0
file = io.open("./pokemon/sentret/sentret.txt", "r")
pokemon[slot2].name = file:read(7)
blank = file:read()
pokemon[slot2].exp = 1
pokemon[slot2].MAX_HP = file:read("*n")
blank = file:read()
pokemon[slot2].STR = file:read("*n")
blank = file:read()
pokemon[slot2].DEF = file:read("*n")
blank = file:read()
pokemon[slot2].AGI = file:read("*n")
blank = file:read()
pokemon[slot2].SPA = file:read("*n")
blank = file:read()
pokemon[slot2].SPD = file:read("*n")

file:close()

pokemon[slot2].C_HP = pokemon[slot2].MAX_HP
pokemon[slot2].picB = Image.load("./pokemon/sentret/sentret_back.png")



textbox = Image.load("talkbox.png")
textarrow = Image.load("text_arrow.png")
p = 0
e = 0
attackn = 1
line = 0
file = io.open("./pokemon/sentret/sentret_attacks.txt", "r")
if e == 0 then
	level = file:read("*n")
	if attackn == 1 and pokemon[slot2].lv >= level then
		p_attacks[slot +1].name = file:read(12)
		p_attacks[slot +1].attribute = file:read(7)
		p_attacks[slot +1].power = file:read("*n")
		p_attacks[slot +1].accuracy = file:read("*n")
		blank = file:read()
		attackn = attackn +1

	end
	level = file:read("*n")
	if attackn == 2 and pokemon[slot2].lv >= level then
		p_attacks[slot +2].name = file:read(12)
		p_attacks[slot +2].attribute = file:read(7)
		p_attacks[slot +2].power = file:read("*n")
		p_attacks[slot +2].accuracy = file:read("*n")
		blank = file:read()
	attackn = attackn +1	

	end
	level = file:read("*n")
	if attackn == 3 and pokemon[slot2].lv >= level then
		p_attacks[slot +3].name = file:read(12)
		p_attacks[slot +3].attribute = file:read(7)
		p_attacks[slot +3].power = file:read("*n")
		p_attacks[slot +3].accuracy = file:read("*n")
		blank = file:read()
	attackn = attackn +1
	end
	level = file:read("*n")
	if attackn == 4 and pokemon[slot2].lv >= level then
		p_attacks[slot +4].name = file:read(12)
		p_attacks[slot +4].attribute = file:read(7)
		p_attacks[slot +4].power = file:read("*n")
		p_attacks[slot +4].accuracy = file:read("*n")
		blank = file:read()
	attackn = attackn +1
	end
	if attackn == 5 then
		e = 1
	end
end
file:close()
slot = 0
slot2 = 0