<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/17118" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2009-08-20T10:45:18-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/17118</id>

		<entry>
		<author><name><![CDATA[jameS]]></name></author>
		<updated>2009-08-20T10:45:18-04:00</updated>

		<published>2009-08-20T10:45:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89989#p89989</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89989#p89989"/>
		<title type="html"><![CDATA[Please modify this GameServer !status script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89989#p89989"><![CDATA[
Found a script, but it's not working for EnemyTerritory Game, can someone modify it for me? Shouldn't be that hard if i give infos on the game imo.<br><blockquote class="uncited"><div>This .tcl script will make your eggdrop irc-bot to show your nwn1&amp;nwn2 serverstatus (pulled from gamespy) after beeing triggered inside the channel with !status (working also in query and dcc chat). I found this script 2 years ago, and the original version was not programmed by me. (no notice on who did it before i customized it, sorry).<br><br>Features:<br>° reports your gameserver status (module, playercount, status) to an irc channel after beeing triggered with normal chat<br>° highly configurable<br>° support for more than one server<br>° can be used remote (no need to run on your gameserver itself)<br>(° php status could be used standalone, without eggdrop)<br><br>What you need:<br>° Website with php-support<br>° Working eggdrop irc-bot<br><br>The package contains:<br>° php file to receive server-information<br>° tcl file for eggdrop<br><br>Installation:<br>° copy serverstatus.php to your webserver<br>° copy serverstatus.tcl to your eggdrop script directory<br>° add serverstatus.tcl to your eggdrop's config-file script-section<br>° see serverstatus.tcl for further instructions<br><br>If you have further questions, do not hesitate to contact me.</div></blockquote>Either link me to another Script, or help me modifying this one for Wolfenstein:EnemyTerritory, it's currently setup for NeverwinterNights or so.<br><br>Content of <strong class="text-strong"> serverstatus.tcl</strong><div class="codebox"><p>Code: </p><pre><code>## Serverstatus - get from php# Anbindung der Befehleset listmc(!status) status.txt# Do you also want these commands avilable public too?# 0 = no# 1 = yesset mc_rf(public) 1# If triggered in public, do you want it to read the file in public insted# of privmsg to the user?# 0 = no# 1 = yesset mc_rf(public:read) 0# If above public is 1 (yes), what channels do you want them on exactly?# Set to "" for all channels.set mc_rf(channels) ""# To slow the post speed down a bit, how many seconds do you want to# space out each post?  (Seconds per Line)# example:  2 will post 1 line every 2 secondsset mc_rf(speed) 1# How many times in how many min.s can the user access a command?set mc_rf(user:access) 1:1# Overall, how many commands:min can be accessed before considering# a possible flood and disable all commands?set mc_rf(over:access) 6:1# If the flood is detected, how long do you want to keep the commands# disabled?  (in seconds)set mc_rf(flood:sec) 10# MC SVS (Script Version Server)# Do you want the bot to connection to MC_8's SVS to see if there are newer versions# of this script avilable?  It will only tell you -- It's up to you to get the newest# version (I decided not to auto update the code, there may be new features in the# newest script that may require your attention).# 0=no/1=yesset mc_rf(svs:enabled) 0# Once a day the script will check with the SVS -- this specifies when# that should happen.  The setting should be the hour (military).# examples:#  set mc_rf(svs:check) 0   ;#This is at Midnight#  set mc_rf(svs:check) 5   ;#This is at 5am#  set mc_rf(svs:check) 13  ;#This is at 1pm#  set mc_rf(svs:check) 23  ;#This is at 11pmset mc_rf(svs:check) 3# Upon finding a newer version, who do you want to notify via note?# Seperate each user with a " " (space).set mc_rf(svs:notify) "RQScott"## Do not venture past here, TCL Coding below.set mc_rf(version) v1.4set mc_rf(svs:script) "readfile 001004000000"set mc_rf(svs:server) "mc.svs.purehype.net 8085"bind pubm - * mc:rf:telllist:pubmproc mc:rf:telllist:pubm {nick uhost hand chan args} { global mc_rfputlog 1 if {!$mc_rf(public)} {return} if {$mc_rf(channels) == ""} {set channels [string tolower [channels]]} {  set channels [string tolower $mc_rf(channels)] }putlog "$nick $args $chan $channels" if {![string match "* [string tolower $chan] *" " $channels "]} {return 0} mc:rf:telllist $nick $uhost $hand [join $args] $chan}bind msgm - * mc:rf:telllist:msgmproc mc:rf:telllist:msgm {nick uhost hand args} { global mc_rf ; mc:rf:telllist $nick $uhost $hand [join $args] msg}proc mc:rf:telllist {nick uhost hand args method} {putlog $argsexec lynx -preparsed -dump http://127.0.0.1/serverstatus.php &gt; status.txt global listmc listmcg mc_rf ; set args [join $args]putlog $args if {[info exists listmc([string tolower $args])]} {  set temp $args:[string range $uhost [expr [string first @ $uhost]+1] e]  set access [lindex [split $mc_rf(user:access) :] 0]  if {[info exists mc_rf(user:$temp)]} {   if {$mc_rf(user:$temp) &gt; $access} {    if {![string match "*catch {incr mc_rf(user:$temp) -1}*" [timers]]} {     unset mc_rf(user:$temp) ; utimer 1 mc:rf:telllist $nick $uhost $hand $args $method    } {putlog "ReadFile:  Ignoring $nick!$uhost's request of $args.  (Detected from from $nick)"}    return 0   } {    incr mc_rf(user:$temp) 1    timer [lindex [split $mc_rf(user:access) :] 1] "catch {incr mc_rf(user:$temp) -1}"   }  } {   set mc_rf(user:$temp) 1   timer [lindex [split $mc_rf(user:access) :] 1] "catch {incr mc_rf(user:$temp) -1}"  }  set access [lindex [split $mc_rf(over:access) :] 0]  if {[info exists mc_rf(over:flood)]} {   if {$mc_rf(over:flood) &gt; $access} {    if {![string match "catch {incr mc_rf(over:flood) -1}" [timers]]} {     unset mc_rf(over:flood) ; utimer 1 mc:rf:tellist $nick $uhost $hand $args $method    } {     set mc_rf(over:flood:ignore) 1     utimer $mc_rf(flood:sec) "catch {unset mc_rf(over:flood:ignore)}"     putlog "ReadFile:  Ignoring $nick!$uhost's request of $args.  (Detected overall flood)"    } ; return 0   } {    incr mc_rf(over:flood) 1    timer [lindex [split $mc_rf(over:access) :] 1] "catch {incr mc_rf(over:flood) -1}"   }  } {   set mc_rf(over:flood) 1   timer [lindex [split $mc_rf(over:access) :] 1] "catch {incr mc_rf(over:flood) -1}"  } ; if [info exists mc_rf(over:flood:ignore)] {return 0}  if {$mc_rf(public:read) &amp;&amp; ($method != "msg")} {set nick $method}  if {![file exists $listmc([string tolower $args])]} {   puthelp "PRIVMSG $nick :ReadFile: error, $listmc([string tolower $args]) doesn't exist."  } {    # reading info...   set file [open $listmc([string tolower $args]) r]   if {!$mc_rf(speed)} {    while {![eof $file]} {     set get [gets $file]     puthelp "PRIVMSG $nick :$gets"    }   } {    set i 1    while {![eof $file]} {     set get [gets $file]     utimer $i "puthelp {PRIVMSG $nick :$get}"     incr i $mc_rf(speed)    }   } ; close $file   # End Of File  } } ; return 1}foreach temp [array names listmc] { if {[string tolower $temp] != $temp} {  set listmc([string tolower $temp]) $listmc($temp)  unset listmc($temp) }}if {$mc_rf(svs:enabled)} { if {($mc_rf(svs:check) &gt; "23") || ($mc_rf(svs:check) &lt; "0")} {set mc_rf(svs:check) 0} bind time - "* $mc_rf(svs:check) * * *" mc:rf:svs:time proc mc:rf:svs:time {min hour day month year} {  global mc_rf  catch {control [connect [lindex $mc_rf(svs:server) 0] [lindex $mc_rf(svs:server) 1]] mc:rf:svs:interface} }}proc mc:rf:svs:interface {idx args} { global mc_rf;set args [join $args] switch -- [lindex $args 0] {  "" {return 1}  000 {putdcc $idx q}  002 {putdcc $idx [lindex $mc_rf(svs:script) 0]}  003 {   set args [lrange $args 1 e]   if {[lindex $args 0] != [lindex $mc_rf(svs:script) 0]} {return 0}   if {[lindex $args 1] &gt; [lindex $mc_rf(svs:script) 1]} {    foreach notify [join [split $mc_rf(svs:notify) ",;"]] {     switch -- [sendnote SVS $notify "The version of [lindex $args 2] you are using is old.  The current version is [lindex $args 3], and your using $mc_rf(version).  You can find this newer version at http://bseen.tclslave.net/search.html or from ftp.eggheads.org."] {      0 {putlog "MC SVS for [lindex $mc_rf(svs:script) 0] had some errors updating $notify on current version of script; unknown reason!"}      3 {putlog "MC SVS for [lindex $mc_rf(svs:script) 0] had some errors updating $notify on current version of script; notebox too full!"}     }    }   } ; putdcc $idx q  } } ; return 0}putlog "Serverstatus loaded"</code></pre></div>Content of <strong class="text-strong">serverstatus.php</strong><div class="codebox"><p>Code: </p><pre><code>&lt;?php $ipaddr = "127.0.0.1";$port = "5121";$timeout = 19;$connect = fsockopen( "udp://" . $ipaddr, $port, $errno, $errstr, $timeout );if ( ! $connect ){print( "Server is down [21~" );print( "&gt;ERROR: $errno - $errstr&lt;/h3&gt;" );exit;} else {socket_set_timeout( $connect, $timeout );$send = "\xFE\xFD\x00\xE0\xEB\x2D\x0E\x14\x01\x0B\x01\x05\x08\x0A\x33\x34\x35\x13\x04\x36\x37\x38\x39\x14\x3A\x3B\x3C\x3D\x00\x00";fwrite( $connect, $send );$output = fread( $connect, 5000 );if ( ! $output ) {print ( "NWN2 Server down!");} else {$lines = explode( "\x00", $output );print( "NWN Server &gt;&gt; ONLINE &lt;&lt; - Mod: $lines[4] - Spieler: $lines[5]/$lines[6] -" );$dlines = explode( "\n", $lines[15] );}}fclose( $connect );?&gt;</code></pre></div>Everything works except that it does not show "mod&amp;players" from my et server, output etc. works just fine<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10795">jameS</a> — Thu Aug 20, 2009 10:45 am</p><hr />
]]></content>
	</entry>
	</feed>
