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

	<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>2017-03-08T10:43:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[level6]]></name></author>
		<updated>2017-03-08T10:43:03-04:00</updated>

		<published>2017-03-08T10:43:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105873#p105873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105873#p105873"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105873#p105873"><![CDATA[
Full script, in case anyone finds it useful... again, please excuse any sloppy TCL.<br><br>botnet_fruitattack_1.0.tcl:<div class="codebox"><p>Code: </p><pre><code>proc botnet_fruitattack_pub {nick uhost handle chan argv} {  if {[regexp {[\{]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\}]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\']} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\"]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\!]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\`]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  set whotoattack [lindex $argv 0]  global ismaster  global botnick  set verb {  "rapes"  "makes passionate love to"  "pummels"  "stabs"  "plays hide-the-fruit with"  "teabags"  "socks the [censored] outta"  "replaces the existance of"  "shoots laser beams at"  "makes emo poetry at"  }  set fruit {  "apples"  "bananas"  "oranges"  "mangos"  "pinnapples"  "pears"  "passion fruits"  "a bunch of grapes"  "a bag of plums"  "a basket of peaches"  }  if {$whotoattack == ""} {    putserv "NOTICE $chan :ERROR\: Please supply a nick to attack. derp."    return 0  }  if {$whotoattack == "spin"} {    putserv "NOTICE $chan :ERROR\: Nawp.  Ain't gunna do eet.  derp."    return 0  }  if {![onchan $whotoattack $chan]} {    putserv "NOTICE $chan :ERROR\: No such person here, dummay."    return 0  }  set how [lindex $verb [rand [llength $verb]]]  set what [lindex $fruit [rand [llength $fruit]]]  if { $ismaster == 1 } {    putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"    putallbots "attack $whotoattack $chan"    dccbroadcast "MASTER $botnick - Command accepted.  I will $how $whotoattack with $what!"    dccbroadcast "MASTER $botnick - Command sent to all bots!"  } else {          putlog "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"          dccbroadcast "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"         }  putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"  return 1}proc botnet_fruitattack {handle idx argv} {  if {[regexp {[\{]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\}]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\']} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\"]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\!]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  if {[regexp {[\`]} $argv]&gt;0} {    putserv "NOTICE $chan :ERROR\: OK!   Dumping my /etc/shadow file ...  please wait."    return 0  }  set whotoattack [lindex $argv 0]  set chan "#LIEnet"  global ismaster  global botnick  set verb {  "rapes"  "makes passionate love to"  "pummels"  "stabs"  "plays hide-the-fruit with"  "teabags"  "socks the [censored] outta"  }  set fruit {  "apples"  "bananas"  "oranges"  "mangos"  "pinnapples"  "pears"  "passion fruits"  "grapes"  }  if {$whotoattack == ""} {    putserv "NOTICE $chan :ERROR\: Please supply a nick to attack. derp."    return 0  }  set how [lindex $verb [rand [llength $verb]]]  set what [lindex $fruit [rand [llength $fruit]]]  if { $ismaster == 1 } {    putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"    putallbots "attack $whotoattack $chan"    dccbroadcast "MASTER $botnick - Command accepted.  I will $how $whotoattack with $what!"    dccbroadcast "MASTER $botnick - Command sent to all bots!"  } else {          putlog "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"          dccbroadcast "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"         }  putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"  return 1}if {$ismaster == 1} { bind pub - .attack botnet_fruitattack_pub bind dcc - attack botnet_fruitattack putlog "Botnet Fruit Attacker v1.0 Loaded as MASTER!"} else {        bind bot - attack botnet_fruitattack        putlog "Botnet Fruit Attacker v1.0 Loaded as SLAVE!"       }</code></pre></div>Some things I know could use more dev:<br>1) I had to hardcode a channel in to get the DCC to work.  Need to add an option to direct it to any channel, then make sure they are all on it, etc..  DCC bound commands do not include channel, of course.<br>2) There is probably a much easier one-liner to regexp for cleaning the input, but I had enough trouble finding how to just get "{" to match, so I was happy to make a lot of separate statements.  Maybe this would work?:<br><br>  if {[regexp {[\{\}\"\!\`\]} $argv]&gt;0} {<br><br>There is probably a lot more "wrong" with it.  Use at your own peril.  But, it works.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12683">level6</a> — Wed Mar 08, 2017 10:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[level6]]></name></author>
		<updated>2017-03-08T10:29:45-04:00</updated>

		<published>2017-03-08T10:29:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105872#p105872</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105872#p105872"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105872#p105872"><![CDATA[
Thanks, SpiKe^^.  If I need more precision or granularity (maybe using the flags) it's great to know there is another possibility.  But, for now, all my slave bots are equal and there is only one master, so this solution will work for me.<br><div class="codebox"><p>Code: </p><pre><code>[08:28:26] MASTER liar - Sending orders to all bots to Fruit Attack!*** MASTER liar - Command accepted.  I will stabs tda with a basket of peaches!*** MASTER liar - Command sent to all bots!*** (liar_botnet_1) SLAVE liar_botnet_1 - Command accepted.  I will teabags tda with passion fruits!*** (liar_botnet_2) SLAVE liar_botnet_2 - Command accepted.  I will pummels tda with bananas!</code></pre></div>Perfect.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12683">level6</a> — Wed Mar 08, 2017 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2017-03-08T10:14:18-04:00</updated>

		<published>2017-03-08T10:14:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105871#p105871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105871#p105871"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105871#p105871"><![CDATA[
I can tell you that it is completely possible to add the bots own handle and attributes to its own user file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Mar 08, 2017 10:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[level6]]></name></author>
		<updated>2017-03-08T03:16:25-04:00</updated>

		<published>2017-03-08T03:16:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105868#p105868</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105868#p105868"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105868#p105868"><![CDATA[
Bad TCL, for sure.  Frankly, I struggle with TCL.  But, that's neither here nor there.<br><br>So, this is what worked:<br><br>1) Either in your eggdrop,conf or in a separate script (botcfg.tcl or something) you load via eggdrop.conf:<br><div class="codebox"><p>Code: </p><pre><code>set ismaster 1</code></pre></div>Change that to 0 on the slave bots, of course.<br><br>2) Then, in the script that is being .netupdate'd around, shared by all bots:<div class="codebox"><p>Code: </p><pre><code>proc botnet_fruitattack_pub {nick uhost handle chan argv} {..  global ismaster  global botnick..  if { $ismaster == 1 } {    putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"    putallbots "attack $whotoattack $chan"    dccbroadcast "MASTER $botnick - Command accepted.  I will $how $whotoattack with $what!"    dccbroadcast "MASTER $botnick - Command sent to all bots!"  } else {          putlog "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"          dccbroadcast "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"         }  putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"..</code></pre></div>And, the dependent binds:<br><div class="codebox"><p>Code: </p><pre><code>if {$ismaster == 1} { bind pub - .attack botnet_fruitattack_pub bind dcc - attack botnet_fruitattack putlog "Botnet Fruit Attacker v1.0 Loaded as MASTER!"} else {        bind bot - attack botnet_fruitattack        putlog "Botnet Fruit Attacker v1.0 Loaded as SLAVE!"       }</code></pre></div>Now, the botnet'ed bots will behave differently, using the same script.<br><br>Again, if you notice something screwy about my TCL code, sorry.  I struggle with it.  It's not that I hate it - TCL has its place.<br><br>Anyway, you guys really did help.  Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12683">level6</a> — Wed Mar 08, 2017 3:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[level6]]></name></author>
		<updated>2017-03-07T14:34:10-04:00</updated>

		<published>2017-03-07T14:34:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105867#p105867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105867#p105867"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105867#p105867"><![CDATA[
I was hoping to trigger that on the "h"ub vs. "l"eaf bot flags.  I am seeing your point, now, though.  If the bot currently running the script is not in users, then there will be no attributes to get.  Bleh.<br><br>I was going for something like this:<br><div class="codebox"><p>Code: </p><pre><code># not going to work...set bothandle [nick2hand $botnick]if {[set nfo [getuser $bothandle BOTFL]] != "" &amp;&amp; [string match "*h*" $nfo]} { set ismaster=1} else {        set ismaster=0       }if {$ismaster}{ bind pub - .attack botnet_fruitattack_pub bind dcc - attack botnet_fruitattack putlog "Botnet Fruit Attacker v1.0 Loaded as MASTER!"} else {        bind bot - attack botnet_fruitattack        putlog "Botnet Fruit Attacker v1.0 Loaded as SLAVE!"       }</code></pre></div>Then, in the procs:<br><div class="codebox"><p>Code: </p><pre><code>..  if {$ismaster} {    putlog "MASTER $botnick - Sending orders to all bots to Fruit Attack!"    putallbots "attack $whotoattack $chan"    dccbroadcast "MASTER $botnick - Command accepted.  I will $how $whotoattack with $what!"    dccbroadcast "MASTER $botnick - Command sent to all bots!"  } else {          putlog "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"          dccbroadcast "SLAVE $botnick - Command accepted.  I will $how $whotoattack with $what!"         }  putserv "PRIVMSG $chan : -=( $how $whotoattack with $what )=-"..</code></pre></div>I think I will just have to hardcode my own global assigning <em class="text-italics">ismaster</em> or <em class="text-italics">isslave</em> in a separate script on each bot and consider that part of the initial set-up.  Then I could use that for the rest of my scripts.<br><br>Mostly, I just need to separate the <em class="text-italics">bind</em>s and the <em class="text-italics">putallbots</em> so that the same script can be transferred across all bots.<br><br>Or, is this all just crazy talk?  <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=12683">level6</a> — Tue Mar 07, 2017 2:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2017-03-07T12:43:44-04:00</updated>

		<published>2017-03-07T12:43:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105866#p105866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105866#p105866"/>
		<title type="html"><![CDATA[Re: Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105866#p105866"><![CDATA[
<blockquote class="uncited"><div>Hi.  New here, ...<br></div></blockquote>Welcome.  <br><blockquote class="uncited"><div>Is there any [built-in] way to determine the eggdrop bot's own nick at any given time?  </div></blockquote>Wouldn't that be the global variable,   botnick  ?<br><br><a href="http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html#globvars" class="postlink">http://www.eggheads.org/support/egghtml ... l#globvars</a><br><br><br><blockquote class="uncited"><div>What I really want is to allow it to become self-aware of its own attributes via getuser with the BOTFL, but those functions appear to be dependent on nick.  If there is any way to get "my own" attributes on each bot, that would work, too.</div></blockquote>I think that I'm not understanding you.<br><br>Attributes are flags saved in an account on a bot.  It seems like to do what you want, the bot would have to have an account on itself.<br><br>Why would the bot have itself in it's .user file?<br><br><blockquote class="uncited"><div>My end game is to be able to write and distribute a single script for all bots on a botnet, then have leaf bots behave differently than hub bots using code in that script.  I am just getting tired of maintaining two scripts for every thing (one for hubs, one for leaves).  So, if I am missing some other obvious way to do this, please let me know. <br></div></blockquote>What would trigger the behavior to which they would react differently?<br><br>If you don't care if others see your script(s), you might get more results if you posted them here with the /<div class="codebox"><p>Code: </p><pre><code>[code/]</code></pre></div>   /[/code/]  tags.<br><br>Or:<br><a href="http://paste.tclhelp.net/" class="postlink">http://paste.tclhelp.net/</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Tue Mar 07, 2017 12:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[level6]]></name></author>
		<updated>2017-03-07T12:41:29-04:00</updated>

		<published>2017-03-07T12:41:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105865#p105865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105865#p105865"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105865#p105865"><![CDATA[
I did.  But, the names of things are a little scattered and it makes it difficult to search.   I was looking for "my" and "is".  Coulda sworn I searched for "bot"...  but now I feel dumb. <br><br>Thank you!  That is exactly what I was looking for.  You rock.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12683">level6</a> — Tue Mar 07, 2017 12:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Get_A_Fix]]></name></author>
		<updated>2017-03-07T20:31:09-04:00</updated>

		<published>2017-03-07T12:34:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105864#p105864</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105864#p105864"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105864#p105864"><![CDATA[
Have you checked the ~/eggdrop/doc/tcl-commands.doc file?<br><br>The built-in method would be the $botnick variable. You can return your own handle with [matchattr [nick2hand $nick]] and your attributes using [chattr [nick2hand $nick] $chan]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6204">Get_A_Fix</a> — Tue Mar 07, 2017 12:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[level6]]></name></author>
		<updated>2017-03-07T08:15:56-04:00</updated>

		<published>2017-03-07T08:15:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105863#p105863</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105863#p105863"/>
		<title type="html"><![CDATA[Determining the bot's own current nick?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105863#p105863"><![CDATA[
Hi.  New here, but have been using eggdrop since the 90s.<br><br>Is there any [built-in] way to determine the eggdrop bot's own nick at any given time?  <br><br>What I really want is to allow it to become self-aware of its own attributes via getuser with the BOTFL, but those functions appear to be dependent on nick.  If there is any way to get "my own" attributes on each bot, that would work, too.<br><br>My end game is to be able to write and distribute a single script for all bots on a botnet, then have leaf bots behave differently than hub bots using code in that script.  I am just getting tired of maintaining two scripts for every thing (one for hubs, one for leaves).  So, if I am missing some other obvious way to do this, please let me know. <br><br>Thanks!<br><br>Raymond.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12683">level6</a> — Tue Mar 07, 2017 8:15 am</p><hr />
]]></content>
	</entry>
	</feed>
