1: Instead of using "Connection: cloose" it should be "Connection: close"
Instead of having all those ifs to get the poke type(s) you could use regex:
var %treg = /class="type (normal|fire|water|electric|grass|ice|fighting|poison|ground|flying|psychic|bug|rock|ghost|dragon|steal)"/i
if ($regex(type,%poke.r,%treg)) {
%pdex.type = $iif(%pdex.type,$v1 $+ $chr(44)) $upper($left($regml(type,1),1) $+ $mid($regml(type,1),2-)
}