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

	<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>2009-02-24T13:37:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2009-02-24T13:37:14-04:00</updated>

		<published>2009-02-24T13:37:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87536#p87536</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87536#p87536"/>
		<title type="html"><![CDATA[add text timer + remove]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87536#p87536"><![CDATA[
I'm still working on this, but as it dose what its ment to. I felt like posting it, see if anyone else gives any input on it or not maybe <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_idea.gif" width="15" height="15" alt=":idea:" title="Idea"><br><br>The commands are as above, just type them in the channel once the script is loaded for the full syntax. <div class="codebox"><p>Code: </p><pre><code>## upload the 'pda.tcl' to your shell in the 'scripts/' directory of your eggdrop# load the script by adding 'source scripts/pda.tcl' to eggdrop's config file# .rehash the eggdrop# and type '!addtext' in the (public) channel where the eggdrop is###proc pda {what} { global pda pdacount switch -- [string tolower [lindex [split $what] 0]] {  "get_id" {            set string [join [lrange [split $what] 1 end]]            foreach ids [array names pda] {             set tt [join [lrange [split $pda($ids) ","] 3 end]]             if {[string match -nocase "$tt" "$string"]} {              return $ids             }            }           }  "valid_id" {return [info exists pda([lindex [split $what] 1])]}  "kill_id" {             set pid [lindex [split $what] 1]             if {[info exists pda($pid)]} {              unset pda($pid)              pda_killtimers -matching "*$pid*"              return 1             } else {              return 0             }            }  "display_id" {                set did [lindex [split $what] 1]                if {[info exists pda($did)]} {                 set chan [join [lrange [split $pda($did) ","] 1 1]]                 set rest [join [lrange [split $pda($did) ","] 3 end]]                 puthelp "PRIVMSG $chan :$rest"                 unset pda($did)                 return                } else {                 error "PDA: \"$did\" is not a valid ID"                }               }  "current_id" {                if {![info exists pdacount(current)]} {                 set pdacount(current) 1                 return $pdacount(current)                } else {                 set pdacount(current) [expr {$pdacount(current)+1}]                 return $pdacount(current)                }               }  default {error "should be: pda \[what\]"} }}proc pda_killtimers {type {args ""}} { global pda switch -- [string tolower $type] {  "-matching" {               if {$args != ""} {                foreach t [timers] {                 set sc [lindex $t 1]                 if {[string match -nocase "*$sc*" "$args"]} {                  killtimer [lindex $t 2]                 }                }; return 1               } else {                return 0               }              }  "-all" {          foreach t [timers] {           set ss [lindex $t 1]           if {[string match -nocase "*pda*" "$ss"]} {            killtimer [lindex $t 2]           }          }         }  default {           error "invalid type: should be: pda_killters ?-all? ?-matching? ?string?"          } }}proc addtext:pub {nick uhost hand chan text} { global pda  if {[isop $nick $chan]} {   if {[llength [lindex [split $text] 0]] == 0} {    puthelp "NOTICE $nick :\002Usage\002: !addtext \[Text\] \[Time\]"    return 0   }   if {![regexp -- {^([0-9]*[dhm])([0-9]*[dhm])?([0-9]*[dhm])?$} "[join [lrange [split $text] end end]]"]} {    puthelp "NOTICE $nick :\002Error\002: No Time Given/Invaild Time"    return 0   }   set t_note [join [lrange [split $text] 0 end-1]]   set t_time [join [lrange [split $text] end end]]   set e $t_time   if {($e == "") || ($e == 0)} {    puthelp "NOTICE $nick :\002Error\002: Time to low or invalid."    return 0   }   if {![regexp -- {([0-9]*)m} "$e" -&gt; min]  || ($min == "")}  {set min  0}   if {![regexp -- {([0-9]*)h} "$e" -&gt; hour] || ($hour == "")} {set hour 0}   if {![regexp -- {([0-9]*)d} "$e" -&gt; day]  || ($day == "")}  {set day  0}    set t_hours [expr ($min*60)+($hour*3600)+($day*86400)]    set t_mins [expr {$t_hours/60}]   if {$t_mins&gt;0} {    set t_ts [clock scan "$t_mins min"]    set id [pda current_id]    set pda($id) "$nick,$chan,$t_ts,$t_note"    timer $t_mins [list pda "display_id $id"]    puthelp "NOTICE $nick :Thank You, '$t_note' has been added."    return 1   } else {    puthelp "NOTICE $nick :\002Error\002: Time to lower"    return 0   }  }}proc text:pub {nick uhost hand chan text} { global pda  if {[llength [array names pda]] == 0} {   puthelp "PRIVMSG $chan :\002No Text's\002"   puthelp "PRIVMSG $chan :Please add one by typing \002!addtext &lt;text&gt; &lt;time&gt;\002  (Ops Only!)"   return 1  } else {   set m [llength [array names pda]]   set c 0   while {$c != $m} {    set id [lindex [array names pda] $c]    set t_by [lindex [split $pda($id) ","] 0]    set t_ch [lindex [split $pda($id) ","] 1]    set t_ts [lindex [split $pda($id) ","] 2]    set t_note [join [lrange [split $pda($id) ","] 3 end]]    puthelp "PRIVMSG $chan :\002$t_note\002 Added By $t_by@$t_ch [duration [expr { $t_ts - [clock seconds]}]] ago. (#ID:$id)"    set c [expr {$c+1}]   }   return 1  }}proc deltext:pub {nick uhost hand chan text} { global pda  set string [lindex [split $text] 0]  if {$string == ""} {   puthelp "NOTICE $nick :USage: !deltext &lt;id | *string*&gt;"   return 0  }  if {[regexp {^[0-9]} "$string"]} {   set gid $string   if {[pda "valid_id $gid"]} {    if {[pda "kill_id $gid"]} {     puthelp "NOTICE $nick :Removed '$gid'"     return 1    } else {     puthelp "NOTICE $nick :Failed (unable to remove '$gid')"     return 0    }   } else {    puthelp "NOTICE $nick :unable to find '$gid' --it may be invalid"    return 0   }  } else {   set gid [pda "get_id $string"]   if {[pda "valid_id $gid"]} {    if {[pda "kill_id $gid"]} {     puthelp "NOTICE $nick :Removed '$string' ($gid)"     return 1    } else {     puthelp "NOTICE $nick :Failed (unable to remove '$string')"     return 0    }   } else {    puthelp "NOTICE $nick :unable to find '$string' --it may be invalid"    return 0   }  }}bind pub o !addtext addtext:pubbind pub n !deltext deltext:pubbind pub - !text text:pubputlog "loaded pda.tcl version 2.6(alpha) by TCL_no_TK"return</code></pre></div> I've got it working without any errors that would cause problems for the bot, or prevent the scrip from working. If you get an error thats not in the script, let me know and i'll try and fix it. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_arrow.gif" width="15" height="15" alt=":arrow:" title="Arrow"> Thanks to MC_8 for the "time" code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Tue Feb 24, 2009 1:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spijon]]></name></author>
		<updated>2009-01-01T16:16:30-04:00</updated>

		<published>2009-01-01T16:16:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86648#p86648</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86648#p86648"/>
		<title type="html"><![CDATA[add text timer + remove]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86648#p86648"><![CDATA[
Hey and happy new-year <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I'm looking for a script that user can add a text and + timer and remove when timer ends.<br><br>@user :!addtext tralalala 1h<br>@user2 :!addtext tralalala2 1h<br>@user3 :!text<br>@bot :tralala addet by user (59min ago)<br>@bot :tralala2 addet by user2 (59min ago)<br><br>and an admin cmd<br><br>@admin :!deltext tralala <br><br>Been looking around in the forum but couldn't find anything.<br><br>Best regards<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8142">spijon</a> — Thu Jan 01, 2009 4:16 pm</p><hr />
]]></content>
	</entry>
	</feed>
