I changed it up a bit so you can check the uptime of any caster with !uptime
caster. The problem im running into though, is that you need to trigger the command twice before it returns the right info.. not sure why
on *:sockopen:uptime: {
sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ %caster HTTP/1.1
sockwrite -n $sockname Host: www.nightdev.com
sockwrite -n $sockname User-Agent: Mozilla/30.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:uptime:{
var %uptime
sockread %uptime
/writeini uptime.ini Uptime %uptime
}
on *:text:!uptime*:#: {
set %caster $2
sockclose uptime
sockopen uptime nightdev.com 80
msg # Uptime: $read(uptime.ini,n,8)
remove uptime.ini
}
its like its returning info from the LAST query...