; Posten Pakkesøk v1.0
; (C) 2001 Kai Hugo Hustoft Endresen. All Rights Reserved.
alias pakkesok {
//echo -a starter pakkesøk... $1
/set %pakkesok $1
/sockopen -n pakkesok 139.117.8.127 80
}
on 1:sockopen:pakkesok: {
if ($sockerr > 0) {
/echo -a ERROR: Connection could not be established.
return
}
/sockwrite -n pakkesok GET /Nettgods/Internett/nettspor_res.asp?sendingsnummer= $+ %pakkesok
}
on 1:sockread:pakkesok: {
if ($sockerr > 0) {
/echo -a ERROR: Could Not Read from Host
return
}
var %tmp
sockread %tmp
if ($sockbr == 0) return
if (!%tmp) %tmp = -
if ( $left(
, | )
}
alias pakket {
if ( $remove($1,.) isnum && $len($remove($1,.)) == 6 ) { /set %pakkesok.DATO $1- }
if ( $remove($1,.) isnum && $len($1) == 5 ) { /set %pakkesok.TID $1- }
if ( $1 isalpha ) { /set %pakkesok.STATUS $1- }
if ( $1 isnum && $2 != $null ) { //echo -a 4DATO: %pakkesok.DATO 4TID: %pakkesok.TID 4POSTSTED: $1- 4STATUS: %pakkesok.STATUS | unset %pakkesok.* }
; //echo -a DEBUG_OUTPUT: $1-
}
; Alarm on Arrival Posten Pakkesøk v1.0
; (C) 2001 Kai Hugo Hustoft Endresen. All Rights Reserved.
alias pakkealarm {
//echo -a sjekker posten nettsøk en gang per 5 minutt...
/timerpakke 0 300 /pakkealarm_1 $1
}
alias pakkealarm_1 {
;//echo -a starter pakkealarm... $1
/set %pakkesok $1
/sockopen -n pakkealarm 139.117.8.127 80
}
on 1:sockopen:pakkealarm: {
if ($sockerr > 0) {
/echo -a ERROR: Connection could not be established.
return
}
/sockwrite -n pakkealarm GET /Nettgods/Internett/nettspor_res.asp?sendingsnummer= $+ %pakkesok
}
on 1:sockread:pakkealarm: {
if ($sockerr > 0) {
/echo -a ERROR: Could Not Read from Host
return
}
var %tmp
sockread %tmp
if ($sockbr == 0) return
if (!%tmp) %tmp = -
if ( $left(, | )
}
alias pakketalarm {
if ( $1 == ANKOMSTREGISTRERT ) {
//echo -a PAKKE ER PÅ POSTKONTORET!
/splay
/timerpakke off
}
}