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

	<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>2005-05-09T16:22:59-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-09T16:22:59-04:00</updated>

		<published>2005-05-09T16:22:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49276#p49276</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49276#p49276"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49276#p49276"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>setudef flag badword setudef flag antiadver bind PUB m|m !antiadver adver:switch bind PUB m|m !badword badword:switch bind PUBM - * badwordbind PUBM - * advertiseproc adver:switch {nick host hand chan text} {  set option [lindex [split $text] 0]  switch -- $option {   "on" {   channel set $chan +antiadver     puthelp "NOTICE $nick : Anti-advertise is 9ON9"   }  "off" {    channel set $chan -antiadver   puthelp "NOTICE $nick : Anti-advertise is 4OFF4"   } } } proc badword:switch {nick host hand chan text} {  set option [lindex [split $text] 0]  switch -- $option {   "on" {   channel set $chan +badword   puthelp "NOTICE $nick : Anti-Badword is 9ON9"  }  "off" {   channel set $chan -badword   puthelp "NOTICE $nick : Anti-Badword is 4OFF4"   } } } proc badword {nick uhost handle channel arg} {  global botnick globalbantime badwordmsg  if {[channel get $channel badword]} {   if {![botisop $channel] || [isop $nick $chann]} {return 0}   putserv "MODE $channel +b *!$uhost"   putserv "KICK $channel $nick :$badwordbanmsg"   timer $globalbantime [list putserv "MODE $channel -b *!$uhost"]  } } proc advertise {nick uhost handle channel arg} {  global globalbantime advermsg  if {[channel get $channel antiadver]} {   if {![botisop $channel] || [isop $nick $channe;]} {return 0}   putserv "MODE $channel +b *!$uhost"   putserv "KICK $channel $nick : $advermsg"   timer $globalbantime [list putserv "MODE $channel -b *!$uhost"]  } }</code></pre></div>!antiadver on/off to switch on/off<br>!badwordon/off to swtich on/off<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon May 09, 2005 4:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-05-09T14:17:40-04:00</updated>

		<published>2005-05-09T14:17:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49264#p49264</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49264#p49264"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49264#p49264"><![CDATA[
know if have this<br><br>i have editted it al, butt it aint responding when i typ <br><div class="codebox"><p>Code: </p><pre><code>setudef flag badwordsetudef flag antiadverbind PUB m|m !antiadver adver:switchbind PUB m|m !badword badword:switchproc adver:switch {nick host hand chan text} {   set option [lindex [split $text] 0]   switch $option {      on { channel set $chan +antiadver }      puthelp "NOTICE $nick : Anti-advertise is 9ON9"      off { channel set $chan -antiadver }      puthelp "NOTICE $nick : Anti-advertise is 4OFF4"   }}proc badword:switch {nick host hand chan text} {   set option [lindex [split $text] 0]   switch $option {      on { channel set $chan +badword }      puthelp "NOTICE $nick : Anti-Badword is 9ON9"      off { channel set $chan -badword }      puthelp "NOTICE $nick : Anti-Badword is 4OFF4"   }}proc badword {nick uhost handle channel arg} {   global botnick globalbantime badwordmsg   foreach i [channel info $chan] {      if {[channel get $i badword]} {         if {![isop $botnick $channel]} {return 0}         if {[isop $nick $channel]} {return 0}         putserv "MODE $channel +b *!$uhost"         putserv "KICK $channel $nick :$badwordbanmsg"         timer $globalbantime [subst {putserv "MODE $channel -b *!$uhost"}]      }   }}proc advertise {nick uhost handle channel arg} {   global botnick globalbantime advermsg   foreach i [channel info $chan] {      if {[channel get $i antiadver]} {         if {![isop $botnick $channel]} {return 0}         if {[isop $nick $channel]} {return 0}         putserv "MODE $channel +b *!$uhost"         putserv "KICK $channel $nick : $advermsg"         timer $globalbantime [subst {putserv "MODE $channel -b *!$uhost"}]      }   }}</code></pre></div>plz some advice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Mon May 09, 2005 2:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2005-05-09T01:32:45-04:00</updated>

		<published>2005-05-09T01:32:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49238#p49238</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49238#p49238"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49238#p49238"><![CDATA[
Yup, That would seem alot smarter.<br><div class="codebox"><p>Code: </p><pre><code>setudef flag badwordsetudef flag antiadverbind PUB m|m !antiadver adver:switchbind PUB m|m !badword  badword:switchproc adver:switch {nick host hand chan text} { set option [lindex [split $text] 0] switch $option {   on { channel set $chan +antiadver }   off { channel set $chan -antiadver }  default { putserv "PRIVMSG $chan :Please choose on or off." }  }}proc badword:switch {nick host hand chan text} { set option [lindex [split $text] 0] switch $option {   on { channel set $chan +badword }   off { channel set $chan -badword }  default { putserv "PRIVMSG $chan :Please choose on or off." }  }}</code></pre></div>Note, This is just a simple example <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=5078">metroid</a> — Mon May 09, 2005 1:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-05-07T14:47:21-04:00</updated>

		<published>2005-05-07T14:47:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49173#p49173</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49173#p49173"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49173#p49173"><![CDATA[
I would use<div class="codebox"><p>Code: </p><pre><code>if {[channel get $i badword]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat May 07, 2005 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-05-07T13:28:17-04:00</updated>

		<published>2005-05-07T13:28:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49169#p49169</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49169#p49169"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49169#p49169"><![CDATA[
you mean like this <br><div class="codebox"><p>Code: </p><pre><code>setudef flag badwordproc badword {nick uhost handle channel arg} { global botnick globalbantime badwordbanmsg activechansforeach i [channel info $chan] {if ([string match "+badword" $i])} {if {![isop $botnick $channel]} {return 0} if {[isop $nick $channel]} {return 0} putserv "MODE $channel +b *!$uhost" putserv "KICK $channel $nick :$badwordbanmsg" timer $globalbantime [subst {putserv "MODE $channel -b *!$uhost"}] } </code></pre></div>like this gb<br><br>so the user can actived it in any channel they want ( .chanset #chan +/-badword] <br><br>sounds good  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sat May 07, 2005 1:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-05-06T19:01:23-04:00</updated>

		<published>2005-05-06T19:01:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49131#p49131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49131#p49131"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49131#p49131"><![CDATA[
a one liner, using a custom channel setting (ie. +/-badword) would also work..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Fri May 06, 2005 7:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ian-Highlander]]></name></author>
		<updated>2005-05-06T12:53:03-04:00</updated>

		<published>2005-05-06T12:53:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49119#p49119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49119#p49119"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49119#p49119"><![CDATA[
I built an on/off switch into my trivia script "Trivia 2000" many years ago that you could easily adapt to do what you want. Here's the snippets of code for the switch ripped direct from my script.<br><div class="codebox"><p>Code: </p><pre><code>bind pub o|o !game game_onoff#Switch game on or off as default (0 for off, 1 for on)set gameonoff 1#Tells the bot wether or not the game is already running, leave set to 0set gameplaying 0#On/off switch (useful if the game is annoying people!) :o)proc game_onoff {nick uhost handle channel args} { global botnick gameonoff gameplaying gamechanif {[string tolower $channel] != [string tolower $gamechan]} {putserv "PRIVMSG $channel :Sorry $nick, \002\Trivia 2000\002 is not running in $channel, try going to $gamechan, its playing there :o)"return}set chan $gamechan  set onoff [string tolower [ string trim [lindex [split $args] 0] "{}" ]]  if {($onoff == "on") &amp;&amp; ($gameonoff == 0)} {   set gameonoff 1    putserv "PRIVMSG $chan :Game is now switched on! Enter !start to play."return}   if {($onoff == "on") &amp;&amp; ($gameonoff != 0)} {    putserv "PRIVMSG $chan :Game is already switched on!"return }  if {($onoff == "off") &amp;&amp; ($gameonoff != 0)} {   set gameonoff 0    set gameplaying 0     kill_timers      putserv "PRIVMSG $chan :Game is now switched off!"return}  if {($onoff == "off") &amp;&amp; ($gameonoff == 0)} {    putserv "PRIVMSG $chan :Game is already switched off!"return}putserv "PRIVMSG $chan :To switch game on or off use !game on/off"return}</code></pre></div>Then at the top of each proc just add these (again edit for your own use).<div class="codebox"><p>Code: </p><pre><code>  if {$gameplaying != 0} {  putserv "PRIVMSG $chan :Game is already running, please either wait for it to finish or enter !stop then !choose again to set category"return}  if {$gameonoff == 0} {  putserv "PRIVMSG $chan :\0034Sorry $nick but the game isn't switched on right now, please try later!"return}</code></pre></div>Hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=17">Ian-Highlander</a> — Fri May 06, 2005 12:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[KevKev]]></name></author>
		<updated>2005-05-04T21:53:27-04:00</updated>

		<published>2005-05-04T21:53:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49024#p49024</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49024#p49024"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49024#p49024"><![CDATA[
Basicly you just need to add a few things.<br><br>First.  Add a variable for each "switch".  i.e. $badword_status and $antiadver_status<br><br>In your procs for these add at the very start a check to see if the switches are turned off.  if the switch is off return from the proc without doing anything.  (optionallly you can add some debugging stuff to putlog on a specific flag that the proc was triggered but tuned off or some such).<br><br>here's an example using your current code.<div class="codebox"><p>Code: </p><pre><code>proc badword {nick uhost handle channel arg} {global botnick globalbantime badwordbanmsg activechans badword_statusif {$badword_status &lt; 1} {return 0}if {[lsearch [string tolower $activechans] [string tolower $channel]] == -1} { return }if {![isop $botnick $channel]} {return 0}if {[isop $nick $channel]} {return 0}putserv "MODE $channel +b *!$uhost"putserv "KICK $channel $nick :$badwordbanmsg"timer $globalbantime [subst {putserv "MODE $channel -b *!$uhost"}]} </code></pre></div>manually set the vars to on and off and make sure things work.<br><br>Now write a simple proc to flip the switches.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3940">KevKev</a> — Wed May 04, 2005 9:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-05-03T13:52:49-04:00</updated>

		<published>2005-05-03T13:52:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48953#p48953</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48953#p48953"/>
		<title type="html"><![CDATA[on/off script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48953#p48953"><![CDATA[
Hello, i have a little question <br><br>i have an antiadverise and an badword script scripted on my own <br><br>i just want a little feature too be build in <br><br>i like too activate one of the features in the script by typing for example <br><br>!badword on/off  <br>!antiadver on/off <br><br>whats the right way too make this ? <br><br>part of the script <br><div class="codebox"><p>Code: </p><pre><code>proc badword {nick uhost handle channel arg} {global botnick globalbantime badwordbanmsg activechansif {[lsearch [string tolower $activechans] [string tolower $channel]] == -1} { return } if {![isop $botnick $channel]} {return 0}if {[isop $nick $channel]} {return 0}putserv "MODE $channel +b *!$uhost"putserv "KICK $channel $nick :$badwordbanmsg"timer $globalbantime [subst {putserv "MODE $channel -b *!$uhost"}]}Plz help me with this, thanks in advance  :D </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Tue May 03, 2005 1:52 pm</p><hr />
]]></content>
	</entry>
	</feed>
