This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

qstat4eggdrop

Old posts that have not been replied to for several years.
Locked
_
_gAnDaLf_

qstat4eggdrop

Post by _gAnDaLf_ »

Hi

Ive been running qstat4eggdrop for a while now but ive been trying to make so that when someone types say !JoltET1 it will come back with the name of the server and ip same as if they type say !q3 ***.***.***:**** would this be Possible?
I'm running qstat4eggdrop 2.2
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm does it support normal eggdrop scripts ..?
XplaiN but think of me as stupid
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Code: Select all

bind pub -|- !myserver qstat:myserver

proc qstat:myserver { nick uhost hand chan arg } {
 q3s $nick $uhost $hand $chan "127.0.0.1:1337"
}
_
_gAnDaLf_

Post by _gAnDaLf_ »

Hi

I tryed that and i get this error

Code: Select all

Tcl error [qstat:myserver]: invalid command name "q3s"
i tryed -q3s as well but it dont work here's what it got in the tcl

Code: Select all

set qversion "2.2"

bind pub $qstat_flag "!ut"  pub:qstat
bind pub $qstat_flag "!hl"  pub:qstat 
bind pub $qstat_flag "!cs"  pub:qstat
bind pub $qstat_flag "!qw"  pub:qstat
bind pub $qstat_flag "!q1"  pub:qstat 
bind pub $qstat_flag "!q2"  pub:qstat 
bind pub $qstat_flag "!q3"  pub:qstat 
bind pub $qstat_flag "!rcw" pub:qstat
bind pub $qstat_flag "!bf"  pub:qstat
bind pub $qstat_flag "!gs"  pub:qstat
bind pub $qstat_flag "!ut2k3"  pub:qstat
bind pub $qstat_flag "!ut2003" pub:qstat

bind pub $qstat_flag "!utp"  pub:qstat
bind pub $qstat_flag "!hlp"  pub:qstat
bind pub $qstat_flag "!qwp"  pub:qstat
bind pub $qstat_flag "!q1p"  pub:qstat
bind pub $qstat_flag "!q3p"  pub:qstat
bind pub $qstat_flag "!q2p"  pub:qstat
bind pub $qstat_flag "!rcwp" pub:qstat
bind pub $qstat_flag "!bfp"  pub:qstat
bind pub $qstat_flag "!ut2k3p"  pub:qstat
bind pub $qstat_flag "!ut2003p" pub:qstat

bind pub $qstat_flag "!qstat" pub:qstat_help

proc pub:qstat_help {nick host hand chan arg} {
  global pathqstat nopub

  # check if channel is allowed.
  if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}

  # output qstat commands / help.
  putserv "NOTICE $nick :Qstat commands:"
  putserv "NOTICE $nick :\002!qw / !q1 / !q2 / !q3 / !rcw <ip/host>\002 - Displays status of queried Quake World, 1, 2, 3 or RTCW servers"
  putserv "NOTICE $nick :\002!ut / !ut2003 / !hl / !bf / !gs <ip/host>\002 - Displays status of queried UT(2003), Half-life, BF1942 and GameSpy servers"

  return 0
}

proc pub:qstat {nick host hand chan arg} {
  global lastbind pathqstat nopub

  # check if channel is allowed.
  if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}

  # only use one argument.
  set arg [lindex $arg 0]

  # check for input.
  if {[string length [string trim $arg]] == 0 || [qstat:input_check $arg]} {
    putquick "NOTICE $nick :Syntax: $lastbind <ip/host>"
    return 0
  }

  # figure out which command was used.
  switch [string tolower $lastbind] {
    "!hl"     { set gametype "-hls";  set players 0 }
    "!cs"     { set gametype "-hls";  set players 0 }
    "!ut"     { set gametype "-uns";  set players 0 }
    "!qw"     { set gametype "-qws";  set players 0 }
    "!q1"     { set gametype "-qs";   set players 0 }
    "!q2"     { set gametype "-q2s";  set players 0 }
    "!q3"     { set gametype "-q3s";  set players 0 }
    "!rcw"    { set gametype "-rwm";  set players 0 }
    "!bf"     { set gametype "-gps";  set players 0 }
    "!gs"     { set gametype "-gps";  set players 0 }
    "!ut2k3"  { set gametype "-ut2s"; set players 0 }
    "!ut2003" { set gametype "-ut2s"; set players 0 }
    "!hlp"     { set gametype "-hls";  set players 1 }
    "!utp"     { set gametype "-uns";  set players 1 }
    "!qwp"     { set gametype "-qws";  set players 1 }
    "!q1p"     { set gametype "-qs";   set players 1 }
    "!q2p"     { set gametype "-q2s";  set players 1 }
    "!q3p"     { set gametype "-q3s";  set players 1 }
    "!rcwp"    { set gametype "-rwm";  set players 1 }
    "!bfp"     { set gametype "-gps";  set players 1 }
    "!ut2k3p"  { set gametype "-ut2s"; set players 1 }
    "!ut2003p" { set gametype "-ut2s"; set players 1 }
    default {
      putquick "NOTICE $nick :Unknown command."
      return 0
    }
  }

  # run the qstat program.
  if {$players} { 
    set stat [open "|$pathqstat/qstat -timeout 5 $gametype $arg -Ts $pathqstat/server.qstat -Tp $pathqstat/players.qstat -P" r]
  } else {
    set stat [open "|$pathqstat/qstat -timeout 5 $gametype $arg -Ts $pathqstat/server.qstat" r]
  }

  # output the result.
  qstat:results $chan $nick $stat

  # close fork, end program.
  close $stat
  return 0
}

# show results.
proc qstat:results {chan nick pf} {
  while {[gets $pf line] >= 0} { 
    if {[string match "DOWN*" $line]} {
      putquick "NOTICE $nick :Connection refused while querying server."
      break
    } elseif {[string match "HOSTNOTFOUND*" $line]} {
      putquick "NOTICE $nick :Host not found."
      break
    } elseif {[string match "TIMEOUT*" $line]} {
      putquick "NOTICE $nick :Timeout while querying server."
      break
    }
    putquick "PRIVMSG $chan :$line"  
  }
}

# check for valid chars
proc qstat:input_check {text} {
  if {[regexp \[^\[:alnum:\]_\.\:\] $text]} { return 1 }
  if {[string match "0*" $text]} { return 1 }
  return 0
}

thx for the help btw
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Code: Select all

bind pub -|- !myserver qstat:myserver 

proc qstat:myserver { nick uhost hand chan arg } { 
 pub:qstat $nick $uhost $hand $chan "127.0.0.1:1337" 
} 
add this to the switch

Code: Select all

"!myserver"     { set gametype "-q3s";  set players 0 }
my answer was based on the TCL i had im my archive, seams this one is different
X
XmasterX

Post by XmasterX »

this scipt works for unreal tournament servers? if so tell me where can i down it?
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

TCL Archive

and what protocols are supported depends on what qstat can do..

they allways add new games and protocols.
_
_gAnDaLf_

Post by _gAnDaLf_ »

Thanks m8 it works thanks for the help :D
_
_gAnDaLf_

Post by _gAnDaLf_ »

Just one other small thing would that work with lots of server's say !myserver1 !mayserver2 !myserver3 and so on i'm a bit new to tcl
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

sure, you just have to addapt the binds and add the data to the switch (with the correct game parameter)
Locked