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

	<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-10-30T18:58:27-04:00</updated>

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

		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-10-30T18:58:27-04:00</updated>

		<published>2009-10-30T18:58:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90703#p90703</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90703#p90703"/>
		<title type="html"><![CDATA[Re: Correct prefix needed to catch]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90703#p90703"><![CDATA[
<blockquote class="uncited"><div>actually its "&lt;relaynick&gt; (chatnick@chatnet) <a href="http://www.website.com/blablabla" class="postlink">http://www.website.com/blablabla</a>"</div></blockquote>I'm guessing your relay script and xrl script are run on the same bot, otherwise it would work. You will need to edit your relay script and add this into it after it gives pub text output.<div class="codebox"><p>Code: </p><pre><code>putserv "privmsg $chan :&lt;$nick@$network&gt; $text"pubm:xrl $nick foo $hand $chan $text</code></pre></div>The above is merely an example. The bottom line of code will invoke xrl. This is how you would need to do it on a single bot relay/xrl. Of course that channel must be +xrl as well. This is common sense.<br><br>To get the $hand variable to contain the handle of the nickname relayed may not be possible... You may need to change the check shown below:<div class="codebox"><p>Code: </p><pre><code> if {([channel get $chan xrl] || [channel get $chan unxrl]) &amp;&amp; \     [expr [unixtime] - $xrl(delay)] &gt; $xrl(last) &amp;&amp; \     ![matchattr $user $xrl(antiflags)]} { </code></pre></div>To look like this:<div class="codebox"><p>Code: </p><pre><code> if {([channel get $chan xrl] || [channel get $chan unxrl]) &amp;&amp; \     [expr [unixtime] - $xrl(delay)] &gt; $xrl(last)} { </code></pre></div>Then you won't need the $hand variable and can craft the invocation like the way it is below:<div class="codebox"><p>Code: </p><pre><code>pubm:xrl $nick foo bar $chan $text</code></pre></div>This way we only need to pass the nickname, channel and text to the procedure. The other 2 variables $uhost and $handle aren't required since they aren't used. Hence they are invoked as "foo" and "bar" basically just used to fill the space with something so the other arguments passed line up correctly.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Oct 30, 2009 6:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eggman]]></name></author>
		<updated>2009-10-30T08:28:41-04:00</updated>

		<published>2009-10-30T08:28:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90682#p90682</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90682#p90682"/>
		<title type="html"><![CDATA[Correct prefix needed to catch]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90682#p90682"><![CDATA[
actually its "&lt;relaynick&gt; (chatnick@chatnet) <a href="http://www.website.com/blablabla" class="postlink">http://www.website.com/blablabla</a>"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10126">eggman</a> — Fri Oct 30, 2009 8:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[eggman]]></name></author>
		<updated>2009-10-29T23:49:41-04:00</updated>

		<published>2009-10-29T23:49:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90678#p90678</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90678#p90678"/>
		<title type="html"><![CDATA[xrl.tcl v2.32 by jer@usa.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90678#p90678"><![CDATA[
How can I add a catcher so &lt;nick@anotherircnet&gt; <a href="http://example.com/index.html" class="postlink">http://example.com/index.html</a> is caught?<br><br>Maybe &lt;*&gt; <a href="http://example.com/index.html" class="postlink">http://example.com/index.html</a> where * is a wildcard or any text between the initial &lt; &gt;'s<br><div class="codebox"><p>Code: </p><pre><code>#!/bin/sh# \exec tclsh "$0" "$@"package require http 2.2;###############################################################################set xrl(version) "xrl.tcl v2.32 by jer@usa.com" ;# updated: 2007.02.14;###############################################################################;# * command-line:;#   * $ ./xrl.tcl 'http://www.icaughtyouadeliciousbass.com/';# * console:;#   * $ ./xrl.tcl;#   * http://www.dontbejealousthativebeenchattingonlinewithbabesallday.com/;# * eggdrop:;#   * .chanset #channel +xrl +unxrl +logallurls;#   * /msg #channel http://www.icaughtyouadeliciousbass.com/;#   * /msg bot http://www.icaughtyouadeliciousbass.com/;###############################################################################set xrl(antiflags) "bdkqr|dkqr" ;# user flags to ignore for eggdrop useset xrl(msgmflags) "o|o" ;# user flags required for message eggdrop useset xrl(pubmflags) "-|-" ;# user flags required for channel eggdrop useset xrl(length) 40 ;# minimum url length to trigger channel eggdrop useset xrl(delay) 30 ;# minimum seconds to wait before another eggdrop useset xrl(last) 408 ;# internal variable, stores time of last eggdrop use;###############################################################################proc xrl {url} { if {[info exists url] &amp;&amp; [string length $url]} {  if {[regexp {http://xrl\.us/\w+} $url]} {   set http [::http::geturl $url -timeout 9000]   upvar #0 $http state ; array set meta $state(meta)   ::http::cleanup $http ; return $meta(Location)  } else {   set http [::http::geturl "http://metamark.net/add" \     -query [::http::formatQuery "long_url" $url] -timeout 9000]   set data [split [::http::data $http] \n] ; ::http::cleanup $http   for {set index [llength $data]} {$index &gt;= 0} {incr index -1} {    if {[regexp {href="http://xrl\.us/\w+"} [lindex $data $index] url]} {     return [string map { {href=} "" \" "" } $url] }}}} return ""};###############################################################################;# tclsh command-line/console procedure;###############################################################################if {[info exists argc]} { if {$argc} {  foreach arg [lrange $argv 0 end] {puts [xrl $arg]} } else {  puts "$xrl(version)"  puts "usage: $argv0 http://bullfrog.webhop.net/"  puts "enter url(s), one per line, press ctrl+c to cancel:"  while {[gets stdin line]} {puts [xrl [string trim $line]]} } exit};###############################################################################;# eggdrop channel message procedure;###############################################################################proc pubm:xrl {nick host user chan text} { global xrl if {([channel get $chan xrl] || [channel get $chan unxrl]) &amp;&amp; \     [expr [unixtime] - $xrl(delay)] &gt; $xrl(last) &amp;&amp; \     ![matchattr $user $xrl(antiflags)]} {  foreach word [split $text] {   if {([channel get $chan xrl] &amp;&amp; \        [string length $word] &gt;= $xrl(length) &amp;&amp; \        [regexp {^(f|ht)tp(s|)://} $word] &amp;&amp; \        ![regexp {://([^/:]*:([^/]*@|\d+(/|$))|.*/\.)} $word]) || \       ([channel get $chan unxrl] &amp;&amp; \        [regexp {http://xrl.us/\w+} $word])} {    set xrl(last) [unixtime]    set newurl [xrl $word]    if {[string length $newurl]} {     puthelp "PRIVMSG $chan :&lt;$nick&gt; $newurl"    }    putlog "&lt;$nick:$chan&gt; $word &lt;-&gt; $newurl"    break }}} if {[channel get $chan logallurls]} {  foreach word [split $text] {   if {[string match "*://*" $word]} {    putlog "&lt;$nick:$chan&gt; $word" }}} return 0}bind pubm $xrl(pubmflags) {*://*} pubm:xrl;###############################################################################;# eggdrop private message procedure;###############################################################################proc msgm:xrl {nick host user text} { global xrl if {![matchattr $user $xrl(antiflags)] &amp;&amp; \     [expr [unixtime] - $xrl(delay)] &gt; $xrl(last) &amp;&amp; \     [string match "*://*" [lindex [split $text] 0]] &amp;&amp; \     [llength [split $text]] == 1} {  set xrl(last) [unixtime]  set newurl [xrl $text]  if {[string length $newurl]} {   puthelp "PRIVMSG $nick :\1ACTION $newurl\1"   putlog "&lt;$nick&gt; $text &lt;-&gt; $newurl" }} return 0}bind msgm $xrl(msgmflags) {*://*} msgm:xrl;###############################################################################;# eggdrop chanset flags;###############################################################################setudef flag xrlsetudef flag unxrlsetudef flag logallurls;###############################################################################putlog "loaded: $xrl(version)" ;# eggdrop log message;###############################################################################</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10126">eggman</a> — Thu Oct 29, 2009 11:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
