Skip to content

SERVFEAT

Sven edited this page May 13, 2017 · 1 revision

File

SCRIPT\SERVFEAT.DAT

Usage of file

Stores information regarding server features. Furthermore, in RAW numeric 5, PnP adds to features as found.

Usage in PnP

raw 4:*:{
  if ((nn-* iswm $3) && ($hget(pnp. $+ $cid,net) == internet)) hadd pnp. $+ $cid net NewNet
 
  ; Find matching server version for "additional features", max modes, num targets, identd prefixes
  window -hl @.servfeat
  loadbuf @.servfeat script\servfeat.dat
  var %num = $line(@.servfeat,0)
  :loop
  if ($gettok($line(@.servfeat,%num),1,32) iswm $3) {
    hadd pnp. $+ $cid -modes $gettok($line(@.servfeat,%num),2,32)
    hadd pnp. $+ $cid -target $gettok($line(@.servfeat,%num),3,32)
    hadd pnp. $+ $cid -feat $gettok($line(@.servfeat,%num),4-,32)
    hadd pnp. $+ $cid -matched $gettok($line(@.servfeat,%num),1,32)
  }
  elseif (%num > 1) { dec %num | goto loop }
  window -c @.servfeat
 
  ; Network
  if ($hget(pnp. $+ $cid,net) == internet) {
    hadd pnp. $+ $cid net $_cap1st($network)
    if (($hget(pnp. $+ $cid,net) == dalnet) && (*.dal.net !iswm $server)) hadd pnp. $+ $cid net internet
    elseif ($hget(pnp. $+ $cid,net) == $null) hadd pnp. $+ $cid net $iif(efnet isin $2,EFnet,internet)
  }
  if ((CR* iswm $3) && ($hget(pnp. $+ $cid,net) == internet)) hadd pnp. $+ $cid net $_cap1st($gettok($server,$count($server,.),46))
}
 
raw 5:*:{
  ; Decode raw 5- Add to feat / etc. as found
  if ($findtok($2-,WALLCHOPS,1,32)) hadd pnp. $+ $cid -feat $hget(pnp. $+ $cid,-feat) $+ @
  if ($findtok($2-,WHOX,1,32)) hadd pnp. $+ $cid -feat $hget(pnp. $+ $cid,-feat) $+ w
  if ($findtok($2-,USERIP,1,32)) hadd pnp. $+ $cid -feat $hget(pnp. $+ $cid,-feat) $+ u
  if (($findtok($2-,CPRIVMSG,1,32)) && ($findtok($2-,CNOTICE,1,32))) hadd pnp. $+ $cid -feat $hget(pnp. $+ $cid,-feat) $+ c
  if ($findtok($2-,MAP,1,32)) hadd pnp. $+ $cid -feat $hget(pnp. $+ $cid,-feat) $+ z
  if ($wildtok($2-,SILENCE=*,1,32)) hadd pnp. $+ $cid -feat $hget(pnp. $+ $cid,-feat) $+ s
  if ($wildtok($2-,MODES=*,1,32)) hadd pnp. $+ $cid -modes $gettok($ifmatch,2,61)
  if ($wildtok($2-,CHANTYPES=*,1,32)) hadd pnp. $+ $cid -feat $remove($hget(pnp. $+ $cid,-feat),l) $+ $iif(+ isin $ifmatch,l)
  if ($wildtok($2-,PREFIX=*,1,32)) hadd pnp. $+ $cid -feat $remove($hget(pnp. $+ $cid,-feat),h) $+ $iif(% isin $ifmatch,h)
  if ($wildtok($2-,NETWORK=*,1,32)) {
    var %net = $ifmatch
    ; Don't allow dalnet on non dal net servers
    if ((%net != dalnet) || (*.dal.net iswm $server)) hadd pnp. $+ $cid net $gettok(%net,2,61)
  }
  if ($wildtok($2-,NICKLEN=*,1,32)) hadd pnp. $+ $cid -nicklen $gettok($ifmatch,2,61)
}
Clone this wiki locally