All pastes #141868 Raw Edit

Stuff

public text v1 · immutable
#141868 ·published 2006-08-21 04:31 UTC
rendered paste body
alias qw {
  sockudp -k qw $replace($$1-2,:,$chr(32)) ÿÿÿÿstatus
  sockmark qw $replace($1-2,:,$chr(32)) $ticks
}
on *:udpread:qw:{ 
  sockread &t
  if ($bvar(&t,0)) {
    var %h = $gettok($bvar(&t,1-).text,$calc($findtok($bvar(&t,1-).text,hostname,92) + 1),92), %ip = $+($gettok($sock(qw).mark,1,32),:,$gettok($sock(qw).mark,2,32)), %m = $gettok($bvar(&t,1-).text,$calc($findtok($bvar(&t,1-).text,map,92) + 1),92), %t = $gettok($bvar(&t,1-).text,$calc($findtok($bvar(&t,1-).text,deathmatch,92) + 1),92), %p = $calc($ticks - $gettok($sock(qw).mark,3,32)) $+ ms
    ;Actual message %h hostname, %ip ip %m map %t type %p ping
    echo -a %h ( $+ %ip $+ ) map: %m - type: %t - ping: %p
  } 
  sockclose $sockname 
}