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

	<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>2008-12-18T00:25:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Ikaa]]></name></author>
		<updated>2008-12-18T00:25:43-04:00</updated>

		<published>2008-12-18T00:25:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86329#p86329</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86329#p86329"/>
		<title type="html"><![CDATA[Restrict eggdrop scripts by channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86329#p86329"><![CDATA[
Ill try that. Thanks so much for your help guys.<br><br>*edit* Works great! Thanks again!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10365">Ikaa</a> — Thu Dec 18, 2008 12:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-12-17T17:09:38-04:00</updated>

		<published>2008-12-17T17:09:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86315#p86315</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86315#p86315"/>
		<title type="html"><![CDATA[Restrict eggdrop scripts by channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86315#p86315"><![CDATA[
My bad, I didn't notice that the variable-name is already in use (thought Ikaa made it up). You can use any other unused name for it Ikaa.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 17, 2008 5:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-12-17T16:40:02-04:00</updated>

		<published>2008-12-17T16:40:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86314#p86314</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86314#p86314"/>
		<title type="html"><![CDATA[Restrict eggdrop scripts by channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86314#p86314"><![CDATA[
That would be unwize, as ::gTimebombChannel is used to keep track of which channel the timebomb was activated, and is overwritten within StartTimeBomb. Considder using some other name, or use custom channel settings (<strong class="text-strong">setudef</strong> flag)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Dec 17, 2008 4:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-12-17T16:33:51-04:00</updated>

		<published>2008-12-17T16:33:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86312#p86312</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86312#p86312"/>
		<title type="html"><![CDATA[Restrict eggdrop scripts by channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86312#p86312"><![CDATA[
Create a list gTimebombChannel<div class="codebox"><p>Code: </p><pre><code>set gTimebombChannel [list #chan1 #chan2]</code></pre></div>and inside the procs doTimebomb and doCutWire add<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -exact $::gTimebombChannel $chan] == -1} { return 0}</code></pre></div>Should solve your problem.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Dec 17, 2008 4:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ikaa]]></name></author>
		<updated>2008-12-17T15:53:29-04:00</updated>

		<published>2008-12-17T15:53:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86311#p86311</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86311#p86311"/>
		<title type="html"><![CDATA[Restrict eggdrop scripts by channel]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86311#p86311"><![CDATA[
Is there a way in the .conf that eggdrop scripts can be restricted to certain channels if the script itself does not have that functionality?<br><br>Example: I want to run timebomb (below) in the trivia channel, and Bogus Trivia has a setting on what channel it will play in. Timebomb does not. Is this something that can be set easily, or would it involve a complete mod of the script?<br><br>I did try making an entry in the line "set gTimebombChannel "", but i dont think that thats what it's for. It was still useable in other channels.<br><div class="codebox"><p>Code: </p><pre><code>################################################################################  Name:                                        Timebomb#  Author:                                      jotham.read@gmail.com#  Web Site:                                    http://radiosaurus.sporkism.org#  Eggdrop Version:     1.6.x#  Description:##  This is a small TCL script for Eggdrop.  Timebomb is a game where one person#  asks the Eggdrop bot to plant a timebomb in another users pants.  The target#  user then needs to diffuse the bomb by cutting the correct wire, or be#  kicked from the channel.##  To start the game a user must type:#    timebomb &lt;nickname&gt;#  This will cause the target user to have a timebomb "stuffed in their pants"#  once this occurs the user will have a number of seconds to diffuse the bomb.#  Diffusing the bomb is done by typing:#    cutwire &lt;color&gt;#  The wire colors you can choose from are displayed when the bomb is planted.#  This script will not allow bots (Users who are +b), or the bot running the#  script, to be timebombed.##  I know it sounds very silly but it is a rather fun game.################################################################################bind  pub   -   timebomb  doTimebombbind  pub   -   cutwire   doCutWire################################################################################ Configuration#set gTimebombMinimumDuration 20set gTimebombMaximumDuration 60set gWireChoices "Red Orange Yellow Green Blue Indigo Violet Black White Grey Brown Pink Mauve Beige Aquamarine Chartreuse Bisque Crimson Fuchsia Gold Ivory Khaki Lavender Lime Magenta Maroon Navy Olive Plum Silver Tan Teal Turquoise"set gMaxWireCount 6################################################################################ Internal Globals#set gTheScriptVersion "0.4"set gTimebombActive 0set gTimerId 0set gTimebombTarget ""set gTimebombChannel ""set gCorrectWire ""set gNumberNames "zero one two three four five six seven eight nine ten eleven twelve"###############################################################################proc note {msg} {  putlog "% $msg"}proc IRCKick {theNick theChannel theReason} {  note "Kicking $theNick in $theChannel (Reason: $theReason)"  putserv "KICK $theChannel $theNick :$theReason"}proc IRCPrivMSG {theTarget messageString} {  putserv "PRIVMSG $theTarget :$messageString"}proc IRCAction {theTarget messageString} {  putserv "PRIVMSG $theTarget :\001ACTION $messageString\001"}proc MakeEnglishList {theList} {  set theListLength [llength $theList]  set returnString [lindex $theList 0]  for {set x 1} {$x &lt; $theListLength} {incr x} {    if { $x == [expr $theListLength - 1] } {      set returnString "$returnString and [lindex $theList $x]"    } else {      set returnString "$returnString, [lindex $theList $x]"    }  }  return $returnString}proc SelectWires {wireCount} {  global gWireChoices  set totalWireCount [llength $gWireChoices]  set selectedWires ""  for {set x 0} {$x &lt; $wireCount} {incr x} {    set currentWire [lindex $gWireChoices [expr int( rand() * $totalWireCount )]]    if { [lsearch $selectedWires $currentWire] == -1 } {      lappend selectedWires $currentWire    } else {      set x [expr $x - 1]    }  }  return $selectedWires}proc DetonateTimebomb {destroyTimer kickMessage} {  global gTimebombTarget gTimerId gTimebombChannel gTimebombActive  if { $destroyTimer } {    killutimer $gTimerId  }  set gTimerId 0  set gTimebombActive 0  IRCKick $gTimebombTarget $gTimebombChannel $kickMessage}proc DiffuseTimebomb {wireCut} {  global gTimerId gTimebombActive gTimebombTarget gTimebombChannel  killutimer $gTimerId  set gTimerId 0  set gTimebombActive 0  IRCPrivMSG $gTimebombChannel "$gTimebombTarget cut the $wireCut wire.  This has defused the bomb!"}proc StartTimeBomb {theStarter theNick theChannel} {  global gTimebombActive gTimebombTarget gTimerId gTimebombChannel gNumberNames gCorrectWire  global gMaxWireCount gTimebombMinimumDuration gTimebombMaximumDuration  if { $gTimebombActive == 1 } {    note "Timebomb not started for $theStarter (Reason: timebomb already active)"    if { $theChannel != $gTimebombChannel } {      IRCPrivMSG $theChannel "I don't have a single bomb to spare. :-("    } else {      IRCAction $theChannel "points at the bulge in the back of $gTimebombTarget's pants."    }  } else {    set timerDuration [expr $gTimebombMinimumDuration + [expr int(rand() * ($gTimebombMaximumDuration - $gTimebombMinimumDuration))]]    set gTimebombTarget $theNick    set gTimebombChannel $theChannel    set numberOfWires [expr 1 + int(rand() * ( $gMaxWireCount - 0 ))]    set listOfWires [SelectWires $numberOfWires]    set gCorrectWire [lindex $listOfWires [expr int( rand() * $numberOfWires )]]    set wireListAsEnglish [MakeEnglishList $listOfWires]    set wireCountAsEnglish [lindex $gNumberNames $numberOfWires]    IRCAction $theChannel "stuffs the bomb into $gTimebombTarget's pants.  The display reads \[\002$timerDuration\002\] seconds."    if { $numberOfWires == 1 } {      IRCPrivMSG $theChannel "Diffuse the bomb by cutting the correct wire. There is $wireCountAsEnglish wire. It is $wireListAsEnglish."    } else {      IRCPrivMSG $theChannel "Diffuse the bomb by cutting the correct wire. There are $wireCountAsEnglish wires. They are $wireListAsEnglish."    }    note "Timebomb started by $theStarter (Bomb handed to $theNick it will detonate in $timerDuration seconds)"    set gTimebombActive 1    set gTimerId [utimer $timerDuration "DetonateTimebomb 0 {\002*BOOM!*\002}"]  }}################################################################################ Eggdrop command binds#proc doCutWire {nick uhost hand chan arg} {  global gTimebombActive gCorrectWire gTimebombTarget  if { $gTimebombActive == 1 } {    if { [string tolower $nick] == [string tolower $gTimebombTarget] } {      if { [llength $arg] == 1 } {        if { [string tolower $arg] == [string tolower $gCorrectWire] } {          DiffuseTimebomb $gCorrectWire        } else {          DetonateTimebomb 1 "\002snip...*BOOM!*\002"        }      }    }  }}proc doTimebomb {nick uhost hand chan arg} {  global botnick  set theNick $nick  if { [llength $arg] == 1 } {    set theNick [lindex [split $arg] 0]  }  if { [string tolower $theNick] == [string tolower $botnick] } {    set theNick $nick    IRCKick $theNick $chan "I will not tollerate this!"    return  }  if { [validuser $theNick] == 1 } {    if { [matchattr $theNick "+b"] == 1 } {      set theNick $nick      IRCKick $theNick $chan "I will not tollerate that!"      return    }  }  StartTimeBomb $nick $theNick $chan}###############################################################################note "timebomb$gTheScriptVersion: loaded";note " with $gMaxWireCount wire maximum,"note " and time range of $gTimebombMinimumDuration to $gTimebombMaximumDuration seconds.";</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10365">Ikaa</a> — Wed Dec 17, 2008 3:53 pm</p><hr />
]]></content>
	</entry>
	</feed>
