add the qstat executable name in the pathnox wrote:
mapchangenotify.tcl (/home/nox/eggdrop/scripts)
# set your qstatpath
set qstatpath "/home/nox/eggdrop/scripts"
the mapchangenotify.serverlist should be in /home/nox/eggdrop/nox wrote: mapchangenotify.serverlist : (/home/nox/eggdrop/scripts)
Code: Select all
[02:44] Tcl error [q]: couldn't execute "c:\egg\qstat": no such file or directory
Code: Select all
[02:36] Tcl error [qstatrun]: couldn't execute "C:\OCSL\scripts\qstat": no such file or directory
Code: Select all
[02:50] Tcl error [q]: couldn't duplicate input handle: bad file number
Code: Select all
[07:45] Tcl error [pub:qstat]: couldn't execute "c:\OCSL\scripts\qstat": no such file or directory
Code: Select all
if {$players == 1} {
catch { exec $qstat(path)/qstat -timeout 5 $gametype $arg -Ts $qstat(path)/server.qstat -Tp $qstat(path)/players.qstat -P } lines
} else {
catch { exec $qstat(path)/qstat -timeout 5 $gametype $arg -Ts $qstat(path)/server.qstat } lines
}
Code: Select all
set qstat_flag "-|-"
set pathqstat "c:/egg/qstat"
set nopub ""
bind pub $qstat_flag "!cs" pub:qstat
bind pub $qstat_flag "!csp" pub:qstat
bind pub $qstat_flag "!css" pub:qstat
bind pub $qstat_flag "!cssp" pub:qstat
bind pub $qstat_flag "!q4" pub:qstat
bind pub $qstat_flag "!q4p" pub:qstat
proc pub:qstat {nick host hand chan arg} {
global lastbind pathqstat nopub
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
set arg [lindex $arg 0]
if {[string length [string trim $arg]] == 0} {
putquick "NOTICE $nick :1,0Syntax: $lastbind <IP/Host>"
return 0
}
switch [string tolower $lastbind] {
"!cs" { set gametype "-a2s"; set players 0 }
"!csp" { set gametype "-a2s"; set players 1 }
default {
putquick "NOTICE $nick :1,0Unknown Command"
return 0
}
}
# run the qstat program.
if {$players} {
set stat [open "|$pathqstat/qstat.exe $gametype $arg -Ts $pathqstat/server.qstat -Tp $pathqstat/players.qstat -P" r]
} else {
set stat [open "|$pathqstat/qstat.exe $gametype $arg -Ts $pathqstat/server.qstat" r]
}
qstat:results $chan $nick $stat
close $stat
return 0
}
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
}
set msg [split $line]
set string ""
foreach query $msg {
if {[string length $string] + [string length $query] < 458} {
append string "$query "
} else {
putquick "NOTICE $nick :$string"
set string ""
}
}
if {$string != ""} {
putquick "NOTICE $nick :$string"
}
}
}
Code: Select all
[22:56] Tcl error [pub:qstat]: couldn't duplicate input handle: bad file number
Code: Select all
# set your qstatpath
set qstatpath "C:/egg/qstat/qstat.exe"
# number of servers to check
set server_number 6
set mcn_version "v0.1.1"
###############################################################
# TCL code begins, don't edit unless you know what your doing #
###############################################################
putlog "mapchangenotify $mcn_version loaded"
# read server list
set slname "mapchangenotify.serverlist"
set slct [open $slname "r"]
set sdlist [split [read $slct] \n]
close $slct
#---------------------------------------------------------------------
# create server files if they don't exist
set cfc 0
while { $cfc != $server_number } {
if {![file exists mapchange]} {
set fname "mapchangenotify$cfc.output"
set fp [open $fname "w"]
close $fp
incr cfc
}
}
#---------------------------------------------------------------------
bind time - * qstatrun ;# runs every minute
proc qstatrun {m h d mo y} {
global qstatpath
global server_number
global slct
global sl
global sdlist
set server_count 0
set slcount 0
while {$server_count != $server_number} {
# read old map name
set fname "mapchangenotify$server_count.output"
set fp [open $fname "r"]
set qstatxmlfile [split [read $fp] \n]
close $fp
#-------------------------------------------------------------------------
# using regex to find the right lines, yeah i know 50 lines is over kill.
set qstatxmlgameline 20
set qstatxmlmapline 20
set findrightlines 0
set findrightlinesmax 20
while { $findrightlines != $findrightlinesmax } {
set poon [lindex $qstatxmlfile $findrightlines]
if { [regexp "<map>(.*)</map>" $poon] == 1} {
set qstatxmlmapline $findrightlines
}
incr findrightlines
}
#-------------------------------------------------------------------------
set mapline [lindex $qstatxmlfile $qstatxmlmapline]
# strip out <map> and <\map>
set oldmap [string range $mapline 7 [expr [string length $mapline] - 7]]
#-------------------------------------------------------------------------
# set server list
set qstatgametype [lindex $sdlist $slcount] ; incr slcount
set qstatserverip [lindex $sdlist $slcount] ; incr slcount
set qstataddedtext [lindex $sdlist $slcount] ; incr slcount
set qstatircchan [lindex $sdlist $slcount] ; incr slcount
#-------------------------------------------------------------------------
exec $qstatpath $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output
# read new map name
set fname "mapchangenotify$server_count.output"
set fp [open $fname "r"]
set qstatxmlfile [split [read $fp] \n]
close $fp
#-------------------------------------------------------------------------
# using regex to find the right lines, yeah i know 50 lines is over kill.
set qstatxmlgameline 20
set qstatxmlmapline 20
set findrightlines 0
set findrightlinesmax 20
while { $findrightlines != $findrightlinesmax } {
set poon [lindex $qstatxmlfile $findrightlines]
if { [regexp "<map>(.*)</map>" $poon] == 1} {
set qstatxmlmapline $findrightlines
}
if { [regexp "<gametype>(.*)</gametype>" $poon] == 1} {
set qstatxmlgameline $findrightlines
}
incr findrightlines
}
#-------------------------------------------------------------------------
set gametypeline [lindex $qstatxmlfile $qstatxmlgameline]
set mapline [lindex $qstatxmlfile $qstatxmlmapline]
# strip out <map> and <\map>
set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]
# strip out <gametype> and <\gametype>
set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]
#--------------------------------------------------------------------------
# if qstat hit the server at the wrong time nothing is returned so having another crack at it
set recheckbreak 0
set mlbroken 0
while {[string length $mapline] < 1} {
exec $qstatpath $qstatgametype $qstatserverip -xml -of mapchangenotify$server_count.output
# read new map name
set fname "mapchangenotify$server_count.output"
set fp [open $fname "r"]
set qstatxmlfile [split [read $fp] \n]
close $fp
#------------------------------------------------------------------------
# using regex to find the right lines, yeah i know 50 lines is over kill.
set qstatxmlgameline 20
set qstatxmlmapline 20
set findrightlines 0
set findrightlinesmax 20
while { $findrightlines != $findrightlinesmax } {
set poon [lindex $qstatxmlfile $findrightlines]
if { [regexp "<map>(.*)</map>" $poon] == 1} {
set qstatxmlmapline $findrightlines
}
if { [regexp "<gametype>(.*)</gametype>" $poon] == 1} {
set qstatxmlgameline $findrightlines
}
incr findrightlines
}
#------------------------------------------------------------------------
set gametypeline [lindex $qstatxmlfile $qstatxmlgameline]
set mapline [lindex $qstatxmlfile $qstatxmlmapline]
# strip out <map> and <\map>
set newmap [string range $mapline 7 [expr [string length $mapline] - 7]]
# strip out <gametype> and <\gametype>
set gametype [string range $gametypeline 12 [expr [string length $gametypeline] - 12]]
incr recheckbreak
if {$recheckbreak == 2} { set mlbroken 1 ; break }
}
#-----------------------------------------------------------------------------------------------------------------------------------------
incr server_count
if {$newmap != $oldmap && $mlbroken == 0 } {
puthelp "PRIVMSG $qstatircchan :$qstataddedtext $newmap "
}
}
}
Code: Select all
<pSy> .stat
<SpawN> [01:59] #pSy# status
<SpawN> I am SpawN, running eggdrop v1.6.17: 2 users (mem: 81k).
<SpawN> Online for 01:09 (background) - CPU: 00:01 - Cache hit: 41.8%
<SpawN> Config file: eggdrop.conf
<SpawN> OS: CYGWIN_NT-5.1 1.5.24(0.156/4/2)
<SpawN> Tcl library: C:/egg/lib/tcl8.4
<SpawN> Tcl version: 8.4.7 (header version 8.4.7)
<SpawN> Loaded module information:
<SpawN> Channels: #grigai, #mercenaries
<SpawN> Online as: SpawN!~eggdrop@aitvaras-F831351B.vln.skynet.lt (SpawN)
<SpawN> Server irc.ktu.lt:6667 (connected for 00:59)
<SpawN> #grigai : 14 members, enforcing "+tn-klips" (greet)
<SpawN> #mercenaries : 4 members, enforcing "+tn" (greet)
<SpawN> [02:00] @#grigai (+mRtrn) : [m/14 o/4 h/1 v/7 n/2 b/0 e/0 I/0]
<SpawN> [02:00] Writing user file...
<SpawN> [02:00] Writing channel file...
<SpawN> [02:05] @#grigai (+mRtrn) : [m/14 o/4 h/1 v/7 n/2 b/0 e/0 I/0]
<SpawN> [02:09] #Grigai: mode change '+e sda!*@*' by AciD`oFF!~AciD@9A68A77C.1A839F6.F7CCB473.IP
<SpawN> [02:10] @#grigai (+mRtrn) : [m/14 o/4 h/1 v/7 n/2 b/0 e/1 I/0]
<pSy> .rehash
<SpawN> [02:14] #pSy# rehash
<SpawN> Rehashing.
<SpawN> [02:14] Writing user file...
<SpawN> [02:14] Writing channel file...
<SpawN> [02:14] Rehashing ...
<SpawN> [02:14] Listening at telnet port 3333 (all).
<SpawN> [02:14] Userinfo TCL v1.07 loaded (URL BF GF IRL EMAIL DOB PHONE ICQ).
<SpawN> [02:14] use '.help userinfo' for commands.
<SpawN> [02:14] Auto Identify
<SpawN> [02:14] MSG TCL 0.5 Loaded
<SpawN> [02:14] tv scripts form http://www.shellai.lt loaded
<SpawN> [02:14] AMXBans By AciD successfully loaded!
<SpawN> [02:14] egglib_pub.tcl v1.53 by Shrike <shrike@eggdrop.org.ru>, mrBuG <mrbug@eggdrop.org.ru> loaded
<SpawN> [02:14] - incith:google-1.8.6a loaded.
<SpawN> [02:14] mapchangenotify v0.1.1 loaded
<SpawN> [02:14] ERROR reading stats file
<SpawN> [02:14] Stats.mod v1.4.0 dev20 loaded.
<SpawN> [02:14] Module loaded: stats
<SpawN> [02:14] Tcl error in file 'eggdrop.conf':
<SpawN> [02:14] invalid command name "loadslang"
<SpawN> while executing
<SpawN> "loadslang language/stats.lang"
<SpawN> (file "stats.conf" line 65)
<SpawN> invoked from within
<SpawN> "source stats.conf"
<SpawN> (file "eggdrop.conf" line 70)
<SpawN> [02:14] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
-
DCC session closed
-
Code: Select all
Chat with SpawN
Waiting for acknowledgement...
DCC Chat connection established
-
<SpawN> Enter your password.
<pSy> blacklist
<SpawN> Connected to SpawN, running eggdrop v1.6.17
<SpawN> ____ __
<SpawN> / __/___ _ ___ _ ___/ /____ ___ ___
<SpawN> / _/ / _ `// _ `// _ // __// _ \ / _ \
<SpawN> /___/ \_, / \_, / \_,_//_/ \___// .__/
<SpawN> /___/ /___/ /_/
<SpawN>
<SpawN> Hey pSy! My name is SpawN and I am running eggdrop v1.6.17, on CYGWIN_NT-5.1 1.5.24(0.156/4/2).
<SpawN>
<SpawN> Local time is now 02:15
<SpawN> You are an owner of this bot. Only +n users can see this! For more info,
<SpawN> see .help set motd. Please edit the motd file in your bot's 'text'
<SpawN> directory.
<SpawN> Use .help for basic help.
<SpawN> Use .help <command> for help on a specific command.
<SpawN> Use .help all to get a full command list.
<SpawN> Use .help *somestring* to list any help texts containing "somestring".
<SpawN>
<SpawN> Have fun.
<SpawN>
<SpawN> Commands start with '.' (like '.quit' or '.help')
<SpawN> Everything else goes out to the party line.
<SpawN> You have no messages.
<SpawN> *** pSy joined the party line.
<SpawN> [02:15] New user peak in #mercenaries: 1.
<SpawN> [02:16] Tcl error [qstatrun]: couldn't duplicate input handle: bad file number
<SpawN> [02:16] <<pSy>> !pSy! top
<SpawN> [02:16] WARNING! No language selected! (getslang())
<SpawN> [02:16] Tcl error [pub:qstat]: couldn't duplicate input handle: bad file number
Code: Select all
Chat with SpawN
Waiting for acknowledgement...
DCC Chat connection established
-
<SpawN> Enter your password.
<pSy> blacklist
<SpawN> Connected to SpawN, running eggdrop v1.6.17
<SpawN> ____ __
<SpawN> / __/___ _ ___ _ ___/ /____ ___ ___
<SpawN> / _/ / _ `// _ `// _ // __// _ \ / _ \
<SpawN> /___/ \_, / \_, / \_,_//_/ \___// .__/
<SpawN> /___/ /___/ /_/
<SpawN>
<SpawN> Hey pSy! My name is SpawN and I am running eggdrop v1.6.17, on CYGWIN_NT-5.1 1.5.18(0.132/4/2).
<SpawN>
<SpawN> Local time is now 02:39
<SpawN> You are an owner of this bot. Only +n users can see this! For more info,
<SpawN> see .help set motd. Please edit the motd file in your bot's 'text'
<SpawN> directory.
<SpawN> Use .help for basic help.
<SpawN> Use .help <command> for help on a specific command.
<SpawN> Use .help all to get a full command list.
<SpawN> Use .help *somestring* to list any help texts containing "somestring".
<SpawN>
<SpawN> Have fun.
<SpawN>
<SpawN> Commands start with '.' (like '.quit' or '.help')
<SpawN> Everything else goes out to the party line.
<SpawN> You have no messages.
<SpawN> *** pSy joined the party line.
<SpawN> [02:39] #Grigai: mode change '+o SpawN' by pSy!~pSy@aitvaras-F831351B.vln.skynet.lt
<SpawN> [02:39] #Grigai: mode change '-o SpawN' by savas!ubaldas@aitvaras.eu
<SpawN> [02:39] #Grigai: mode change '+o SpawN' by pSy!~pSy@aitvaras-F831351B.vln.skynet.lt
<SpawN> [02:40] #Grigai: mode change '-o SpawN' by savas!ubaldas@aitvaras.eu
<SpawN> [02:40] Tcl error [qstatrun]: couldn't create error file for command: no such file or directory
<SpawN> [02:40] #grigai (+mRtrn) : [m/14 o/2 h/1 v/7 n/4 b/0 e/1 I/0]
<SpawN> [02:40] #Grigai: mode change '+o SpawN' by pSy!~pSy@aitvaras-F831351B.vln.skynet.lt
<SpawN> [02:40] Tcl error [pub:qstat]: couldn't create error file for command: no such file or directory
<SpawN> [02:41] Tcl error [qstatrun]: couldn't create error file for command: no such file or directory
Code: Select all
Tcl error [qstatrun]: couldn't create error file for command: no such file or directory
Code: Select all
Tcl error [qstatrun]: couldn't duplicate input handle: bad file number