selectorx = 163
selectory = 30
switch = 0 
counter = 0
while switch == 0 do
pad = Controls.read()
	screen:blit(0,0,statpage)
	counter = counter +1
	screen:blit(selectorx, selectory, selector)
	screen:print(240, 30, pokemon[2].name .. "     lv" .. pokemon[2].lv .. "   HP   " ..pokemon[2].C_HP .. "/" .. pokemon[2].MAX_HP, blue)
	if pad:r() and oldpad:r() ~= pad:r() and counter >= 5 then
		randombattle = 0
		selectorx = 163
		selectory = 38	
		current = 2
		turn = 0
		switch = 1

	end

screen.waitVblankStart()
screen.flip()
oldpad = pad
end