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

	<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>2016-07-14T03:28:06-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Get_A_Fix]]></name></author>
		<updated>2016-07-14T03:28:06-04:00</updated>

		<published>2016-07-14T03:28:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105251#p105251</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105251#p105251"/>
		<title type="html"><![CDATA[pub command for specific vhost]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105251#p105251"><![CDATA[
<blockquote class="uncited"><div>seems to work only the reason doesnt seem to take more than the first parameter</div></blockquote>While that method does work, in some cases, the best method for your code would be to use lrange, and split it:<div class="codebox"><p>Code: </p><pre><code>set reason [join [lrange [split $text] 1 end]]</code></pre></div>For the Shun command, you would want to either declare the duration in the command, or set a default duration (like you did). If you set it hardcoded, this would make the command; <strong class="text-strong">!shun nick!*identd@*.host.or.IP &lt;reasons for shun here&gt;</strong><br>If you want to allow the duration to be in the command, you'd also have to change the reason to match the argument value.<br><strong class="text-strong">!shun nick!*identd@*.host.or.IP &lt;duration&gt; &lt;reasons for shun&gt;</strong> - this would make it:<div class="codebox"><p>Code: </p><pre><code>set duration [lindex $text 1]set reason [join [lrange [split $text] 2 end]]</code></pre></div>I don't see how or where you declared <strong class="text-strong">$user</strong> - do you mean to use <strong class="text-strong">$nick</strong> ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6204">Get_A_Fix</a> — Thu Jul 14, 2016 3:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2016-07-08T12:54:09-04:00</updated>

		<published>2016-07-08T12:54:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105239#p105239</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105239#p105239"/>
		<title type="html"><![CDATA[pub command for specific vhost]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105239#p105239"><![CDATA[
seems to work only the reason doesnt seem to take more than the first parameter (used your version)<br><br>if i do :<br><br>!kll Higgins lets try this<br><br>it kills with reason lets and leaves out other param<br><br>also is there a way to add more hosts than 1<br><br>so far this is what i have:<br><div class="codebox"><p>Code: </p><pre><code>bind pub * !kill oper:killproc oper:kill {nick uhost hand chan text} {  if {![string match -nocase "channel.bot" [lindex [split $uhost @] 1]]} return   if {[llength $text] != 2} {   puthelp "NOTICE $nick :usage: !kill &lt;nick&gt; &lt;reason&gt;"} else {   set reason [lassign $text user]} if {[isbotnick $user]} {# do whatever you wishreturn}   if {[isop $user $chan]} {      puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"      return   }   putserv "KILL $user $reason"}bind pub * !shun oper:shunproc oper:shun {nick uhost hand chan text} {if {![string match -nocase "channel.bot" [lindex [split $uhost @] 1]]} return    if {[llength $text] != 3} {   puthelp "NOTICE $nick :usage: !shun nick!user@host duration reason"} else {   set reason [lassign $text user duration]   if {![scan $duration {%d} d]} {      # set a defaul duration cos what the user gave is not a valid number      set duration "10"   }} if {[isbotnick $user]} {# do whatever you wishreturn}   if {[isop $user $chan]} {      puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"      return   }   putserv "SHUN $user $duration :$reason"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Fri Jul 08, 2016 12:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2016-07-08T01:47:53-04:00</updated>

		<published>2016-07-08T01:47:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105236#p105236</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105236#p105236"/>
		<title type="html"><![CDATA[pub command for specific vhost]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105236#p105236"><![CDATA[
To achieve what you asked for replace:<div class="codebox"><p>Code: </p><pre><code>if {![isop $nick $chan]} return </code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>if {![string match -nocase "channel.bot" [lindex [split $uhost @] 1]]} return</code></pre></div>You also need to replace:<div class="codebox"><p>Code: </p><pre><code>if {[scan $text {%s%s} user reason] != 2} {puthelp "NOTICE $nick :usage: !kl &lt;nick&gt;  &lt;reason&gt;"return}</code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>if {[llength $text] != 2} {puthelp "NOTICE $nick :usage: !kl &lt;nick&gt; &lt;reason&gt;"} else {set reason [lassign $text user]}</code></pre></div>and:<div class="codebox"><p>Code: </p><pre><code>if {[scan $text {%s%s%s} user duration reason] != 3} {puthelp "NOTICE $nick :usage: !sh nick!user@host duration :reason"return}</code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>if {[llength $text] != 3} {puthelp "NOTICE $nick :usage: !sh nick!user@host duration :reason"} else {set reason [lassign $text user duration]if {![scan $duration {%d} d]} {# set a defaul duration cos what the user gave is not a valid numberset duration "10"}}</code></pre></div>cos <em class="text-italics">reason</em> will be just one word, for example if you do<em class="text-italics"> !kl nick some reason here</em> the actual <em class="text-italics">reason</em> set by the <em class="text-italics">scan</em> will actually be <em class="text-italics">some</em>, and not <em class="text-italics">some reason here</em> as expected.<br><br>With scan as is right now:<div class="codebox"><p>Code: </p><pre><code>% set text "nick some reason here"nick some reason here% scan $text {%s%s} user reason2% puts $usernick% puts $reasonsome</code></pre></div>and with the lassign trick:<div class="codebox"><p>Code: </p><pre><code>% set text "nick some reason here"% set reason [lassign $text user]some reason here% puts $usernick% puts $reasonsome reason here</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Jul 08, 2016 1:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2016-07-07T19:35:27-04:00</updated>

		<published>2016-07-07T19:35:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105235#p105235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105235#p105235"/>
		<title type="html"><![CDATA[pub command for specific vhost]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105235#p105235"><![CDATA[
greetz i was wondering how to this small tcl could be changed  to have it only trigger if certain vhost ( channel.bot )  uses it in instead of (if {![isop $nick $chan]} return ) with pubic cmd and as well as in pm msg of the eggdrop<br><div class="codebox"><p>Code: </p><pre><code>bind pub * !kl oper:kill proc oper:kill {nick uhost hand chan text} {   if {![isop $nick $chan]} return   if {[scan $text {%s%s} user  reason] != 2} {      puthelp "NOTICE $nick :usage: !kl &lt;nick&gt;  &lt;reason&gt;"      return   }if {[isbotnick $user]} {# do whatever you wishreturn}    if {[isop $user $chan]} {      puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"      return   }   putserv "KILL $user $reason"}bind pub * !sh oper:shunproc oper:shun {nick uhost hand chan text} {   if {![isop $nick $chan]} return   if {[scan $text {%s%s%s} user duration reason] != 3} {      puthelp "NOTICE $nick :usage: !sh nick!user@host duration :reason"      return   }if {[isbotnick $user]} {# do whatever you wishreturn}    if {[isop $user $chan]} {      puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"      return   }   putserv "SHUN $user $duration $reason"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Jul 07, 2016 7:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
