Code:
on *:sockread:GameData: {
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    var %temptext
    sockread %temptext
    if (!%temptext) { hsave NewGameData $+(",$scriptdir\NewGameData.hsh") | unset %rank.cnt | halt }
    inc %rank.cnt
    tokenize 32 $gettok(%temptext,2-,41)
    var %Government = $replacex($iif($5 != $null,$4,$3),M,Monarchy,D,Democracy,R,Republic,H,Theocracy,C,Communism,I,Dictatorship,T,Tyranny,F,Fascism)
    hadd NewGameData $gettok(%temptext,1,32) 0 $+ $gettok($gettok(%temptext,2-,32),1,40) (# $+ $gettok(%temptext,1,32) $+ $chr(41) 03 Rank: %rank.cnt 03 NetWorth: $bytes($2,b) 03 Land: $bytes($1,b) 03 $iif($5 != $null,$3 03,03) %Government 03 GDI: $iif($5 != $null,$5,$4)
  }
}


Firgured it out. It was because the check for $5 failed to work properly if the last item (GDI) was 0. It should be fine now. (I hope) wink


Invision Support
#Invision on irc.irchighway.net