Top

Ventrilo Server Status


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jul 11, 2009
Last Updated  Jul 12, 2009
Tags  http  imrac  query  server  socket  status  vent  ventrilo  www.ventrilo.com 

Description

Quick snippet I threw together to get the status of a ventrilo server. I was unable to directly query a server because of the semi-proprietary way you have to ask for the status, instead I used a xmlish feed from an outside webhost.

To use, just make a variable %vent with ip:port

Have fun.

*** UPDATED Sunday, July 12, 2009 ***

Added a GUI vent status thing, its rough, not much error check just enough to show what could be done. I will also need to work out a way to sort by channels CID parameter rather than alphabetic to get a more accurate representation of the server layout.
Usage: /ventg ip:port


Grab the Code

alias ventc {
  sockopen ventc ventrilostatus.net 80
  sockmark ventc $1-
  .timervent 1 3 vent_timeout
}
 
alias vent_timeout {
  var %msg = $gettok($sock(vent).mark,2,32)
  msg %msg Sorry, but the server took to long to respond or is down. Try again later.
  sockclose vent
}
 
alias ventg {
  sockopen ventg ventrilostatus.net 80
  sockmark ventg $1
}
 
on *:SOCKOPEN:vent*:{
  If ($sockerr) { echo error | halt }
  sockwrite -n $sockname GET /xml/ $+ $gettok($sock($sockname).mark,1,32) $+ / HTTP/1.1
  sockwrite -n $sockname Host: ventrilostatus.net
  sockwrite -n $sockname $crlf 
  If ($hget(vent)) hfree vent
}
 
on *:SOCKREAD:ventc:{
  var %x
  sockread %x
  If ($regex(sv,%x,/^<server name="(.*)" phonetic="(.*)" comment="(.*)" auth="(.*)" maxclients="(.*)" uptime="(.*)" platform="(.*)" version="(.*)" channelcount="(.*)" clientcount="(.*)" voicecodec="(.*)" voiceformat="(.*)">/i)) {
    var %svinfo = The3 $regml(sv,1) (03 $+ $+ $gettok($sock($sockname).mark,1,32) $+ ) Ventrilo server is online and has been up for3 $duration($regml(sv,6)) $+ . Users:3 $regml(sv,10) $+ /03 $+ $regml(sv,5)
    var %c = $regex(client,%x,/<client(.*?)/>/ig), %users
    While (%c) {
      noop $regex(info,$regml(client,%c),/admin="(.*)" phan="(.*)" ping="(.*)" sec="(.*)" cid="(.*)" name="(.*)" comm="(.*)"/i)
      %users = %users $iif($regml(info,1),07,) $+ $regml(info,6) $+ 
      dec %c   
    }
    var %msg = $gettok($sock($sockname).mark,2,32)
    msg %msg %svinfo
    msg %msg Current Users: %users
    .timervent off
    sockclose ventc
  }
}
 
on *:TEXT:*:#:{ If ($regex($1-,/^[!^&@.]v(ent(irlo)?)?$/iS)) { ventc %vent # } }
 
 
;<channel pid="-1" prot="0" cid="0" name="Lobby" comm="">
on *:SOCKREAD:ventg:{
  window @test 10 10 300 600
  clear @test
  var %x
  sockread %x
  var %y = $regex(main,%x,/(<.*?>)/gi), %z = 1, %tb = 0
  while (%z <= %y) {
    var %m = $regml(main,%z)
 
    If (%m == </channel>) dec %tb 1
    ElseIf ($regex(c,%m,/<channel pid="(.*)" prot="(.*)" cid="(.*)" name="(.*)" comm="(.*)"(/?)>/)) { 
      aline @test $+($str(  ,%tb),,$replace($iif($regml(c,2),$v1,3),1,08,2,05,3,10),$iif($regml(c,6),+,-),,$regml(c,4))
      if (!$regml(c,6)) { inc %tb 1 }
      ;aline @test CID: $regml(c,3)
    }
    ElseIf ($regex(cl,%m,<client admin="(.*)" phan="(.*)" ping="(.*)" sec="(.*)" cid="(.*)" name="(.*)" comm="(.*)"/>)) {
      aline @test $+($str(  ,$calc(%tb + 1)),05ยป ,$iif($+($iif($regml(cl,1),A,),$iif($regml(cl,2),P,)),14 $+ $qt($v1) ,),$regml(cl,6))
    }
    inc %z 1
  }
}

Comments

  (5)  RSS
GrimReaper
Comments: 18
 
mIRC Snippet:  Ventrilo Server Status
Posted on Jul 11, 2009 8:52 am
why not add

on *:LOAD: {
set %vent $$?="Set IP and Port in the Format IP:PORT"
}

to the top of your script. then they can add it if they know the IP and Port number.

also Great work on the script

9/10 it will come in handy :>
TheImrac
Comments: 69
 
mIRC Snippet:  Ventrilo Server Status
Posted on Jul 12, 2009 3:18 am
Updated, read above.
deeps
Comments: 1
 
mIRC Snippet:  Ventrilo Server Status
Posted on Jul 12, 2009 4:14 am
hmm for some reason this stopped working for me when i updated it with the new script provided :(
TheImrac
Comments: 69
 
mIRC Snippet:  Ventrilo Server Status
Posted on Jul 12, 2009 11:54 am
Oops sorry, while testing I commented out the messaging part ><
Spanky
Comments: 232
 
mIRC Snippet:  Ventrilo Server Status
Posted on Jul 14, 2009 5:55 pm
-ignore this i didnt read the script right-

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom