mIRC Home    About    Download    Register    News    Help

Print Thread
#96012 29/08/04 03:50 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
i am working on a script to connect to a server and return server info i have done it in PHP but im not sure quiet how to do it in mirc could any one help? btw its connect to a steam server and return info about it


Need amazing web design for low price: http://www.matrixn3t.net
#96013 29/08/04 04:24 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Here is one I uise for a game called tribes. The server requests a \x62\x00\x00, and the info gets returned back through the udpread. Modify it as you see fit.

Code:
; /query_game <ip> <port>
alias query_game {
  ; connection info
  var %ip = $1, %port = $2, %sock = query_ $+ $rand(1,999)

  ; set this tot he query string.
  /bset &buffer 1 98 0 0

  ; send outgoing query packet
  /sockudp -k %sock %ip %port &buffer

  ; Here i set the ticks count as a mark on the socket so I can get ping time
  /sockmark %sock %chan $ticks

  ; set a timeout
  .timer $+ %sock 1 3 /query_kill %sock
}

alias query_kill {
  var %sock = $1
  /echo -s Could not query server.
  /sockclose %sock
}

on *:SOCKOPEN:query_*: {
  if ($sockerr) /echo -s $sockname Failed: $sock($sockname).wserr
}

on *:UDPREAD:query_*: {
  ; shut off the timeout check
  .timer $+ $sockname off

  ; read the packet
  /sockread &data

  ;
  ; parse it here....
  ;
}


-KingTomato
#96014 29/08/04 05:01 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
thank you kt saved my ass again lol


Need amazing web design for low price: http://www.matrixn3t.net

Link Copied to Clipboard