<?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/18635" />

	<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>2011-09-13T19:12:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[TEK7]]></name></author>
		<updated>2011-09-13T19:12:14-04:00</updated>

		<published>2011-09-13T19:12:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97732#p97732</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97732#p97732"/>
		<title type="html"><![CDATA[regexp help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97732#p97732"><![CDATA[
The rcon dcc connection isn't work. And the bot can't recieve logadress<br><div class="codebox"><p>Code: </p><pre><code>SOCK ADDR     PORT  NICK      HOST              TYPE---- -------- ----- --------- ----------------- ----3    00000000     0 (dns)                       dns   (ready)4    00000000     0 (rcon)                      rcon   (ready)6    C0A80102  2727 (telnet)  *                 lstn  27278    55EC6EE2  6667 (server)  uk.quakenet.org   serv  (lag: 0)9    7F000001 56371 crashers- telnet@localhost  chat  flags: cpTEp/0</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11170">TEK7</a> — Tue Sep 13, 2011 7:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TEK7]]></name></author>
		<updated>2011-09-12T12:30:01-04:00</updated>

		<published>2011-09-12T12:30:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97718#p97718</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97718#p97718"/>
		<title type="html"><![CDATA[regexp help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97718#p97718"><![CDATA[
I can't do that :/, 'im not scripter, i need that bot reads the console of my hlserver, and compare that string, and if match to say to channel. Can you help me?<br><br>Thanks<br><br>The original script is this, but that part of script doenst work :/ and i need some help to fix them. I use rcon mod.<br><div class="codebox"><p>Code: </p><pre><code># Server ip address/hostnameset rhost "counterstrike.server.com"# Server portset rport "27015"# Rcon passwordset rconpass "blah"################################################### Shouldn't need to change anything down here ###################################################set matchchan ""set challenge [challengercon $rhost $rport]set mb_teamsay 1set mb_say 1set mb_maxnamelength 15array set kills {}array set deaths {}bind rcon - * rconmsgproc rconmsg {msg} {  global rhost rport my-ip  global mb_teamsay mb_say matchchan  regexp {log L [^ ]+ - [0-9]{2}:[0-9]{2}:[0-9]{2}: (.+)} $msg orig msg#  putlog $msg  if {[regexp {\"(.+)\" attacked \"(.+)\" with \"(.+)\" \(damage \"([0-9]+)\"\) \(damage_armor \"([0-9]+)\"\) \(health \"(.+)\"\) \(armor \"([0-9]+)\"\)} $msg all nk1 nk2 gun damage damage_armor health armor]} {    # do nothing. ignore.  } elseif { [regexp {^Rcon: .+$} $msg] } {      if {[regexp {Rcon: \"rcon .+ logaddress (.+) (.+)\" from \"(.+)\"} $msg all loghost logport address] &amp;&amp; $loghost != ${my-ip}} {          if {$matchchan == ""} {              putrconchan "Uh oh...logaddress was changed to $loghost $logport by $address..."          } else {              putrconchan "Uh oh...logaddress was changed to $loghost $logport by $address...getting it back"              getrconlog          }      } else {          putlog $msg      }  } elseif { [regexp {^Server cvars .+$} $msg] } {    putlog $msg  } elseif { [regexp {^Server cvar .+$} $msg] } {    putlog $msg  } elseif { [regexp {^Log file .+$} $msg] } {    putlog $msg  } elseif { [regexp {^\[ADMIN\] .+$} $msg] } {    putlog $msg  } elseif { [regexp {^\[META\] .+$} $msg] } {    putlog $msg  } elseif { [regexp {^Server say \"(.+)\"} $msg all s] } {    putrconchan "\002Server\002: $s"  } elseif { [regexp {^World triggered \"(.+)\"} $msg all txt] } {    if {[string compare $txt "Round_End"] == 0} {    } elseif {[string compare $txt "Round_Start"] == 0} {      putrconchan "$msg"    } else {      putrconchan "$msg"    } } elseif { [regexp {^Team \"(.+)\" scored \"(.+)\" with \"(.+)\" players} $msg all team score players] } {    putrconchan "\002$team score:\002 $score"    resetkills    resetdeaths } elseif { [regexp {^Team \"(.+)\" triggered \"(.+)\" \(CT \"([0-9]+)\"\) \(T \"([0-9]+)\"\)} $msg all team txt scorect scoret] } {    putrconchan "$msg"  } elseif {[regexp {\"(.+)\" killed \"(.+)\" with \"(.+)\"} $msg all nk1 nk2 gun]} {       set sid1 [serverid $nk1]    set sid2 [serverid $nk2]        # team kill    if {[team $nk1] == [team $nk2]} {      updatekills $sid1  -1      updatedeaths $sid2 1    } else { # regular kill      updatekills $sid1 1      updatedeaths $sid2 1    }        putrconchan "[parsename $nk1] killed [parsename $nk2] with \00303$gun\003"  } elseif {[regexp {\"(.+)\" say \"(.+)\"(.*)} $msg all nk1 txt dead]} {    if {$mb_say} {      if {[string compare $dead " (dead)"] == 0} {        putrconchan "*DEAD*[parsename $nk1]: \00303$txt\003"      } else {        putrconchan "[parsename $nk1]: \00303$txt\003"      }    }  } elseif {[regexp {\"(.+)\" say_team \"(.+)\"(.*)} $msg all nk1 txt dead]} {    if {$mb_teamsay} {      if {[string compare $dead " (dead)"] == 0} {        putrconchan "*DEAD*[parsename $nk1] (team): \00303$txt\003"      } else {        putrconchan "[parsename $nk1] (team): \00303$txt\003"      }    }  } elseif {[regexp {\"(.+)\" changed name to \"(.+)\"} $msg all nk1 nk2]} {    putrconchan "[parsename $nk1] changed name to $nk2"  } elseif {[regexp {\"(.+)\" triggered \"(.+)\"} $msg all nk1 txt]} {    if {[string compare $txt "Begin_Bomb_Defuse_With_Kit"] == 0} {      putrconchan "[parsename $nk1] is defusing the bomb with a kit"    } elseif {[string compare $txt "Begin_Bomb_Defuse_Without_Kit"] == 0} {      putrconchan "[parsename $nk1] is defusing the bomb without a kit"    } elseif {[string compare $txt "Planted_The_Bomb"] == 0} {      putrconchan "[parsename $nk1] planted the bomb"    } elseif {[string compare $txt "Got_The_Bomb"] == 0} {      putrconchan "[parsename $nk1] got the bomb"    } elseif {[string compare $txt "Dropped_The_Bomb"] == 0} {      putrconchan "[parsename $nk1] dropped the bomb"    } elseif {[string compare $txt "Spawned_With_The_Bomb"] == 0} {      putrconchan "[parsename $nk1] has the bomb"    } elseif {[string compare $txt "Defused_The_Bomb"] == 0} {      putrconchan "[parsename $nk1] defused the bomb!"    } else {      putrconchan "[parsename $nk1] triggered $txt"    }  } elseif {[regexp {\"(.+)\" committed suicide with \"(.+)\"} $msg all nk1 txt]} {      set sid1 [serverid $nk1]        updatedeaths $sid1 1        putrconchan "[parsename $nk1] committed suicide with $txt"  } elseif {[regexp {\"(.+)\" joined team \"(.+)\"} $msg all nk1 newteam]} {    putrconchan "\002[parsename $nk1]\002 joined the $newteam team"  } elseif {[regexp {\"(.+)\" disconnected} $msg all nk1]} {    putrconchan "[parsename $nk1] disconnected"  } elseif {[regexp {\"(.+)\" connected, address \"(.+)\"} $msg all nk1 address]} {    putrconchan "\002[parsename $nk1]\002 &lt;$address&gt; connected"  } elseif {[regexp {\"(.+)\" entered the game} $msg all nk1]} {    updatekills [serverid $nk1] 0    updatedeaths [serverid $nk1] 0    putrconchan "\002[parsename $nk1]\002 entered the game"  } elseif {[regexp {Loading map \"(.+)\"} $msg all map]} {    putrconchan "Loading map: $map"  } elseif { [regexp {^Bad Rcon: .+$} $msg] } {    putlog $msg  } else {    putrconchan $msg    putlog "Unknown: $msg"  }}proc parsename {name} {  global kills deaths mb_maxnamelength    if {[regexp {(.+)&lt;([0-9]+)&gt;&lt;[0-9]+&gt;&lt;([A-Z]*)&gt;} $name all nk sid team]} {    if {[string compare $team "TERRORIST"] == 0} {      return [format "\00304%-${mb_maxnamelength}.${mb_maxnamelength}s\003 \[%-2d/%2d\]" $nk [getkills $sid] [getdeaths $sid]]    } elseif {[string compare $team "CT"] == 0} {      return [format "\00312%-${mb_maxnamelength}.${mb_maxnamelength}s\003 \[%-2d/%2d\]" $nk [getkills $sid] [getdeaths $sid]]    } else {      return "$nk"    }  } else {    return $name  }}proc team {name} {  if {[regexp {.+&lt;[0-9]+&gt;&lt;[0-9]+&gt;&lt;([A-Z]*)&gt;} $name all team]} {    return $team  } else {    return ""  }}proc serverid {name} {  if {[regexp {.+&lt;([0-9]+)&gt;&lt;[0-9]+&gt;&lt;[A-Z]*&gt;} $name all serverid]} {    return $serverid  } else {    return "0"  }}proc getrconlog {} {    global rhost rport challenge my-ip rcon-listen-port rconpass    set response [myrcon "logaddress ${my-ip} ${rcon-listen-port}"]}proc putrconchan {msg} {  global matchchan  dccputchan 1 $msg  if {$matchchan != ""} {    putquick "PRIVMSG $matchchan :$msg"  }  }proc updatekills {sid incr} {  global kills    if {$incr == 0} {    set kills($sid) 0  } elseif {[info exists kills($sid)]} {    incr kills($sid) $incr  } else {    set kills($sid) $incr  }}proc resetkills {} {  global kills  array unset kills  }proc getkills {sid} {  global kills  if {[info exists kills($sid)]} {    return $kills($sid)  } else {    return 0  }}proc updatedeaths {sid incr} {  global deaths    if {$incr == 0} {    set deaths($sid) 0  } elseif {[info exists deaths($sid)]} {    incr deaths($sid) $incr  } else {    set deaths($sid) $incr  }}proc resetdeaths {} {  global deaths  array unset deaths}proc getdeaths {sid} {  global deaths  if {[info exists deaths($sid)]} {    return $deaths($sid)  } else {    return 0  }}proc matchbot {nickname ident handle channel argument } {  global matchchan rhost rport challenge rconpass rcon-listen-port my-ip  global mb_say mb_teamsay mb_maxnamelength  set cmd [lindex $argument 0]  set args [lrange $argument 1 end]  resetkills  resetdeaths  if {$cmd == "stop"} {    clearqueue help    putquick "PRIVMSG $channel :Stopped matchbot"    set matchchan ""  } elseif {$cmd == "start"} {    if {$args != ""} {        set matchchan $args    } else {        set matchchan $channel    }    getrconlog    putquick "PRIVMSG $channel :Starting matchbot in \"$matchchan\""    putquick "PRIVMSG $channel :Parameters: (say $mb_say) (teamsay $mb_teamsay) (maxnamelength $mb_maxnamelength)"  } elseif {$cmd == "set"} {    set var [lindex $args 0]    set val [lindex $args 1]    if {$var == "say"} {      if {$val == ""} {        putquick "PRIVMSG $channel :mm1 display is set to $mb_say"      } else {        if {$val == "1" || $val == "on"} {          set mb_say 1        } else {          set mb_say 0        }        putquick "PRIVMSG $channel :mm1 display was changed to $mb_say"      }    } elseif {$var == "teamsay"} {      if {$val == ""} {        putquick "PRIVMSG $channel :say_team display is set to $mb_teamsay"      } else {        if {$val == "1" || $val == "on"} {          set mb_teamsay 1        } else {          set mb_teamsay 0        }        putquick "PRIVMSG $channel :say_team display was changed to $mb_teamsay"      }    } elseif {$var == "maxnamelength"} {      if {$val == "" || ![string is integer $val]} {        putquick "PRIVMSG $channel :Max name length is set to $mb_maxnamelength"      } else {        set mb_maxnamelength $val        putquick "PRIVMSG $channel :Max name length was changed to $mb_maxnamelength"      }    } else {      putserv "NOTICE $nickname :Syntax: @matchbot set &lt;cmd&gt; \[on|off|value\]"      putserv "NOTICE $nickname :Commands:"      putserv "NOTICE $nickname :  maxnamelength \[#\]  :: Sets the max name length to \002\#\002, for display purposes"      putserv "NOTICE $nickname :  say \[on|off\]  :: Sets the display of message mode 1 data \002on\002 or \002off\002"      putserv "NOTICE $nickname :  teamsay \[on|off\]  :: Sets the display of message mode 2 data (team_say) \002on\002 or \002off\002"    }  } else {    putserv "NOTICE $nickname :ki server matchbot syntax:"    putserv "NOTICE $nickname :@matchbot start \[target\]  ::  Starts a matchbot in \002target\002, or the current channel if \002target\002 is not specified"    putserv "NOTICE $nickname :@matchbot stop  ::  Stops matchbot"    putserv "NOTICE $nickname :@matchbot set &lt;parameter&gt; \[value\]   ::  Sets or displays matchbot parameters :: \002@matchbot set\002 for more info"  }  return 1}bind pub o|o @matchbot matchbotproc rconsay {nickname ident handle channel argument } {  global rhost rport rconpass challenge  if {$argument == ""} {    putserv "PRIVMSG $channel :Syntax: @say &lt;text&gt;"  } else {    set response [myrcon "say $argument"]    putserv "PRIVMSG $channel :$response"  }  return 1}bind pub o|o @say rconsayproc rconmap {nickname ident handle channel argument } {  global rhost rport rconpass challenge  if {$argument == ""} {    putserv "PRIVMSG $channel :Syntax: @map &lt;map&gt;"  } else {    set response [myrcon "changelevel $argument"]    putserv "PRIVMSG $channel :$response"  }  return 1}bind pub o|o @map rconmapproc rconexec {nickname ident handle channel argument } {  global rhost rport rconpass challenge  if {$argument == ""} {    putserv "PRIVMSG $channel :Syntax: @rcon &lt;cmd&gt;"  } else {    set response [myrcon $argument]    putserv "PRIVMSG $channel :$response"  }  return 1}bind pub o|o @rcon rconexecbind pub o|o @challenge rconchallengeproc rconchallenge {nickname ident handle channel argument } {      global rhost rport challenge      set challenge [challengercon $rhost $rport]      putserv "PRIVMSG $channel :Challenge received"}proc myrcon {mycmd} {  global rhost rport rconpass challenge  set response [rcon $rhost $rport $challenge "$rconpass" $mycmd]  if {[regexp {Bad challenge.} $response all] || [regexp {No challenge for your address.} $response all]} {      set challenge [challengercon $rhost $rport]      set response [rcon $rhost $rport $challenge "$rconpass" $mycmd]  }  return $response}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11170">TEK7</a> — Mon Sep 12, 2011 12:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-09-12T06:24:10-04:00</updated>

		<published>2011-09-12T06:24:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97717#p97717</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97717#p97717"/>
		<title type="html"><![CDATA[regexp help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97717#p97717"><![CDATA[
The syntax for <strong class="text-strong">regexp</strong> is as follows<div class="codebox"><p>Code: </p><pre><code>regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?</code></pre></div>First off, you don't supply any text to be searched to your regexp command. Secondly, the first match-variable (if supplied) contains the whole part of the string that matches the pattern, the second match-variable contains the first sub-expression that matched, third match-variable the second sub-expression, and so on...<br>Third, since you've already placed your pattern within brackets, there's no need to escape characters from being substituted or such.. don't escape quotes (")<br><br>Your regexp should look something along these lines, though you'll have to fill the source-variable with something first (the actual text you're searching).<div class="codebox"><p>Code: </p><pre><code>...if {[regexp {"(.+)" committed suicide with "(.+)"} $source match nk1 txt]} {...</code></pre></div>Next, I see you have two different bindings that both call the rconm proc. Unfortunately, these (rcon and pub) do not have matching argument lists, so this will not work.<br><br>As for continuous checking, either use the time or cron bindings, or iterative timers (start a new timer for your function at the end of the function).<br>Obviously, you'll have to adjust the argument list of your procs accordingly to your choice of invocation.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Sep 12, 2011 6:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TEK7]]></name></author>
		<updated>2011-09-11T21:33:57-04:00</updated>

		<published>2011-09-11T21:33:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97715#p97715</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97715#p97715"/>
		<title type="html"><![CDATA[regexp help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97715#p97715"><![CDATA[
hello,<br>This part of my script doesn't work :/ i need help, i'm not scripter :c<br><div class="codebox"><p>Code: </p><pre><code>bind rcon - * rconmbind pub o|o .m rconmproc rconm {nickname ident handle channel argument} {  global rhost rport my-ip  global matchchan  getrconlogif {[regexp {\"(.+)\" committed suicide with \"(.+)\"} nk1 txt]} {      putquick "PRIVMSG $channel :$nk1 committed suicide with $txt"      }}</code></pre></div> i want, when i suicide on server de bot sends on irc "committed suicide with" but without bind ".m" i want like a loop.<br><br>This is my all script.<br><div class="codebox"><p>Code: </p><pre><code>bind msgm -|- ** pvtproc pvt {mad7684 mad8594 mad873 mad8954} {     global rhost rport rconpass challenge     set response [myrcon "say $mad7684: $mad8954"]}# Server ip address/hostnameset rhost "82.102.28.104"# Server portset rport "27100"# Rcon passwordset rconpass "xxxx"set matchchan "#sadklaskdl"set challenge [challengercon $rhost $rport]bind rcon - * rconmbind pub o|o .m rconmproc rconm {nickname ident handle channel argument} {  global rhost rport my-ip  global matchchan  getrconlogif {[regexp {\"(.+)\" committed suicide with \"(.+)\"} nk1 txt]} {      putquick "PRIVMSG $channel :$nk1 $txt"      }}bind pub o|o .map rconmapproc rconmap {nickname ident handle channel argument } {  global rhost rport rconpass challenge  if {$argument == ""} {    putserv "PRIVMSG $channel :Syntax: .map &lt;map&gt;"  } else {    set response [myrcon "changelevel $argument"]    putserv "PRIVMSG $channel :$response"  }  return 1}bind pub o|o .rr resproc res {nickname ident handle channel argument } {  global rhost rport rconpass challengeif {$argument == ""} {    set response [myrcon "sv_restart 1"]    putserv "PRIVMSG $channel :$response"  }  return 1}bind pub o|o .live liveproc live {nickname ident handle channel argument } {  global rhost rport rconpass challengeif {$argument == ""} {        set response [myrcon "sv_restart 1"]    after 1000     set response [myrcon "sv_restart 1"]    after 1000    set response [myrcon "sv_restart 3"]    after 3000     set response [myrcon "say LIVE LIVE LIVE - GL &amp; HF"]    set response [myrcon "say LIVE LIVE LIVE - GL &amp; HF"]    set response [myrcon "say LIVE LIVE LIVE - GL &amp; HF"]    putserv "PRIVMSG $channel :$response"  }  return 1}proc myrcon {mycmd} {  global rhost rport rconpass challenge  set response [rcon $rhost $rport $challenge "$rconpass" $mycmd]  if {[regexp {Bad challenge.} $response all] || [regexp {No challenge for your address.} $response all]} {      set challenge [challengercon $rhost $rport]      set response [rcon $rhost $rport $challenge "$rconpass" $mycmd]  }  return $response}proc getrconlog {} {    global rhost rport challenge my-ip rcon-listen-port rconpass    set response [myrcon "logaddress ${my-ip} ${rcon-listen-port}"]}</code></pre></div>sorry my bad english :/ <br>thanks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11170">TEK7</a> — Sun Sep 11, 2011 9:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
