alias tib.s {
sockclose Tibia
sockopen Tibia www.tibia.4players.de 80
;http://tibia.4players.de/community/?subtopic=character&name=Rott
if ($1-) {
.sockmark Tibia $+(/community/?subtopic=character&name=,$1-)
}
}
on *:sockopen:Tibia:{
if ($sockerr) {
echo $color(info) -s *** Socket Error (on open) \ $sockname - $sock($sockname).ip
return
}
sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname Host: www.tibia.4players.de
sockwrite -n $sockname $crlf
}
on *:sockread:Tibia:{
if ($sockerr) {
echo $color(info) -s *** Socket Error (on read) \ $sockname - $sock($sockname).ip
return
}
sockread -fn %tmp
if (doesn't exist. isin %tmp) {
echo -s This character doesnt exist
goto end
}
if (Character Information isin %tmp) {
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),1,58))
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),2,58))
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),3,58))
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),4,58))
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),5,58))
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),6,58))
echo -s $removehtml($gettok($iif(%tmp == $null,-,%tmp),7,58))
}
:end
unset %tmp %c
halt
}
alias removehtml {
var %a
!.echo -q $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,,%a)
return %a
}