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

	<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>2006-04-15T09:43:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Ni0]]></name></author>
		<updated>2006-04-15T09:43:28-04:00</updated>

		<published>2006-04-15T09:43:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61958#p61958</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61958#p61958"/>
		<title type="html"><![CDATA[Help op script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61958#p61958"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>################################################################### Operator Status v0.4:###  Allows Operators to set themself to away or available,###  users can simply type !status (or a custom command) and###  they will get the status for the operators currently on###  the channel. All works with public commands.######  Written by [ThEdGE] by the idea of [bi0h4z4rd].###### Install: add "source scripts/OPs.tcl" to your eggdrop.conf,###          and configure the options below!.################################################################### Options### Channel where the script will function.set channel "#Chan"### AutoAway feature, when a op is idle for X mins set automaticly away.### Then when he says something when hes away, hes put back to active again.### Default: 30 mins (set to "0" to disable)set awaymins "30" ### Command that people will have to type to get the status of all ops.### Default: !statusset cmd1 "!status"### Command that ops will have to type to set themselfs on Available.### Default: !onset cmd2 "!on"### Command that ops will have to type to set themselfs on Away.### Default: !offset cmd3 "!off"### Small tag that will be shown in the text the bot will msg.### Default: [OPs]set systag "\037\[\037\002OPs\002\037\]\037"### Nickname(s) to ignore, usually bots.set ignorednicks { "ChanServ""X" "Y" }### Shows a extra line when !status is triggered for the ignored nicks,### use this when you added bots to it, it will show a line like:### Bots on this channel: &lt;nicknames&gt;, just for information to the users.### Default: "0", set "1" to enable.set showbots "1"### Enable logging, when enabled it will log events like when op put himself on### away or active, and when someone requests a status in the eggdrop log.### Default: "1", use 0 to disable.set logging "1"### Path and filename of the Plain text database### Default: scripts/OPs.dataset dbpath "scripts/OPs.data"### Dont touch the code below, or it will fux0r :)##########################################################################################################################bind PUB - $cmd1 cmd1bind PUB - $cmd2 cmd2bind PUB - $cmd3 cmd3bind time - "?? * * * *" checkidleops### Procedure which will check if the ops are idle or not.###################################################################################proc checkidleops {minute hour day month year} { global channel systag ignorednicks showbots dbpath awaymins ### Check if autoaway is disabled. if {$awaymins == "0"} { return } ### Check if database file exists, make one if needed. if {[catch { open $dbpath r } error]} {   set dbnew [open $dbpath w]  fconfigure $dbnew -blocking 0  close $dbnew } ### Create the channel op list, and remove ignorednicks set oplist [list] foreach nickn [chanlist $channel] {  if {[isop $nickn $channel]} {    set ignore "0"   foreach inick $ignorednicks {    set nickn2 $nickn    set nickn2 [string tolower $nickn2]    set inick [string tolower $inick]    if {$nickn2 == $inick} {     set ignore "1"    }   }   if {$ignore == "0"} {    set oplist [linsert $oplist end $nickn]   }  }  #close oplist if } # Close oplist foreach ### Read in database. set db [open $dbpath r] fconfigure $db -blocking 0 set nicklist [list]  while {![eof $db]} {   set line [gets $db]   if {$line != ""} {    set nicklist [linsert $nicklist end $line]   }  }  close $db  ### Check if ops are idle and check if they are already away or not.  set db [open $dbpath w]   fconfigure $db -blocking 0   foreach op $oplist {    set ndupe "0"    set idle [getchanidle $op $channel]     if {$idle &gt; "$awaymins"} {      foreach nickn $nicklist {       if {$nickn == $op} {        set ndupe "1"        puts $db "$nickn"       }      }     }    ### Op has been idle, set away.    if {$ndupe == "0" &amp;&amp; $idle &gt; "$awaymins"} {     puts $db "$op"     putserv "NOTICE $op : $systag You have been idle for more then $awaymins mins on $channel you are now set on : \002Away\002"     log " $op has been put on away (autoaway)"    }   }  close $db}# end proc### Procedure which will echo the user the information about ops away or active.###################################################################################proc cmd1 { nick uhost handle chan arg} { global channel systag ignorednicks showbots dbpath log "$nick requested the operater status" ### Check if this is the right channel to function on.  set chan [string tolower $chan]  set channel [string tolower $channel]  if {$chan != $channel} { return } ### Check if database file exists, make one if needed. if {[catch { open $dbpath r } error]} {   set dbnew [open $dbpath w]  fconfigure $dbnew -blocking 0  close $dbnew } ### Open away database for reading. set db [open $dbpath r] fconfigure $db -blocking 0 ### Create various lists used in the script. set nicklist [list] set oplist [list] set tempawaylist [list] set awaylist [list] set activelist [list] ### Read database and insert everything in a temp awaylist. while {![eof $db]} {  set line [gets $db]   if {$line != ""} {    set tempawaylist [linsert $tempawaylist end $line]   }  }  close $db ### Validate awaylist by checking if the users are in the chan and opped. foreach nickn $tempawaylist {  if {[isop $nickn $chan]} {    set awaylist [linsert $awaylist end $nickn]  } } ### Create the channel op list, and remove ignorednicks foreach nickn [chanlist $chan] {  if {[isop $nickn $chan]} {    set ignore "0"   foreach inick $ignorednicks {    set nickn2 $nickn    set nickn2 [string tolower $nickn2]    set inick [string tolower $inick]    if {$nickn2 == $inick} {     set ignore "1"    }   }   if {$ignore == "0"} {    set oplist [linsert $oplist end $nickn]   }  }  #close oplist if } # Close oplist foreach ### Extract the active people from the OP list. foreach nicko $oplist {  set away 0  foreach nicka $awaylist {   if {$nicko == $nicka} {     set away 1   }  }  if {$away == 0} {   set activelist [linsert $activelist end $nicko]  } } ### Format a row of nicks who are active. set activenicks "" foreach nickn $activelist {  if {$activenicks == ""} {   set activenicks "$nickn"  } else {   set activenicks "$activenicks, $nickn"  } } ### Format a row of nicks who are away. set awaynicks "" foreach nicka $awaylist {  if {$awaynicks == ""} {   set awaynicks "$nicka"  } else {   set awaynicks "$awaynicks, $nicka"  } } ### Echo the user the result of the active operators. if {$activenicks != ""} {  putserv "NOTICE $nick : $systag Operators who are Available : $activenicks" } else {  putserv "NOTICE $nick : $systag There are no Operators Available at this time" } ### Echo the user the result of the away operators. if {$awaynicks != ""} {  putserv "NOTICE $nick : $systag Operators who are Away : $awaynicks" } else {  putserv "NOTICE $nick : $systag There are no Operators Away at this time" } ### Echo the user the bot info if enabled.if {$showbots == "1"} { set bots "" foreach bot $ignorednicks {  if {[isop $bot $chan]} {    if {$bots == ""} {    set bots "$bot"   } else {    set bots "$bots, $bot"   }  } } if {$bots != ""} {  putserv "NOTICE $nick : $systag Bots on this channel are : $bots" } else {  putserv "NOTICE $nick : $systag There are no Bots in this channel at this time." }}}# close proc### Procedure which will put a Op on active###################################################################################proc cmd2 { nick uhost handle chan arg} {global systag channel dbpath ### Check if this is the right channel to function on.  set chan [string tolower $chan]  set channel [string tolower $channel]  if {$chan != $channel} { return } ### Read in database set db [open $dbpath r] fconfigure $db -blocking 0 set nicklist [list]  while {![eof $db]} {   set line [gets $db]   if {$line != ""} {    set nicklist [linsert $nicklist end $line]   }  }  close $db ### Update database and echo result. set db [open $dbpath w] fconfigure $db -blocking 0  foreach nickn $nicklist {   if {$nickn != $nick} {    puts $db "$nickn"   }  } close $db   putserv "NOTICE $nick : $systag You are now set to : \002Available\002"   log " $nick has put him/herself on Available."}### Procedure which will put a Op on away###################################################################################proc cmd3 { nick uhost handle chan arg} {global systag channel dbpath ### Check if this is the right channel to function on.  set chan [string tolower $chan]  set channel [string tolower $channel]  if {$chan != $channel} { return } ### Read in database. set newnick "0" set db [open $dbpath r] fconfigure $db -blocking 0 set nicklist [list]  while {![eof $db]} {   set line [gets $db]   if {$line != ""} {    set nicklist [linsert $nicklist end $line]   }  }  close $db ### Write new database and echo the result set db [open $dbpath w] fconfigure $db -blocking 0  foreach nickn $nicklist {   if {$nickn == $nick} {     set newnick "1"     puts $db "$nick"   } else {     puts $db "$nickn"   }  }  if {$newnick == "0"} {   puts $db "$nick"   putserv "NOTICE $nick : $systag You are now set to : \002Away\002"   log " $nick has put him/herself on Away."  } else {   putserv "NOTICE $nick : $systag You are already set to : \002Away\002"  } close $db}proc log {text} {global logging if {$logging == "1" &amp;&amp; $text != ""} {  putlog "\[OPs\] $text" }}putlog "Operator Status v0.4 Loaded!"### EOF### OPs (c) ThEdGE [www.thedge.de]</code></pre></div>This is the Operator script and the error is:<br><br>[02:55] @#help (+stn) : [m/7 o/7 h/0 v/0 n/0 b/0 e/- I/-]<br>[02:56] Tcl error [checkidleops]: couldn't open "scripts/OPs.data": too many open files<br>[03:00] Last message repeated 4 time(s).<br>[03:00] @#help (+stn) : [m/7 o/7 h/0 v/0 n/0 b/0 e/- I/-]<br>[03:00] ERROR writing user file.<br>[03:00] Switching logfiles...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7096">Ni0</a> — Sat Apr 15, 2006 9:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-04-14T21:56:54-04:00</updated>

		<published>2006-04-14T21:56:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61931#p61931</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61931#p61931"/>
		<title type="html"><![CDATA[Help op script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61931#p61931"><![CDATA[
more hints:<br><br>3) post the source; very few people would bother to download and inspect code; if we can have a glimpse at the source, it's more likely someone will be willing to help you<br>4) read the top sticky post, if you haven't done so already<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Fri Apr 14, 2006 9:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2006-04-14T13:33:36-04:00</updated>

		<published>2006-04-14T13:33:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61890#p61890</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61890#p61890"/>
		<title type="html"><![CDATA[wrong forum]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61890#p61890"><![CDATA[
1) when asking for help with a script, post the script using the 'code' tags<br>2) ask for help in 'Scripting Help'. not 'Script Requests'<br><br>moderators: this belongs in 'Scripting Help'<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri Apr 14, 2006 1:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ni0]]></name></author>
		<updated>2006-04-14T12:30:12-04:00</updated>

		<published>2006-04-14T12:30:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61887#p61887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61887#p61887"/>
		<title type="html"><![CDATA[Help op script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61887#p61887"><![CDATA[
Hello i am using this script on a help channel for users to see active operators<br>#############################################################<br>###<br>### Operator Status v0.4:<br>###  Allows Operators to set themself to away or available,<br>###  users can simply type !status (or a custom command) and<br>###  they will get the status for the operators currently on<br>###  the channel. All works with public commands.<br>###<br>###  Written by [ThEdGE] by the idea of [bi0h4z4rd].<br>###<br>### Install: add "source scripts/OPs.tcl" to your eggdrop.conf,<br>###          and configure the options below!.<br>###<br>#############################################################<br><br><br><br>But i have some problems when two three ppl type !status the eggdrop crash i recieve a message in the log file<br>to many open files<br>eggdrop conf not found anyone can help? <a href="http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&amp;id=718" class="postlink">http://www.egghelp.org/cgi-bin/tcl_arch ... oad&amp;id=718</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7096">Ni0</a> — Fri Apr 14, 2006 12:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
