ut3 server query

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

ut3 server query

Postby Lenooox » Fri Jul 15, 2011 11:42 am

Hello guys Im found a UT3 Server Query Script but when i type .ut3 ip -p port i got this : did not respond
message everytime Sad
anyone maybe can fix it?
Thank you very much <3

Code: Select all
on *:LOAD:{
  if ($version < 6.03) {
    echo -ts UT3 Query Bot Requires mIRC v6.03 or newer to be installed successfully.
    .unload -rs ut3query.mrc
  }
  else {
    if ($exists($scriptdirgslist.exe)) {
      var %batfile = $scriptdirgslist.bat
      if ($exists(%batfile)) { /remove %batfile }
      /write %batfile cd $scriptdir
      /write %batfile $scriptdirgslist -q -o 1 -n ut3pcd
      /echo -ts mIRC UT3 Query Bot LOADED successfully
    }
    else {
      echo -ts UT3 Query Bot Requires gslist.exe to be installed in $scriptdir
      .unload -rs ut3query.mrc
    }
  }
}

on 1:START:{
  .timerut3port 0 300 /run -n $scriptdirgslist.bat
}

on *:INPUT:#:{
  if ($chan != $null) { var %sendto = $chan }
  else { var %sendto = $nick }
  if (update isin $2) { /run -n $scriptdirgslist.bat }
  else if (-p isin $2-) {
    if ($chr(61) isin $2-) { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $gettok($2-,2,61) }
    else { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $4 }
  }
  else { /getut3port %sendto $gettok($2,1,58) }
}

on $*:TEXT:/^[-@!.]ut3 /i:*:{
  if ($chan != $null) { var %sendto = $chan }
  else { var %sendto = $nick }
  if (update isin $2) { /run -n $scriptdirgslist.bat }
  else if (-p isin $2-) {
    if ($chr(61) isin $2-) { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $gettok($2-,2,61) }
    else { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $4 }
  }
  else { /getut3port %sendto $gettok($2,1,58) }
}

on $*:TEXT:/^[-@!.]findut3port /i:*:{
  if ($2 != $null) { /findut3port $nick $gettok($2,1,58) }
}

alias getut3port {
  ;getut3port takes in: %sendto %ip
  var %ut3.0 = $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42))
  if (%ut3.0 == $null) {
    /msg $chan UT3: IP: $2 QUERY PORT NOT FOUND. Server is not in Gamespy masterlist.
  }
  else {
    /ut3info $1 %ut3.0
  }
}

alias findut3port {
  ;findut3port takes in: %sendto %ip
  var %ut3.0 = $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42))
  if (%ut3.0 == $null) {
    /msg $chan UT3: IP: $2 QUERY PORT NOT FOUND. Server is not in Gamespy masterlist.
  }
  else {
    /ut3info $nick %ut3.0
    var %tmp = $chr(32) $+ $chr(45) $+ p $+ $chr(32)
    /msg $1 $replace(%ut3.0,$chr(58),%tmp $+ $chr(32))
    set %ut3.0 $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42),$calc($readn + 1))
    while (%ut3.0) {
      /ut3info $nick %ut3.0
      /msg $1 $replace(%ut3.0,$chr(58),%tmp $+ $chr(32))
      set %ut3.0 $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42),$calc($readn + 1))
    }
    /msg $1 End search $2 $+ $chr(58) $+ $chr(42)
  }
}

alias ut3info {
  ;ut3info takes in %sendto ip:port
  var %ut3.server =  $1 $+ $chr(174) $+ $gettok($2,1,58) $+ $chr(174) $+ $gettok($gettok($2,2,58),1,32)
  /bset &Stream 1 254 253 09 16 32 48 64
  .timer $+ ut3c. [ $+ [ %ut3.server ] ] 1 3 /msg $1 ut3:// $+ $2 did not respond | /sockclose ut3c. [ $+ [ %ut3.server ] ]
  .timer $+ ut3c. [ $+ [ %ut3.server $+ sock ] ] 1 3 /sockclose ut3c. [ $+ [ %ut3.server ] ]
  sockudp -k ut3c. [ $+ [ %ut3.server ] ] $gettok(%ut3.server,2,174) $gettok(%ut3.server,3,174) &Stream
}

on *:UDPREAD:ut3c.*:{
  if ($sockerr) { echo -s ERROR ut3 $sockname | return }
  var %ut3.temp
  sockread -f &ut3.temp
  var %key = $bvar(&ut3.temp,6,$bvar(&ut3.temp,0)).text
  if (%key == $null) { /sockclose $sockname }
  if (%key != splitnum) { var %keydecode = $string2ascii($hex($twoscomp(%key)).decode) }
  if (($bvar(&ut3.temp,0) < 20) && (%keydecode != $null)) {
    /ut3info2 $sockname %keydecode
  }
  else {
    /breplace &ut3.temp 0 13
    var %sendto = $gettok($gettok($sockname,1,174),2-,46)
    if ($chr(35) isin %sendto) { var %chan = %sendto }
    var %hostname = $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, p1073741827),$bvar(&ut3.temp,0)).text,2,13)
    var %hostipport = $chr(91) ut3:// $+ $gettok($sockname,2,174) $+ $chr(58) $+ $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, hostport),$bvar(&ut3.temp,0)).text,2,13) $+ $chr(58) $+ $gettok($sockname,3,174) $chr(93)
    var %players = $chr(91) $+ Players: $chr(40) $+ $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, numplayers),$bvar(&ut3.temp,0)).text,2,13) $+ / $+ $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, maxplayers),$bvar(&ut3.temp,0)).text,2,13) $+ $chr(41) $+ $chr(93)
    var %gamemode = $iif($gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, gamemode),$bvar(&ut3.temp,0)).text,2,13) != openplaying,$chr(91) $+ Passworded $+ $chr(93))
    var %mapname = $chr(91) $+ Map: $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, p1073741825),$bvar(&ut3.temp,0)).text,2,13) $+ $chr(93)
    if (%hostname != $null) {
      /msg %sendto %hostname %hostipport %players %mapname %gamemode
    }
    .timer $+ $sockname $+ $chr(42) off
    /sockclose $sockname
  }
}

alias ut3info2 {
  ;ut3info2 takes in: $sockname %keydecode
  var %keydecode = $2-
  /bset &Stream 1 254 253 0 16 32 48 64 %keydecode 255 255 255 1
  sockudp -k $1 $gettok($1,2,174) $gettok($1,3,174) &Stream
}

; hex function taken from http://www.mircscripts.org/comments.php?cid=3496
alias hex {
  var %x = $iif($$prop = encode,/(.)/g $+ $chr(44) $+ $!base($asc(\t),10,16,2),/(..)/g $+ $chr(44) $+ $!chr( $!base(\t,16,10)) ) | if ($istok(decode encode,$prop,32)) return $regsubex($$1, [ %x ] )
}

alias string2ascii {
  var %i = 1
  var %ascii
  while (%i <= $len($1)) {
    set %ascii %ascii $asc($mid($1,%i,1))
    inc %i
  }
  return %ascii
}

alias twoscomp {
  var %tmp = 00000000000000000000000000000000 $+ $base($abs($1),10,2)
  var %tmp2
  if ($1 >= 0) { set %tmp $base($right(%tmp,32),2,16,8) }
  else {
    while ($len(%tmp) != 0) {
      if ($left(%tmp,1) == 0) {
        set %tmp2 %tmp2 $+ 1
      }
      else {
        set %tmp2 %tmp2 $+ 0
      }
      set %tmp $right(%tmp,$calc($len(%tmp) - 1))
    }
    set %tmp $base($calc($base($right(%tmp2,32),2,10) + 1),10,16,8)
  }
  return %tmp
}
Lenooox
 

Re: ut3 server query

Postby fraguk » Fri Aug 12, 2011 11:34 pm

Lenooox wrote:Hello guys Im found a UT3 Server Query Script but when i type .ut3 ip -p port i got this : did not respond
message everytime Sad
anyone maybe can fix it?
Thank you very much <3

Code: Select all
on *:LOAD:{
  if ($version < 6.03) {
    echo -ts UT3 Query Bot Requires mIRC v6.03 or newer to be installed successfully.
    .unload -rs ut3query.mrc
  }
  else {
    if ($exists($scriptdirgslist.exe)) {
      var %batfile = $scriptdirgslist.bat
      if ($exists(%batfile)) { /remove %batfile }
      /write %batfile cd $scriptdir
      /write %batfile $scriptdirgslist -q -o 1 -n ut3pcd
      /echo -ts mIRC UT3 Query Bot LOADED successfully
    }
    else {
     

      .unload -rs ut3query.mrc
    }
  }
}

on 1:START:{
  .timerut3port 0 300 /run -n $scriptdirgslist.bat
}

on *:INPUT:#:{
  if ($chan != $null) { var %sendto = $chan }
  else { var %sendto = $nick }
  if (update isin $2) { /run -n $scriptdirgslist.bat }
  else if (-p isin $2-) {
    if ($chr(61) isin $2-) { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $gettok($2-,2,61) }
    else { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $4 }
  }
  else { /getut3port %sendto $gettok($2,1,58) }
}

on $*:TEXT:/^[-@!.]ut3 /i:*:{
  if ($chan != $null) { var %sendto = $chan }
  else { var %sendto = $nick }
  if (update isin $2) { /run -n $scriptdirgslist.bat }
  else if (-p isin $2-) {
    if ($chr(61) isin $2-) { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $gettok($2-,2,61) }
    else { /ut3info %sendto $gettok($2,1,58) $+ $chr(58) $+ $4 }
  }
  else { /getut3port %sendto $gettok($2,1,58) }
}

on $*:TEXT:/^[-@!.]findut3port /i:*:{
  if ($2 != $null) { /findut3port $nick $gettok($2,1,58) }
}

alias getut3port {
  ;getut3port takes in: %sendto %ip
  var %ut3.0 = $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42))
  if (%ut3.0 == $null) {
    /msg $chan UT3: IP: $2 QUERY PORT NOT FOUND. Server is not in Gamespy masterlist.
  }
  else {
    /ut3info $1 %ut3.0
  }
}

alias findut3port {
  ;findut3port takes in: %sendto %ip
  var %ut3.0 = $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42))
  if (%ut3.0 == $null) {
    /msg $chan UT3: IP: $2 QUERY PORT NOT FOUND. Server is not in Gamespy masterlist.
  }
  else {
    /ut3info $nick %ut3.0
    var %tmp = $chr(32) $+ $chr(45) $+ p $+ $chr(32)
    /msg $1 $replace(%ut3.0,$chr(58),%tmp $+ $chr(32))
    set %ut3.0 $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42),$calc($readn + 1))
    while (%ut3.0) {
      /ut3info $nick %ut3.0
      /msg $1 $replace(%ut3.0,$chr(58),%tmp $+ $chr(32))
      set %ut3.0 $read($scriptdirut3pcd.gsl, w, $2 $+ $chr(58) $+ $chr(42),$calc($readn + 1))
    }
    /msg $1 End search $2 $+ $chr(58) $+ $chr(42)
  }
}

alias ut3info {
  ;ut3info takes in %sendto ip:port
  var %ut3.server =  $1 $+ $chr(174) $+ $gettok($2,1,58) $+ $chr(174) $+ $gettok($gettok($2,2,58),1,32)
  /bset &Stream 1 254 253 09 16 32 48 64
  .timer $+ ut3c. [ $+ [ %ut3.server ] ] 1 3 /msg $1 ut3:// $+ $2 did not respond | /sockclose ut3c. [ $+ [ %ut3.server ] ]
  .timer $+ ut3c. [ $+ [ %ut3.server $+ sock ] ] 1 3 /sockclose ut3c. [ $+ [ %ut3.server ] ]
  sockudp -k ut3c. [ $+ [ %ut3.server ] ] $gettok(%ut3.server,2,174) $gettok(%ut3.server,3,174) &Stream
}

on *:UDPREAD:ut3c.*:{
  if ($sockerr) { echo -s ERROR ut3 $sockname | return }
  var %ut3.temp
  sockread -f &ut3.temp
  var %key = $bvar(&ut3.temp,6,$bvar(&ut3.temp,0)).text
  if (%key == $null) { /sockclose $sockname }
  if (%key != splitnum) { var %keydecode = $string2ascii($hex($twoscomp(%key)).decode) }
  if (($bvar(&ut3.temp,0) < 20) && (%keydecode != $null)) {
    /ut3info2 $sockname %keydecode
  }
  else {
    /breplace &ut3.temp 0 13
    var %sendto = $gettok($gettok($sockname,1,174),2-,46)
    if ($chr(35) isin %sendto) { var %chan = %sendto }
    var %hostname = $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, p1073741827),$bvar(&ut3.temp,0)).text,2,13)
    var %hostipport = $chr(91) ut3:// $+ $gettok($sockname,2,174) $+ $chr(58) $+ $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, hostport),$bvar(&ut3.temp,0)).text,2,13) $+ $chr(58) $+ $gettok($sockname,3,174) $chr(93)
    var %players = $chr(91) $+ Players: $chr(40) $+ $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, numplayers),$bvar(&ut3.temp,0)).text,2,13) $+ / $+ $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, maxplayers),$bvar(&ut3.temp,0)).text,2,13) $+ $chr(41) $+ $chr(93)
    var %gamemode = $iif($gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, gamemode),$bvar(&ut3.temp,0)).text,2,13) != openplaying,$chr(91) $+ Passworded $+ $chr(93))
    var %mapname = $chr(91) $+ Map: $gettok($bvar(&ut3.temp,$bfind(&ut3.temp, 1, p1073741825),$bvar(&ut3.temp,0)).text,2,13) $+ $chr(93)
    if (%hostname != $null) {
      /msg %sendto %hostname %hostipport %players %mapname %gamemode
    }
    .timer $+ $sockname $+ $chr(42) off
    /sockclose $sockname
  }
}

alias ut3info2 {
  ;ut3info2 takes in: $sockname %keydecode
  var %keydecode = $2-
  /bset &Stream 1 254 253 0 16 32 48 64 %keydecode 255 255 255 1
  sockudp -k $1 $gettok($1,2,174) $gettok($1,3,174) &Stream
}

; hex function taken from http://www.mircscripts.org/comments.php?cid=3496
alias hex {
  var %x = $iif($$prop = encode,/(.)/g $+ $chr(44) $+ $!base($asc(\t),10,16,2),/(..)/g $+ $chr(44) $+ $!chr( $!base(\t,16,10)) ) | if ($istok(decode encode,$prop,32)) return $regsubex($$1, [ %x ] )
}

alias string2ascii {
  var %i = 1
  var %ascii
  while (%i <= $len($1)) {
    set %ascii %ascii $asc($mid($1,%i,1))
    inc %i
  }
  return %ascii
}

alias twoscomp {
  var %tmp = 00000000000000000000000000000000 $+ $base($abs($1),10,2)
  var %tmp2
  if ($1 >= 0) { set %tmp $base($right(%tmp,32),2,16,8) }
  else {
    while ($len(%tmp) != 0) {
      if ($left(%tmp,1) == 0) {
        set %tmp2 %tmp2 $+ 1
      }
      else {
        set %tmp2 %tmp2 $+ 0
      }
      set %tmp $right(%tmp,$calc($len(%tmp) - 1))
    }
    set %tmp $base($calc($base($right(%tmp2,32),2,10) + 1),10,16,8)
  }
  return %tmp
}


2 things to cheack lenooox
1= echo -ts UT3 Query Bot Requires gslist.exe to be installed in $scriptdir
2= Server is not in Gamespy masterlist.
fraguk
 


Return to Mirc Scripting Request

Who is online

Users browsing this forum: No registered users and 1 guest

cron