Code:
alias parse.servers {
  var %i = 1
  while $server(%i) {
    [color:green]; loop through servers.ini[/color]
    var %a = $ifmatch
    [color:green]; check network, and if IP address[/color]
    if $server(%a).group != $network || $regex(%a,/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/) {
      inc %i | continue
    }
    [color:green]; check if in @Links, if not:- remove, and re-add as "old network"[/color]
    if !$fline(@Links,$+(*,%a,*),1) {
      .server -r %a
      .server -a %a -g old
      continue
    }
    inc %i
  }
  var %i = 1
  while $line(@Links,%i) {
    [color:green]; loop through @Links[/color]
    tokenize 32 $ifmatch
    [color:green]; check for and skip hub servers[/color]
    if $istok($2-,HUB,32) || $istok($1,hub,46) { inc %i | continue }
    [color:green]; check and add to servers.ini if needed[/color]
    [color:blue]; Here you could add -p <ports to use> if you wish[/color]
    if !$server($1) { .server -a $1 -g $network -d $gettok($1,1,46) }
    inc %i
  }
  [color:green]; sort servers.ini[/color]
  server -s
}

edit--
This is assuming that @links contains the servers in the same format that 'Links list' would
irc.server.net (2) Somewhere, MX HUB Server
Although, the only thing required is the servers address

Last edited by Nimue; 17/02/03 02:44 PM.