<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.1" -->
<rss version="2.0">
    <channel>
        <title>tclhelp.net News</title>
        <description></description>
        <link>http://tclhelp.net/unb</link>
        <lastBuildDate>Thu, 09 Sep 2010 03:21:30 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.1</generator>
        <item>
            <title>[TCL/TK] Simple font viewer</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=289</link>
            <description><![CDATA[Post:<br />
<a href="forum.php?req=derefer&amp;url=http%3A%2F%2Fgeekosphere.org%2F1399%2F1399%2F" title="http://geekosphere.org/1399/1399/">http://geekosphere.org/1399/1399/</a><br />
<br />
Screenshot:<br />
<a href="forum.php?req=derefer&amp;url=http%3A%2F%2Fgeekosphere.org%2Fwp-content%2F2010-08-23-231903_1680x1050_scrot.png" title="http://geekosphere.org/wp-content/2010-08-23-231903_1680x1050_scrot.png">http://geekosphere.org/wp-cont.../2010-08-23-231903_1680x...</a><br />
<br />
Download:<br />
<a href="forum.php?req=derefer&amp;url=http%3A%2F%2Fsiyb.mount.at%2Fscripts%2Ffontviewer0.2.tcl" title="http://siyb.mount.at/scripts/fontviewer0.2.tcl">http://siyb.mount.at/scripts/fontviewer0.2.tcl</a><br />
<br />
File also attached to post. Please comment if you are satisfied.]]></description>
            <author>SIYB</author>
            <pubDate>Mon, 23 Aug 2010 21:32:23 +0100</pubDate>
            <guid>http://tclhelp.net/unb/289</guid>
        </item>
        <item>
            <title>Advanced Google</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=286</link>
            <description><![CDATA[Loading:<br />
<ul><li>Download the file AdvancedGoogle.tcl<br />
</li><li>Place the file in your eggdrop scripts directory<br />
</li><li>Add this line to eggdrop.conf --&gt;&gt; source scripts/AdvancedGoogle.tcl<br />
</li><li>Rehash or restart your eggdrop<br />
</li><li>(In the console) type .chanset #channelname +google "where #channelname is the channel you want the script on in"</li></ul>Triggers:<br />
<ul><li>!google search words (general searches)<br />
</li><li>!glocal search words (returns results related to a local area search)<br />
</li><li>!gvideo search words (returns video results)<br />
</li><li>!gnews search words (returns news results related you your search words)<br />
</li><li>!gbook search words (returns book results)<br />
</li><li>!gimage search words (returns image/picture results)<br />
</li><li>!gpatent search words (does a search of registered patents)</li></ul>Example Output:<br />
21:02:04 &lt;<span style="color:purple">Ford_Lawnmower&gt; !google eggdrop</span><br />
21:02:06 &lt;<span style="color:green">QuadraZuadra&gt; </span><span style="color:darkblue">g</span><span style="color:red">o</span><span style="color:yellow">o</span><span style="color:dimgray">g</span><span style="color:lime">l</span><span style="color:red">e</span> <span style="color:red">Eggheads.org - Main Index </span> <span style="color:black"><a href="http://www.eggheads.org/">http://www.eggheads.org/</a></span><br />
21:02:07 &lt;<span style="color:green">QuadraZuadra&gt; </span><span style="color:darkblue">g</span><span style="color:red">o</span><span style="color:yellow">o</span><span style="color:dimgray">g</span><span style="color:lime">l</span><span style="color:red">e</span> <span style="color:red">Eggheads.org - Downloads </span> <span style="color:black"><a href="http://www.eggheads.org/downloads/">http://www.eggheads.org/downloads/</a></span><br />
21:02:07 &lt;<span style="color:green">QuadraZuadra&gt; </span><span style="color:darkblue">g</span><span style="color:red">o</span><span style="color:yellow">o</span><span style="color:dimgray">g</span><span style="color:lime">l</span><span style="color:red">e</span> <span style="color:red">slennox''s <b>eggdrop</b> page </span> <span style="color:black"><a href="http://www.egghelp.org/">http://www.egghelp.org/</a></span>]]></description>
            <author>FordLawnmower</author>
            <pubDate>Sat, 29 May 2010 03:21:16 +0100</pubDate>
            <guid>http://tclhelp.net/unb/286</guid>
        </item>
        <item>
            <title>[EGG] Slot Script</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=281</link>
            <description><![CDATA[DELETED]]></description>
            <author>Turbo</author>
            <pubDate>Tue, 27 Oct 2009 17:12:46 +0100</pubDate>
            <guid>http://tclhelp.net/unb/281</guid>
        </item>
        <item>
            <title>Please attach a file to your postings :)</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=272</link>
            <description><![CDATA[no text <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/smile.png" title=":-)" alt=":-)" align="middle" class="smilie" />]]></description>
            <author>CyBex</author>
            <pubDate>Wed, 15 Apr 2009 22:27:36 +0100</pubDate>
            <guid>http://tclhelp.net/unb/272</guid>
        </item>
        <item>
            <title>RSS lib</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=271</link>
            <description><![CDATA[A small script that will help writing applications that need to parse RSS(2.0) feeds. The most important (from my point of view) features of RSS2.0 have been included, please feel free to enhance the script and share your results if you feel that they are useful.<br />
<br />
There is a small demo at the end of the script, it should cover the usage, don't forget to free the mallocs :&gt;. Any questions? -&gt; email / irc / thread<br />
<br />
<br />
[code]<br />
<ol>
<li>Copyright (c) 2009 siyb &lt;siyb |insert "you know what here"| geekosphere.org&gt;<br /></li>
</ol>
#<br />
<ol>
<li>This software is provided 'as-is', without any express or implied<br /></li>
<li>warranty. In no event will the authors be held liable for any damages<br /></li>
<li>arising from the use of this software.<br /></li>
</ol>
#<br />
<ol>
<li>Permission is granted to anyone to use this software for any purpose,<br /></li>
<li>including commercial applications, and to alter it and redistribute it<br /></li>
<li>freely, subject to the following restrictions:<br /></li>
</ol>
#<br />
<ol>
<li>&nbsp;&nbsp; 1. The origin of this software must not be misrepresented; you must not<br /></li>
<li>&nbsp;&nbsp; claim that you wrote the original software. If you use this software<br /></li>
<li>&nbsp;&nbsp; in a product, an acknowledgment in the product documentation would be<br /></li>
<li>&nbsp;&nbsp; appreciated but is not required.<br /></li>
</ol>
#<br />
<ol>
<li>&nbsp;&nbsp; 2. Altered source versions must be plainly marked as such, and must not be<br /></li>
<li>&nbsp;&nbsp; misrepresented as being the original software.<br /></li>
</ol>
#<br />
<ol>
<li>&nbsp;&nbsp; 3. This notice may not be removed or altered from any source<br /></li>
<li>&nbsp;&nbsp; distribution.<br /></li>
</ol>
<br />
<br />
package require tdom<br />
<br />
namespace eval feedRead {<br />
&nbsp;&nbsp;&nbsp; variable idPrefix "feedread";# the prefix to be used for feeds<br />
&nbsp;&nbsp;&nbsp; variable formats [list rss]<br />
&nbsp;&nbsp;&nbsp; variable tmpId;# stores the id temporarily (when a feed is added -&gt; upvaring)<br />
&nbsp;&nbsp;&nbsp; variable feedId 0;# the id counter<br />
&nbsp;&nbsp;&nbsp; variable feedList <span class="eop">[list]</span>;# list containing all feedids and the corresponding data<br />
&nbsp;&nbsp;&nbsp; namespace eval handle {}<br />
}<br />
<br />
#<br />
<ol>
<li>Enduser relevant<br /></li>
</ol>
#<br />
<br />
<ol>
<li>Creates a feed<br /></li>
</ol>
proc feedRead::create {xmlData id} {<br />
&nbsp;&nbsp;&nbsp; upvar 1 $id rid<br />
&nbsp;&nbsp;&nbsp; # create domtree for the feed<br />
&nbsp;&nbsp;&nbsp; set doc [dom parse -keepEmpties $xmlData]<br />
&nbsp;&nbsp;&nbsp; set rid [feedRead::addFeed $doc];# add feed to feedlist and return the id<br />
}<br />
<br />
<ol>
<li>return the feedlist of all feeds currently active<br /></li>
</ol>
proc feedRead::getFeedList {} {<br />
&nbsp;&nbsp;&nbsp; return $feedRead::feedList<br />
}<br />
<br />
<ol>
<li>clean up (destroy) all feeds<br /></li>
</ol>
proc feedRead::destroyAll {} {<br />
&nbsp;&nbsp;&nbsp; foreach item [feedRead::feedList] {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; feedRead::destroy [lindex $item 0]<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
#<br />
<ol>
<li>Lib<br /></li>
</ol>
#<br />
<br />
<ol>
<li>deletes a feed from the list and gets rid of all traces<br /></li>
</ol>
proc feedRead::destroy {id} {<br />
&nbsp;&nbsp;&nbsp; set doc [$id infoDoc];# get the document<br />
&nbsp;&nbsp;&nbsp; rename $id "";# delete the feed's procedure<br />
&nbsp;&nbsp;&nbsp; set search [feedRead::findFeed $id]<br />
&nbsp;&nbsp;&nbsp; set feedRead::feedList [lreplace $feedRead::feedList $search $search]<br />
&nbsp;&nbsp;&nbsp; $doc delete<br />
}<br />
<br />
<ol>
<li>checks if a format is known to the script<br /></li>
</ol>
proc feedRead::checkFormat {format} {<br />
&nbsp;&nbsp;&nbsp; return [lsearch $feedRead::formats $format]<br />
}<br />
<br />
<ol>
<li>joins prefix and id<br /></li>
</ol>
proc feedRead::joinId {id} {<br />
&nbsp;&nbsp;&nbsp; return [append foo $feedRead::idPrefix $id]<br />
}<br />
<br />
<ol>
<li>Returns a feedread feedid<br /></li>
</ol>
proc feedRead::mkid {} {<br />
&nbsp;&nbsp;&nbsp; set id [feedRead::joinId $feedRead::feedId]<br />
&nbsp;&nbsp;&nbsp; incr feedRead::feedId<br />
&nbsp;&nbsp;&nbsp; return $id<br />
}<br />
<br />
<ol>
<li>find feed in list<br /></li>
</ol>
proc feedRead::findFeed {id} {<br />
&nbsp;&nbsp;&nbsp; return [lsearch -index 0 $feedRead::feedList $id]<br />
}<br />
<br />
<ol>
<li>replace feed in feedlist<br /></li>
</ol>
proc feedRead::feedReplace {id replaceWith} {<br />
&nbsp;&nbsp;&nbsp; set search [feedRead::findFeed $id]<br />
&nbsp;&nbsp;&nbsp; set feedRead::feedList [lreplace $feedRead::feedList $search $search $replaceWith]<br />
}<br />
<br />
<ol>
<li>find and return feed from list<br /></li>
</ol>
proc feedRead::returnFeed {id} {<br />
&nbsp;&nbsp;&nbsp; return [lindex $feedRead::feedList [feedRead::findFeed $id]]<br />
}<br />
<br />
<ol>
<li>determine the feed type<br /></li>
</ol>
proc feedRead::determineType {rootNode} {<br />
&nbsp;&nbsp;&nbsp; return [$rootNode nodeName]<br />
}<br />
<br />
<ol>
<li>count the number of &lt;item&gt; of a feed<br /></li>
</ol>
proc feedRead::countItems {id} {<br />
&nbsp;&nbsp;&nbsp; return [llength [lindex [feedRead::returnFeed $id] end]]<br />
}<br />
<br />
<ol>
<li>returns an &lt;item&gt; by its place in the itemlist of the feed<br /></li>
</ol>
proc feedRead::returnItemById {id iid} {<br />
&nbsp;&nbsp;&nbsp; if {[feedRead::countItems $id] &lt; $iid} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; error "Itemid '$iid' out of range"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; return [lindex [lindex [feedRead::returnFeed $id] end] $iid]<br />
}<br />
<br />
<ol>
<li>adds a feed and the corresponding feed command<br /></li>
</ol>
proc feedRead::addFeed {doc} {<br />
&nbsp;&nbsp;&nbsp; upvar #0 feedRead::tempId id<br />
&nbsp;&nbsp;&nbsp; set id [feedRead::mkid];# create a new id for this feed<br />
&nbsp;&nbsp;&nbsp; set root [$doc documentElement]<br />
&nbsp;&nbsp;&nbsp; set flist [list $id $doc $root [feedRead::determineType $root]]<br />
&nbsp;&nbsp;&nbsp; set feedRead::feedList [lappend feedRead::feedList $flist];# add feed to feedlist<br />
&nbsp;&nbsp;&nbsp; uplevel #0 {;# create the feed command<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; proc $feedRead::tempId {option {iid -1}} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set id [string trim [dict get [info frame 0] proc] ::]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set format [feedRead::getFeedType $id]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[feedRead::checkFormat $format] != -1} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; feedRead::handle::${format} $id $option $iid<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; error "'$format' not supported yet"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; feedRead::feedReplace $id [lappend flist [feedRead::getChannelElement $id item -all]];# add all &lt;item&gt; to the feedlist<br />
&nbsp;&nbsp;&nbsp; return $id<br />
}<br />
<br />
<ol>
<li>rss handler<br /></li>
</ol>
proc feedRead::handle::rss {id option iid} {<br />
&nbsp;&nbsp;&nbsp; switch $option {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "destroy"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::destroy $id] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "infoType"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getFeedType $id] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "infoDoc"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getFeedDoc $id] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "infoRoot"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getFeedRoot $id] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelTitle"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id title] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelLink"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id link] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelDescription"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id description] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelLanguage"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id language] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelCopyright"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id copyright] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelManagingEditor"&nbsp; &nbsp; { return [feedRead::getChannelElement $id managingEditor] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelWebMaster"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id webMaster] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelPubDate"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id pubDate] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelLastBuildDate"&nbsp; &nbsp; { return [feedRead::getChannelElement $id lastBuildDate] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelCategory"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id category] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelGenerator"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id generator] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelDocs"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id docs] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelCloud"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id cloud] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelTtl"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id ttl] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelImage"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id image] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelRating"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id rating] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelTextInput"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id textInput] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelSkipHours"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id skipHours] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelSkipDays"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id skipDays] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelItems"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getChannelElement $id item -all] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelItemLength"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::countItems $id] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemTitle"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid title] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemLink"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid link] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemDescription"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid description] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemAuthor"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid author] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemCategory"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid category] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemComments"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid comments] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemEnclosure"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid enclosure] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemGuid"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid guid] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemPubDate"&nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid pubDate] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemSource"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { return [feedRead::getItemElement $id $iid source] }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; default&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { error "Unknown option ($option)" }<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
#return the feed's type<br />
proc feedRead::getFeedType {id} {<br />
&nbsp;&nbsp;&nbsp; return [lindex [split [feedRead::returnFeed $id]] 3]<br />
}<br />
<br />
<ol>
<li>return the feed's document<br /></li>
</ol>
proc feedRead::getFeedDoc {id} {<br />
&nbsp;&nbsp;&nbsp; return [lindex [split [feedRead::returnFeed $id]] 1]<br />
}<br />
<br />
<ol>
<li>return the feed root<br /></li>
</ol>
proc feedRead::getFeedRoot {id} {<br />
&nbsp;&nbsp;&nbsp; return [lindex [split [feedRead::returnFeed $id]] 2]<br />
}<br />
<br />
<ol>
<li>get channel<br /></li>
</ol>
proc feedRead::getChannel {id} {<br />
&nbsp;&nbsp;&nbsp; set root [feedRead::getFeedRoot $id]<br />
&nbsp;&nbsp;&nbsp; return [$root getElementsByTagName channel]<br />
}<br />
<br />
<ol>
<li>get a channel element<br /></li>
</ol>
proc feedRead::getChannelElement {id chanItem {option -single}} {<br />
&nbsp;&nbsp;&nbsp; set channel [feedRead::getChannel $id]<br />
&nbsp;&nbsp;&nbsp; set ci [$channel getElementsByTagName $chanItem]<br />
&nbsp;&nbsp;&nbsp; switch $option {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "-single"&nbsp; &nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; foreach item $ci {;# loop all titles, if the parentNode of the title matches the channel, return it's text value<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[$item parentNode] == $channel} { return [$item asText] }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "-all"&nbsp; &nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return $ci<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; default&nbsp; &nbsp; { error "bad option \"$option\": must be -all or -single" }<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
<ol>
<li>get an &lt;item&gt; element<br /></li>
</ol>
proc feedRead::getItemElement {id iid itemElement} {<br />
&nbsp;&nbsp;&nbsp; set item [[feedRead::returnItemById $id $iid] getElementsByTagName $itemElement]<br />
&nbsp;&nbsp;&nbsp; if {$item == ""} { return "" }<br />
&nbsp;&nbsp;&nbsp; if {[llength $item] &gt; 1} {;# of there is more than one element by that name<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set rlist <span class="eop">[list]</span><br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; foreach i $item {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set rlist [lappend rlist [$i asText]]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return $rlist<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return [$item asText]<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
#<br />
<ol>
<li>documentation demonstration<br /></li>
</ol>
#<br />
proc feedRead::demo {feed} {<br />
<br />
&nbsp;&nbsp;&nbsp; package require http<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; set token [::http::geturl $feed -timeout 2000]<br />
&nbsp;&nbsp;&nbsp; set data [::http::data $token]<br />
&nbsp;&nbsp;&nbsp; ::http::cleanup $token<br />
<br />
&nbsp;&nbsp;&nbsp; # lets create the feed first, $data is the feed's data<br />
&nbsp;&nbsp;&nbsp; feedRead::create $data id<br />
&nbsp;&nbsp;&nbsp; puts "Feedlist: [feedRead::getFeedList]";# print feedlist<br />
<br />
&nbsp;&nbsp;&nbsp; # some information on the feed<br />
&nbsp;&nbsp;&nbsp; puts "\nfeed information:\n"<br />
&nbsp;&nbsp;&nbsp; puts "&nbsp; &nbsp; [$id infoType]";# the type of the doc<br />
&nbsp;&nbsp;&nbsp; puts "&nbsp; &nbsp; [$id infoDoc]";# the document identifier<br />
&nbsp;&nbsp;&nbsp; puts "&nbsp; &nbsp; [$id infoRoot]";# the root node identifier of the doc<br />
<br />
&nbsp;&nbsp;&nbsp; # channel related information -&gt; [$id getChannelTitle] for instance<br />
&nbsp;&nbsp;&nbsp; set l {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelTitle"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelLink"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelDescription"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelLanguage"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelCopyright"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelManagingEditor"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelWebMaster"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelPubDate"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelLastBuildDate"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelCategory"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelGenerator"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelDocs"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelCloud"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelTtl"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelImage"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelRating"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelTextInput"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelSkipHours"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelSkipDays"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelItems"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelItemLength"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; puts "\nChannel related information:\n"<br />
&nbsp;&nbsp;&nbsp; foreach item $l {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; puts "&nbsp; &nbsp; $item: '[$id $item]'"<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; # item related stuff<br />
&nbsp;&nbsp;&nbsp; puts "\nitem related stuff:\n"<br />
&nbsp;&nbsp;&nbsp; set l {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getChannelItemLength"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemTitle"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemLink"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemDescription"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemAuthor"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemCategory"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemComments"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemGuid"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemPubDate"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "getItemSource"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; foreach item $l {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; puts "&nbsp; &nbsp; $item: '[$id $item 0]'"<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; # now that we are done we need to destroy all data related to the feed in order to prevent memory from going apeshit<br />
&nbsp;&nbsp;&nbsp; $id destroy<br />
}<br />
<br />
[/code]]]></description>
            <author>SIYB</author>
            <pubDate>Wed, 15 Apr 2009 21:09:24 +0100</pubDate>
            <guid>http://tclhelp.net/unb/271</guid>
        </item>
        <item>
            <title>eWebSource.tcl</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=270</link>
            <description><![CDATA[Configure default options reading the header script, it will usefull for you.<br />
You can download and source a file without access shell, any comment, bug, idea or suggestion is welcomed<br />
<br />
[code]<br />
<ol>
<li>eWebSource --<br /></li>
<li>This script downloads and saves a url if it is a tcl file to be loaded<br /></li>
</ol>
<br />
<br />
global eWS<br />
<br />
<ol>
<li>Path where the files will be saved<br /></li>
</ol>
set eWS(scriptdir) "scripts"<br />
<br />
<ol>
<li>Should I add the downloaded file to config file to be loaded when rehash?<br /></li>
<li>(1) Enable (0) Disable<br /></li>
</ol>
set eWS(addsource) 1<br />
<br />
<ol>
<li>Should I load the file after download? (Does not means rehash)<br /></li>
</ol>
set eWS(load) 1<br />
<br />
<ol>
<li>(1) Enable proxy (0) Disable<br /></li>
</ol>
set eWS(dl.useproxy) 0<br />
<br />
<ol>
<li>Timeout in milliseconds<br /></li>
</ol>
set eWS(dl.timeout) "5000"<br />
<br />
<ol>
<li>Proxy:port to connect trought firewall (will be random select)<br /></li>
</ol>
set eWS(dl.proxy) {<br />
&nbsp;&nbsp;&nbsp; 216.194.70.3:8118<br />
&nbsp;&nbsp;&nbsp; 200.209.145.179:3128<br />
&nbsp;&nbsp;&nbsp; 83.17.123.186:8080<br />
&nbsp;&nbsp;&nbsp; 212.93.193.83:8082<br />
&nbsp;&nbsp;&nbsp; 203.162.224.137:80<br />
&nbsp;&nbsp;&nbsp; 203.162.224.139:80<br />
&nbsp;&nbsp;&nbsp; 217.17.248.171:80 <br />
}<br />
<ol>
<li>Default proxy port if not defined. Do not force script to use this, most of<br /></li>
<li>times will not work.<br /></li>
</ol>
set eWS(dl.defaultport) "8080"<br />
<br />
<br />
set eWS(me.name) "eWebSource"<br />
set eWS(me.version) "1.0"<br />
set eWS(me.fileName) [file tail [info script]]<br />
set eWS(me.author) "HackeMate"<br />
set eWS(me.contact) "HackeMate &lt;<a href="mailto:Sentencia@eggdrop.es">Sentencia@eggdrop.es</a>&gt;"<br />
package require http<br />
<br />
setudef flag websource<br />
<br />
bind pub n !websource eWebSource<br />
<br />
proc eWebSource {nick uhost hand chan text} {<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; if {![channel get $chan websource]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putserv "NOTICE $nick :This channel has this script disabled; enable it using .chanset $chan +websource via party line"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; set url [lindex [split $text] 0]<br />
&nbsp;&nbsp;&nbsp; set source [lindex [split $text] 1]<br />
&nbsp;&nbsp;&nbsp; set load [lindex [split $text] 2]<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; # You can use this command directly via tcldebug or .tcl command party line<br />
&nbsp;&nbsp;&nbsp; # if you know already what are the right arguments<br />
&nbsp;&nbsp;&nbsp; eWSdownload $url $chan $source $load<br />
&nbsp;&nbsp;&nbsp; <br />
}<br />
proc eWSIsIp {arg} {<br />
&nbsp;&nbsp; # modify these if you want to check specifi ranges for<br />
&nbsp;&nbsp; # each portion - now it look for 0 - 255 in each<br />
&nbsp;&nbsp; set ipnum1 {\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]}<br />
&nbsp;&nbsp; set ipnum2 {\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]}<br />
&nbsp;&nbsp; set ipnum3 {\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]}<br />
&nbsp;&nbsp; set ipnum4 {\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]}<br />
&nbsp;&nbsp; set fullExp {^($ipnum1)\.($ipnum2)\.($ipnum3)\.($ipnum4)$}<br />
&nbsp;&nbsp; set partialExp {^(($ipnum1)(\.(($ipnum2)(\.(($ipnum3)(\.(($ipnum4)?)?)?)?)?)?)?)?$}<br />
&nbsp;&nbsp; set fullExp [subst -nocommands -nobackslashes $fullExp]<br />
&nbsp;&nbsp; set partialExp [subst -nocommands -nobackslashes $partialExp]<br />
&nbsp;&nbsp;&nbsp; if [string equal int focusout] {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if [regexp -- $fullExp $arg] {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 1<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return [regexp -- $partialExp $arg]<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
proc eWSLog {target string} {<br />
&nbsp;&nbsp;&nbsp; global eWS<br />
&nbsp;&nbsp;&nbsp; if {![validchan $target]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "$eWS(me.name)\: $string"<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $target :$eWS(me.name)\: $string"<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
proc eWSdownload {webtarget {chan "log"} {addSource ""} {rehash ""}} {<br />
&nbsp;&nbsp;&nbsp; global eWS config<br />
&nbsp;&nbsp;&nbsp; regsub -all -- {17|02|37|26|03(\d{1,2})?(,\d{1,2})?} $webtarget "" target<br />
&nbsp;&nbsp;&nbsp; set isName [lindex [split $target "|"] 0]<br />
&nbsp;&nbsp;&nbsp; if {[file extension $isName] eq ".tcl"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set fileName $isName<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set target [join [lrange [split $target "|"] 1 end] "|"]<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set fileName [file tail $target]<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {![regexp -nocase {^(http://)?([^/:]+)(<img src="http://tclhelp.net/unb/bb_designs/_smile/unb/sad.png" title=":(" alt=":(" align="middle" class="smilie" />[0-9]+))?(/.*)?$} $target]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$webtarget eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set target "Put some url link. Usage: !websource 'url link0' 'add to config file (yes or no)' 'load when download (yes or no)'"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "Unsupported URL: $target"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {([file extension $target] ne ".tcl") &amp;&amp; ([file extension $fileName] ne ".tcl")} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "That url does not seems a valid tcl file, if you are sure that really it is, Especific the name using: !websource name.tcl\|$target (I will stop now)"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$addSource eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set addSource $eWS(addsource)<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$rehash eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set rehash $eWS(load)<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$addSource eq "yes"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set addSource 1<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$addSource eq "no"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set addSource 0<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {($addSource != 1) &amp;&amp; ($addSource != 0)} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "Should I add file to source or not? Use !websource $webtarget 'yes (1) or no (0)' $rehash"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$rehash eq "yes"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set rehash 1<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$rehash eq "no"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set rehash 0<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {($rehash != 1) &amp;&amp; ($rehash != 0)} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "Should I add load the file after download or not? Use !websource $webtarget $addSource 'yes (1) or no (0)'"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$eWS(dl.useproxy)} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set randProxy [lindex $eWS(dl.proxy) [rand [llength $eWS(dl.proxy)]]]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set port [lindex [split $randProxy ":"] 1]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set proxy [lindex [split $randProxy ":"] 0]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![eWSIsIp $proxy]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "$proxy Is Not a valid ip proxy. I will go ahead anyway (sorry)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set proxy {}<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set port {}<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![string is digit -strict $port]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {![string is digit -strict $eWS(dl.defaultport)]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set eWS(dl.defaultport) "8080"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "$port and the default $eWS(dl.defaultport) Are Not valid port numbers. I will use the most common proxy port number: 8080 (recheck your config, probably I will break)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set port "8080"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "$port Is Not a valid port number. I will use the default one: $eWS(dl.defaultport) - It may not work (verify your config)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$proxy ne ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "Proxy: $proxy\:$port"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set proxy {}<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set port {}<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; set fileTcl [file join $eWS(scriptdir) $fileName]<br />
&nbsp;&nbsp;&nbsp; if {[file exists $fileTcl]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "$fileName already exists. Last modified [duration [expr [clock seconds]-[file mtime $fileTcl]]] ago"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; # Use 02!websource $target yes02 to overwrite. ?<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; http::config -useragent "$eWS(me.name) - $eWS(me.version)" -proxyhost $proxy -proxyport $port<br />
&nbsp;&nbsp;&nbsp; if {![string is digit -strict $eWS(dl.timeout)]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set eWS(dl.timeout) "5000"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; set token [http::geturl $target -binary 1 -timeout $eWS(dl.timeout)]<br />
&nbsp;&nbsp;&nbsp; upvar #0 $token state<br />
&nbsp;&nbsp;&nbsp; regexp {[0-9]{3}} $state(http) ncode<br />
&nbsp;&nbsp;&nbsp; if {$ncode eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set ncode $state(http)<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; switch -- $ncode {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "200" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "File reached $state(currentsize) bytes. MD5sum: [md5 $state(body)]"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {$addSource} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set fs [open $fileTcl w]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; puts -nonewline $fs $state(body)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $fs<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "$fileTcl Saved."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set fs [open $config r]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set data [split [read $fs] \n]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $fs<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; lappend data "\# File saved from $target and loaded automaticly by $eWS(me.name) $eWS(me.version)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; lappend data "source $fileTcl"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set fs [open $config w]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; puts $fs [join $data \n]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $fs<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "This file was added to config file."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {$rehash} {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[catch {source $fileTcl} msg]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "There is an error loading $fileTcl\:\n $msg"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "File loaded sucessfully."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "404" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "No such file or webpage."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; http::cleanup $token<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "default" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; eWSLog $chan "unforeseen circumstance. Server responded: $state(http)"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; http::cleanup $token<br />
}<br />
<br />
eWSLog "log" "$eWS(me.fileName) $eWS(me.version) loaded - by $eWS(me.author)"<br />
[/code]]]></description>
            <author>HackeMate</author>
            <pubDate>Tue, 14 Apr 2009 10:41:32 +0100</pubDate>
            <guid>http://tclhelp.net/unb/270</guid>
        </item>
        <item>
            <title>YouTube info</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=269</link>
            <description><![CDATA[It was updated, now handles 302 redirects<br />
<br />
Reading the header' script you can configure what it should send to channel. So you can put it in your native language too<br />
To enable it: .chanset #channel +ourtube<br />
<br />
[code]#<br />
<ol>
<li>ourTube.tcl --<br /></li>
<li>This file search the web target and show relevant information about.<br /></li>
<li>Is posible define a YouTube account and the bot will log in. Useful<br /></li>
<li>when the link are for adult people i.e. It will show the first link<br /></li>
<li>that finds in a whole phrase.<br /></li>
</ol>
#<br />
<ol>
<li>Copyright (c) 2007-2009 Eggdrop Spain 12-april-2009<br /></li>
<li>&nbsp; HackeMate (Sentencia) <a href="mailto:Sentencia@eggdrop.es">Sentencia@eggdrop.es</a><br /></li>
</ol>
#<br />
<ol>
<li>This program is free software; you can redistribute it and/or<br /></li>
<li>modify it _<u>only for your own use</u>_<br /></li>
</ol>
#<br />
<ol>
<li>This program is distributed in the hope that it will be useful,<br /></li>
<li>but WITHOUT ANY WARRANTY; without even the implied warranty of<br /></li>
<li>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; <br /></li>
</ol>
#<br />
<ol>
<li>Please, use the email to contact with the author for let him know about all<br /></li>
<li>what you could do. Everyone wants develop his software as well.<br /></li>
</ol>
#<br />
<ol>
<li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thank you for feed my empiric life.<br /></li>
</ol>
#<br />
<ol>
<li>If you like, you can contact with the author to suggest him features. By the<br /></li>
<li>way, do not ask him to make Login, he is working on that.<br /></li>
</ol>
<br />
<ol>
<li>This is what you need to get this script work:<br /></li>
<li>Type in partyline: .chanset #channel +ourtube<br /></li>
</ol>
<br />
<ol>
<li>Changelog:<br /></li>
<li>&nbsp; Fixes:<br /></li>
<li>&nbsp; &nbsp; &nbsp; Resolved Tcl error [otPub]: can't read "views": no such variable<br /></li>
<li>&nbsp; &nbsp; &nbsp; Resolved eternal ignore-protection&nbsp; issue<br /></li>
</ol>
#<br />
<ol>
<li>&nbsp; Added features:<br /></li>
<li>&nbsp; &nbsp; &nbsp; Now will forward to new location 302 http code received when pasting<br /></li>
<li>&nbsp; &nbsp; &nbsp; <a href="http://youtube">http://youtube</a>. links<br /></li>
<li>&nbsp; &nbsp; &nbsp; Explicit message when 404 error (not found)<br /></li>
<li>&nbsp; &nbsp; &nbsp; All non 200, 302, 303, 404 errors will stop the procedure showing proper reason<br /></li>
</ol>
<br />
setudef flag ourtube<br />
global ourtube tcl_platform<br />
<br />
<ol>
<li>(1) Enable or (0) disable colors<br /></li>
</ol>
set ourtube(colors) 1<br />
<br />
<ol>
<li>Flood Protection: after show a link, will ignore all links few seconds<br /></li>
<li>This means 1 link per 10 seconds.<br /></li>
</ol>
set ourtube(rest) 10<br />
<br />
<ol>
<li>What language you can receive the youTube data? (if works heh)<br /></li>
</ol>
set ourtube(lang) en<br />
<br />
<ol>
<li>This is the final output message what you will read in your channel.<br /></li>
<li>You can configure all fields that your eggdrop will show.<br /></li>
<li>&lt;title&gt; will return the title of the video<br /></li>
<li>&lt;author&gt; It was the author himself who had uploaded the video<br /></li>
<li>&lt;views&gt; How many views the video has<br /></li>
<li>&lt;rating&gt; His rating<br /></li>
<li>&lt;description&gt; Information by author - This may be disabled because it can<br /></li>
<li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; contain spam<br /></li>
<li>&lt;comment&gt; Will show the last comment if exists - Same as description, take care<br /></li>
<li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with spam.<br /></li>
</ol>
<br />
set ourtube(output) "02&lt;title&gt;02. (by &lt;author&gt;) &lt;views&gt; views, &lt;rating&gt; rating. Last comment: &lt;comment&gt;"<br />
<br />
<ol>
<li>This is not required to edit, or yes.<br /></li>
</ol>
<br />
set ourtube(author) "HackeMate"<br />
set ourtube(contact) "HackeMate &lt;<a href="mailto:Sentencia@eggdrop.es">Sentencia@eggdrop.es</a>&gt;"<br />
set ourtube(fileName) [file tail [info script]]<br />
set ourtube(projectName) "ourTube"<br />
set ourtube(version) "1.0.1"<br />
set ourtube(package.http) [package require http]<br />
set ourtube(protection) ""<br />
if {$tcl_platform(os) eq "Linux"} {<br />
&nbsp;&nbsp;&nbsp; set platfrm "X11"<br />
} else {<br />
&nbsp;&nbsp;&nbsp; set platfrm $tcl_platform(os)<br />
}<br />
http::config -useragent "Mozilla/5.0 ($platfrm; U; $tcl_platform(os) $tcl_platform(machine); $ourtube(lang); rv:1.9.0.3) ourTube 1.0" -accept "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"<br />
<br />
bind pubm - * otPub<br />
<br />
proc otPub {nick uhost hand chan text} {<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; if {![channel get $chan ourtube]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; global ourtube<br />
&nbsp;&nbsp;&nbsp; regsub -all -- {17|02|37|26|03(\d{1,2})?(,\d{1,2})?} $text "" arg<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; set webTarget [lsearch -inline [split $arg] {*http://*youtube*/watch?*}]<br />
&nbsp;&nbsp;&nbsp; if {([info exists ourtube(protection)]) &amp;&amp; ([string is digit -strict $ourtube(protection)])} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set rest [expr [clock seconds]-$ourtube(protection)]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$rest &gt;= $ourtube(rest)} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set ourtube(protection) ""<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set ourtube(protection) ""<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$webTarget ne ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; if {! [regexp -nocase {^(http://)?([^/:]+)(<img src="http://tclhelp.net/unb/bb_designs/_smile/unb/sad.png" title=":(" alt=":(" align="middle" class="smilie" />[0-9]+))?(/.*)?$} $webTarget]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; otLog "Unsupported URL: $webTarget"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$ourtube(protection) ne ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; otLog "Resting... (flood protection) [duration [expr ([clock seconds]-$ourtube(protection))]] left"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set ourtube(protection) [clock seconds]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; otLog "Getting $webTarget ... from $nick on $chan"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set data [otGet $webTarget]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {!$ourtube(colors)} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; regsub -all -- {17|02|37|26|03(\d{1,2})?(,\d{1,2})?} $data "" data<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[string length $data] == 0} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set data "I was not able to reach Youtube's link. Probably I get a timeout. Try again."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; otLog "$data"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :$data"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; utimer $ourtube(rest) [list set ourtube(protection) ""]<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
}<br />
<br />
proc otGet {web {relocation ""}} {<br />
&nbsp;&nbsp;&nbsp; global ourtube<br />
&nbsp;&nbsp;&nbsp; set token [http::geturl $web -timeout 4000]<br />
&nbsp;&nbsp;&nbsp; upvar #0 $token state<br />
&nbsp;&nbsp;&nbsp; set lastcode $state(http)<br />
&nbsp;&nbsp;&nbsp; regexp {[0-9]{3}} $lastcode ncode<br />
&nbsp;&nbsp;&nbsp; if {$ncode eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set ncode $lastcode<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; switch -- $ncode {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "200" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "302" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; foreach {flag value} $state(meta) {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {$flag eq "Location"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # Due to invalid youtube link but valid url syntax we can<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; # receive an url forward. this handles that<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; http::cleanup $token<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; otLog "$web forwards us to $value"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return [otGet $value "(Relocated)"]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "303" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; otLog "This video does not exists."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; http::cleanup $token<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return "That video does not exists. Server responded: $lastcode"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; "404" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; otLog "$web - No such webpage."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; http::cleanup $token<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return "$web - No such webpage"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; default {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; http::cleanup $token<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; otLog "unforeseen circumstances. Server responded: $lastcode"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return "unforeseen circumstances. Server responded: $lastcode"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; set data [string map {"&amp;quot\;" "\"" "&amp;amp\;quot\;" "\"" "&amp;amp;" "&amp;"} $state(body)] <br />
<br />
&nbsp;&nbsp;&nbsp; http::cleanup $token<br />
&nbsp;&nbsp;&nbsp; set author ""<br />
&nbsp;&nbsp;&nbsp; set description ""<br />
&nbsp;&nbsp;&nbsp; set views ""<br />
&nbsp;&nbsp;&nbsp; set rating ""<br />
&nbsp;&nbsp;&nbsp; regexp {&lt;title&gt;(.*?)&lt;/title&gt;} $data "" title<br />
&nbsp;&nbsp;&nbsp; regexp {class="hLink fn n contributor"&gt;(.*?)&lt;/a&gt;&lt;br&gt;} $data "" author<br />
&nbsp;&nbsp;&nbsp; regexp {&lt;meta name=\"description\" content=\"(.*?)\"&gt;.*} $data "" description<br />
&nbsp;&nbsp;&nbsp; regexp {&lt;span id=\"watch-view-count\"&gt;(.*?)&lt;/span&gt;} $data "" views<br />
&nbsp;&nbsp;&nbsp; regexp {&lt;div id=\"defaultRatingMessage\"&gt;(.*?)&lt;/span&gt;.*} $data "" rating<br />
&nbsp;&nbsp;&nbsp; # This is not so smart way. I know, sorry about <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/smile.png" title=":)" alt=":)" align="middle" class="smilie" /><br />
&nbsp;&nbsp;&nbsp; set comments ""<br />
&nbsp;&nbsp;&nbsp; set description ""<br />
&nbsp;&nbsp;&nbsp; regexp {&lt;div id="recent_comments" class="comments"&gt;(.*?)&lt;div id="div_comment_form_id} $data "" comments<br />
&nbsp;&nbsp;&nbsp; if {$comments ne ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; regexp { rel="nofollow"&gt;(.*?)&lt;/a&gt;} $comments "" user<br />
&nbsp;&nbsp; &nbsp; &nbsp; regexp {&lt;span class="watch-comment-time"&gt;(.*?)&lt;/span&gt;} $comments "" timeago<br />
&nbsp;&nbsp; &nbsp; &nbsp; regexp {&lt;div class="watch-comment-body"&gt;(.*?)&lt;/div&gt;} $comments "" comment<br />
&nbsp;&nbsp; &nbsp; &nbsp; set comment [string map {\n " " "&lt;br&gt;" ""} $comment]<br />
&nbsp;&nbsp; &nbsp; &nbsp; regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $comment "" comment<br />
&nbsp;&nbsp; &nbsp; &nbsp; regsub -all {\s+} $comment " " comment<br />
&nbsp;&nbsp; &nbsp; &nbsp; set comment "\&lt;$user [string trim $timeago]\&gt; [string trim $comment]"<br />
&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set comment ""<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $title "" title<br />
&nbsp;&nbsp;&nbsp; regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $description "" description<br />
&nbsp;&nbsp;&nbsp; regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $views "" views<br />
&nbsp;&nbsp;&nbsp; regsub -all -- {\&lt;[^\&gt;]*\&gt;|\t} $rating "" rating<br />
&nbsp;&nbsp;&nbsp; set rating [lindex [split $rating] 0]<br />
&nbsp;&nbsp;&nbsp; set title "$relocation $title"<br />
&nbsp;&nbsp;&nbsp; set title [string trim $title]<br />
&nbsp;&nbsp;&nbsp; if {![string is digit -strict $views]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set views "no"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {![string is digit -strict $rating]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set rating "no"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$comment eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set comment "This video doesn't have any comments until now"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; if {$description eq ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set description "This video doesn't have any description"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; set output [string map [list "&lt;title&gt;" $title "&lt;author&gt;" $author "&lt;description&gt;" $description "&lt;views&gt;" $views "&lt;rating&gt;" $rating "&lt;comment&gt;" $comment] $ourtube(output)]<br />
&nbsp;&nbsp;&nbsp; return $output<br />
}<br />
<br />
<ol>
<li>upvar #0 $token state<br /></li>
</ol>
proc otLog {arg} {<br />
&nbsp;&nbsp;&nbsp; global ourtube<br />
&nbsp;&nbsp;&nbsp; putlog "$ourtube(projectName): $arg"<br />
}<br />
otLog "$ourtube(fileName) $ourtube(version) Loaded - by $ourtube(author)"<br />
<br />
[/code]]]></description>
            <author>HackeMate</author>
            <pubDate>Sun, 12 Apr 2009 10:37:44 +0100</pubDate>
            <guid>http://tclhelp.net/unb/269</guid>
        </item>
        <item>
            <title>Example to connect Msn</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=256</link>
            <description><![CDATA[This is not a final script to use msn, it just contain the basic part for log in, the else of work only requires read the msn commands. The comments are based in <a href="http://www.hypothetic.org/docs/msn/">http://www.hypothetic.org/docs/msn/</a>, my English is not so good <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/smile.png" title=":)" alt=":)" align="middle" class="smilie" /><br />
<br />
[code]<br />
#!/usr/bin/tclsh<br />
<ol>
<li><br /></li>
<li>This is an elemental Msn client using the protocol MSNP8 (windows messenger default)<br /></li>
<li>Not third-party client. It's an example for your information.<br /></li>
<li>Written by HackeMate @ QuakeNet<br /></li>
<li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Sentencia @ IRC-Hispano<br /></li>
<li><a href="mailto:Sentencia@librepensamiento.es">Sentencia@librepensamiento.es</a><br /></li>
</ol>
<br />
proc msn:sdata {sock str} {<br />
&nbsp;&nbsp; puts $sock "$str"<br />
&nbsp;&nbsp; msn:echo "*** $sock: $str"<br />
}<br />
<br />
proc msn:echo {str} {<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; switch -- [string range $str 0 3] {<br />
&nbsp;&nbsp; &nbsp;&nbsp; "::: " {<br />
&nbsp;&nbsp; &nbsp; set prefix "Msn:&gt;"<br />
&nbsp;&nbsp; &nbsp; set str [string range $str 4 end]<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; "*** " {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set prefix "02Sending:\&gt;02"<br />
&nbsp;&nbsp; &nbsp; set str [string range $str 4 end]<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; "!!! " {<br />
&nbsp;&nbsp; &nbsp; set prefix "2Incomming ERROR:02"<br />
&nbsp;&nbsp; &nbsp; set str [string rane $str 4 end]<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; "default" {<br />
&nbsp;&nbsp; &nbsp; set prefix "Incomming data:"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp; puts stdout "$prefix $str"<br />
}<br />
&nbsp;&nbsp; <br />
proc msn:nexus {} {<br />
<br />
&nbsp;&nbsp; # Passport authentication begins with the passport nexus, just as logging into messenger begins with the Dispatch Server<br />
&nbsp;&nbsp; # Using secure http request to the next path.<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; package require http<br />
&nbsp;&nbsp; package require tls<br />
&nbsp;&nbsp; http::register https 443 ::tls::socket<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; set token [http::geturl <a href="https://nexus.passport.com/rdr/pprdr.asp">https://nexus.passport.com/rdr/pprdr.asp</a>]<br />
&nbsp;&nbsp; upvar #0 $token state<br />
&nbsp;&nbsp; foreach {name value} $state(meta) {<br />
&nbsp;&nbsp; &nbsp;&nbsp; if {$name == "PassportURLs"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set data [split $value ","]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set dalogin [lsearch -all -inline $data "DALogin=*"]<br />
&nbsp;&nbsp; &nbsp; set dalogin [lindex [split $dalogin "="] 1]<br />
&nbsp;&nbsp; &nbsp; msn:echo "::: PassPort saved. We are jumping to $dalogin"<br />
&nbsp;&nbsp; &nbsp; msn:passport $dalogin<br />
&nbsp;&nbsp; &nbsp; return<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp; # I admit that this is a dirty way to know when passort auth was failed.<br />
&nbsp;&nbsp; # Sorry about, I'm lazy.&nbsp;&nbsp; <br />
&nbsp;&nbsp; msn:echo "!!! Authentication process was not good."<br />
&nbsp;&nbsp; close $::msn(sock)<br />
&nbsp;&nbsp; # This exist command will exit from the previous command executed in msn:Login vwait forever <br />
&nbsp;&nbsp; exit<br />
&nbsp;&nbsp; return<br />
}<br />
<br />
proc msn:passport {url} {<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; # The client sends a https get request for the url given to it by the nexus (saved in $dalogin, here $url)<br />
&nbsp;&nbsp; # The login is waiting the last parameters that we saved in $::msn(auth), like a header.<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; package require http<br />
&nbsp;&nbsp; package require tls<br />
&nbsp;&nbsp; http::register https 443 ::tls::socket<br />
<br />
&nbsp;&nbsp; set url "https://$url"<br />
&nbsp;&nbsp; set account [string map [list "\@" "\%40"] $::msn(account)]<br />
&nbsp;&nbsp; set token [http::geturl $url -headers [list Authorization "Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=$account,pwd=$::msn(password),$::msn(auth)"]]<br />
&nbsp;&nbsp; upvar #0 $token state<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; # If we fail the authentication, instead HTTP 200 it will return something like HTTP 302, or if<br />
&nbsp;&nbsp; # the syntax was badly, HTTP 401. If all is Ok, this foreach will connect us.<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; foreach {name value} $state(meta) {<br />
&nbsp;&nbsp; &nbsp;&nbsp; if {$name == "Authentication-Info"} {<br />
&nbsp;&nbsp; &nbsp; regexp {\'(.*?)\'} $value "" cookie<br />
&nbsp;&nbsp; &nbsp; incr ::msn(trid)<br />
&nbsp;&nbsp; &nbsp; msn:sdata $::msn(sock) "USR $::msn(trid) TWN S $cookie"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; }<br />
}<br />
<ol>
<li>Configuration<br /></li>
</ol>
<br />
set ::msn(account) "Your@Messenger.account"<br />
set ::msn(password) "AGoodPassword"<br />
<br />
<ol>
<li>We define here the version protocol.<br /></li>
<li>This variable will be used only twice.<br /></li>
</ol>
<br />
set ::msn(version) "MSNP8 CVR0"<br />
<br />
<ol>
<li>(CVR) The CVR command sends version information about a client and operating<br /></li>
<li>system to the server. For the official client, the server will reply with<br /></li>
<li>information about a recommended version of the client. It's debatable whether<br /></li>
<li>third-party clients should send CVR. Microsoft might start blocking users based on<br /></li>
<li>this command, or they might tread third-party clients better than now if there was<br /></li>
<li>evidence that a significant number of people used them. Any way, Microsoft<br /></li>
<li>has no way to verify the information given.<br /></li>
</ol>
<br />
<ol>
<li>Independently of all this debat, Where are you from? <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/smile.png" title=":)" alt=":)" align="middle" class="smilie" /> Spanish location is 0x0C0A<br /></li>
<li>American users send: 0x0409<br /></li>
<li>For your information: <a href="http://www.microsoft.com/globaldev/reference/oslocversion.mspx">http://www.microsoft.com/globaldev/reference/oslocversion.mspx</a><br /></li>
<li>This var may define your Locale configuration<br /></li>
</ol>
set ::msn(location) "0x0C0A"<br />
<br />
<ol>
<li>This is our info. It is what a Windows XP &amp; windows messenger sends.<br /></li>
</ol>
<br />
set ::msn(msnms) "winnt 5.1 i386 MSMSGS 4.7.3001 WindowsMessenger"<br />
<br />
<br />
<ol>
<li>End of parameters.<br /></li>
</ol>
<br />
<ol>
<li>We are going<br /></li>
</ol>
<br />
proc msn:Login { { server "messenger.hotmail.com" } {port 1863} } {<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; # (TrID) The Transaction IDs, abbreviated as TriDs, are used to much a client command with a server<br />
&nbsp;&nbsp; # response. Commands sent by the client are required to contain a TrID, and commands from the server<br />
&nbsp;&nbsp; # sent in direct response to that command will contain the same TrID (with some exception).<br />
&nbsp;&nbsp; # Every TrID is a number between 0 and 4294967295. Using this TrID wrongly may cause confusion and<br />
&nbsp;&nbsp; # server and client will be unstable.<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; if {![info exists ::msn(trid)]} { set ::msn(trid) 1 }<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; # Easy to make multi-server, almost all depend of this (and previous) var name.<br />
<br />
&nbsp;&nbsp; set ::msn(sock) [socket $server $port]<br />
&nbsp;&nbsp; msn:echo "::: Trying to connect $server:$port- sockname: $::msn(sock)"<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; # Because we can receive data in any moment, we need read it as fast as we can, that's why I used<br />
&nbsp;&nbsp; # -buffering line instead full. In certain moment negotiating the connection, the socket can get<br />
&nbsp;&nbsp; # stuned or we are forced to execute manually gets, if you don't use vwait forever command.<br />
&nbsp;&nbsp; # I had bad experiencies with this command in x-chat.<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; fconfigure $::msn(sock) -buffering line -blocking no<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; fileevent $::msn(sock) readable [list msn:gdata $::msn(sock)]<br />
&nbsp;&nbsp; msn:sdata $::msn(sock) "VER $::msn(trid) $::msn(version)"<br />
&nbsp;&nbsp; vwait forever&nbsp;&nbsp; <br />
}<br />
<br />
proc msn:gdata {socket} {<br />
&nbsp;&nbsp; <br />
&nbsp;&nbsp; if {[eof $socket]} {<br />
&nbsp;&nbsp; &nbsp;&nbsp; msn:echo "::: Closed connection."<br />
&nbsp;&nbsp; &nbsp;&nbsp; close $socket<br />
&nbsp;&nbsp; &nbsp;&nbsp; exit<br />
&nbsp;&nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp; set datos [gets $socket]&nbsp; <br />
&nbsp;&nbsp; foreach data [split $datos \n] {<br />
&nbsp;&nbsp; &nbsp;&nbsp; msn:echo "$data"&nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; if {$data == "VER $::msn(trid) $::msn(version)"} {<br />
&nbsp;&nbsp; &nbsp; incr ::msn(trid)<br />
&nbsp;&nbsp; &nbsp; msn:sdata $::msn(sock) "CVR $::msn(trid) $::msn(location) $::msn(msnms) $::msn(account)"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; set cvr [join [lrange [split $data] 0 1]]<br />
&nbsp;&nbsp; &nbsp;&nbsp; if {$cvr == "CVR $::msn(trid)"} {<br />
&nbsp;&nbsp; &nbsp; incr ::msn(trid)<br />
&nbsp;&nbsp; &nbsp; msn:sdata $::msn(sock) "USR $::msn(trid) TWN I $::msn(account)"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; set usr [join [lrange [split $data] 0 3]]<br />
&nbsp;&nbsp; &nbsp;&nbsp; if {$usr == "USR $::msn(trid) TWN S"} {<br />
&nbsp;&nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp; # Rude way to save this parameters... <br />
&nbsp;&nbsp; &nbsp; # Thanks thommey for advice to use a foreach loop<br />
&nbsp;&nbsp; &nbsp; # It will work, I will change it soon<br />
&nbsp;&nbsp; &nbsp; set udata [split $data ","]<br />
&nbsp;&nbsp; &nbsp; set lc [lsearch -all -inline $udata "lc=*"]<br />
&nbsp;&nbsp; &nbsp; set lc [lindex [split $lc "="] 1]<br />
&nbsp;&nbsp; &nbsp; set id [lsearch -all -inline $udata "id=*"]<br />
&nbsp;&nbsp; &nbsp; set id [lindex [split $id "="] 1]<br />
&nbsp;&nbsp; &nbsp; set tw [lsearch -all -inline $udata "tw=*"]<br />
&nbsp;&nbsp; &nbsp; set tw [lindex [split $tw "="] 1]<br />
&nbsp;&nbsp; &nbsp; set ru [lsearch -all -inline $udata "ru=*"]<br />
&nbsp;&nbsp; &nbsp; set ru [lindex [split $ru "="] 1]<br />
&nbsp;&nbsp; &nbsp; set ct [lindex [lsearch -all -inline $udata "*ct=*"] 0]<br />
&nbsp;&nbsp; &nbsp; set ct [lindex [split $ct] 4]<br />
&nbsp;&nbsp; &nbsp; set ct [lindex [split $ct "="] 1]<br />
&nbsp;&nbsp; &nbsp; set kpp [lsearch -all -inline $udata "kpp=*"]<br />
&nbsp;&nbsp; &nbsp; set kpp [lindex [split $kpp "="] 1]<br />
&nbsp;&nbsp; &nbsp; set kv [lsearch -all -inline $udata "kv=*"]<br />
&nbsp;&nbsp; &nbsp; set kv [lindex [split $kv "="] 1]<br />
&nbsp;&nbsp; &nbsp; set ver [lsearch -all -inline $udata "ver=*"]<br />
&nbsp;&nbsp; &nbsp; set ver [lindex [split $ver "="] 1]<br />
&nbsp;&nbsp; &nbsp; set rn [lsearch -all -inline $udata "rn=*"]<br />
&nbsp;&nbsp; &nbsp; set rn [lindex [split $rn "="] 1]<br />
&nbsp;&nbsp; &nbsp; set tpf [lsearch -all -inline $udata "tpf=*"]<br />
&nbsp;&nbsp; &nbsp; set tpf [lindex [split $tpf "="] 1]<br />
&nbsp;&nbsp; &nbsp; set ::msn(auth) "lc=$lc,id=$id,tw=$tw,ru=$ru,ct=$ct,kpp=$kpp,kv=$kv,ver=$ver,rn=$rn,tpf=$tpf"<br />
&nbsp;&nbsp; &nbsp; msn:nexus&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; if {$data == "USR $::msn(trid) OK $::msn(account) $::msn(account) 1 0"} {<br />
&nbsp;&nbsp; &nbsp; msn:echo "::: Now we are logged in."<br />
&nbsp;&nbsp; &nbsp; # This command will mark us as connected for else people.<br />
&nbsp;&nbsp; &nbsp; msn:sdata $::msn(sock) "SYN 8 0"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; # SYN command will return our buddy list&nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; if {[join [lrange [split $data] 0 1]] == "SYN 8"} {<br />
&nbsp;&nbsp; &nbsp; msn:sdata $::msn(sock) "CHG 9 NLN 0"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; if {[lindex [split $data] 0] == "ClientIP:"} {<br />
&nbsp;&nbsp; &nbsp; set ::msn(selfip) [lindex [split $data] 1]<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; if {[lindex [split $data] 1] == "ClientPort:"} {<br />
&nbsp;&nbsp; &nbsp; set ::msn(selfport) [lindex [split $data] 1]<br />
&nbsp;&nbsp; &nbsp; msn:echo "Our IP is: $::msn(selfip) and the port: $::msn(selfport)"<br />
&nbsp;&nbsp; &nbsp; msn:sdata "SYN 8 0"<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; if {[lindex [split $data] 0] == "XFR"} {<br />
&nbsp;&nbsp; &nbsp; close $::msn(sock)<br />
&nbsp;&nbsp; &nbsp; set server [lindex [split $data] 3]<br />
&nbsp;&nbsp; &nbsp; set port [lindex [split $server ":"] 1]<br />
&nbsp;&nbsp; &nbsp; set server [lindex [split $server ":"] 0]<br />
&nbsp;&nbsp; &nbsp; incr ::msn(trid)<br />
&nbsp;&nbsp; &nbsp; msn:Login $server $port<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; # Catching errors (this is just a few list of)<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp;&nbsp; set cmd [lindex [split $data] 0]<br />
&nbsp;&nbsp; &nbsp;&nbsp; set cparm [lindex [split $data] 1]<br />
&nbsp;&nbsp; &nbsp;&nbsp; switch -- $cmd {<br />
&nbsp;&nbsp; &nbsp; "710" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! Bad CVR parameters sent."<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp; "711" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! Write is blocking."<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp; "712" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! Session is overloaded."<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp; "713" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! Calling too rapidly. This occurs when the client repeatedly calls someone who is offline or blocking them"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! in response to the commands that the server rejects. This is a way to know who is blocking you."<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp; "714" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! Too many sessions."<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp; "715" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$cparm == "30"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! PRP setting an invalid phone type of three or less characters."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$cparm == "31"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msn:echo "!!! ERROR- Changing display name (REA) on an unverified Passport account."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp; "731" {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; msn:echo "!!! ERROR- Not expected. Bad formatted CVR."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; close $::msn(sock)<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; }<br />
}<br />
<br />
puts stdout "Msn Client loaded"<br />
[/code]]]></description>
            <author>HackeMate</author>
            <pubDate>Fri, 09 May 2008 10:55:31 +0100</pubDate>
            <guid>http://tclhelp.net/unb/256</guid>
        </item>
        <item>
            <title>[EGG] request</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=223</link>
            <description><![CDATA[<ol>
<li> Author: Björn 'Turbo' B.&nbsp; <br /></li>
<li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br /></li>
<li>Copyright © 2009 Turbo-Dev.org - All Rights Reserved.<br /></li>
</ol>
#<br />
<ol>
<li>Version/Date check list.<br /></li>
</ol>
#&nbsp; &nbsp; 1.0 - June 18 2007<br />
#&nbsp; &nbsp; 1.1 - December 22 2009<br />
#&nbsp; &nbsp; 1.2 - Januari 21 2010<br />
<br />
namespace eval ::request_system {<br />
<br />
&nbsp;&nbsp;&nbsp; # - Config<br />
<br />
&nbsp;&nbsp;&nbsp; ## Set here the trigger you wanna use.<br />
&nbsp;&nbsp;&nbsp; variable reqtrigger "."<br />
<br />
&nbsp;&nbsp;&nbsp; ## Please leave this.<br />
&nbsp;&nbsp;&nbsp; variable reqversion "1.2"<br />
<br />
&nbsp;&nbsp;&nbsp; ## Set here the channel (where users can use the request command).<br />
&nbsp;&nbsp;&nbsp; variable reqchannel "#choose-your-channel"<br />
<br />
&nbsp;&nbsp;&nbsp; ## Set here the channel where all msgs report goes to.<br />
&nbsp;&nbsp;&nbsp; variable reportchannel "#choose-your-channel"<br />
<br />
&nbsp;&nbsp;&nbsp; ## Set here the require users that a requested channel needs.<br />
&nbsp;&nbsp;&nbsp; variable require "25"<br />
<br />
&nbsp;&nbsp;&nbsp; # - File Check<br />
<br />
&nbsp;&nbsp;&nbsp; if {![file exists request]} { file mkdir request }<br />
<br />
&nbsp;&nbsp;&nbsp; # - Binds<br />
<br />
&nbsp;&nbsp;&nbsp; bind pub -|- ${reqtrigger}request [namespace current]::start<br />
&nbsp;&nbsp;&nbsp; bind pub m|m ${reqtrigger}suspend [namespace current]::suspend<br />
&nbsp;&nbsp;&nbsp; bind pub m|m ${reqtrigger}unsuspend [namespace current]::unsuspend<br />
&nbsp;&nbsp;&nbsp; bind pub m|m ${reqtrigger}info [namespace current]::suspended<br />
&nbsp;&nbsp;&nbsp; bind pub m|m ${reqtrigger}remove [namespace current]::removebot<br />
&nbsp;&nbsp;&nbsp; bind need -|- * [namespace current]::need:check<br />
<br />
&nbsp;&nbsp;&nbsp; # - End Of Bindings<br />
<br />
&nbsp;&nbsp;&nbsp; # - End Of Config<br />
<br />
&nbsp;&nbsp;&nbsp; ## Don`t touch anything below this (only if you know what you are doing)<br />
<br />
<br />
&nbsp;&nbsp;&nbsp; proc start {nick host hand chan text} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; global request<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable reqchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable reportchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable require<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set requestchannel [lindex [split $text] 0]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$reqchannel == "" || $reportchannel == "" || $require == ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putlog "(Request) Please check your Configuration."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {![string equal -nocase $chan "$reqchannel"]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) You can only request on channel: $reqchannel"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[info exists request(proceeding)]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) There is already a request proceeding, please wait and try again."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {$requestchannel == ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) $::lastbind &lt;#channel&gt;"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[string index $requestchannel 0] != "#"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) ($requestchannel) is no such channel name."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[string tolower $requestchannel] == "[string tolower $reqchannel]"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) ($requestchannel) is no request channel."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[issuspended $requestchannel] == "1"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) ($requestchannel) has been suspended."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[validchan $requestchannel] == "1"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) Already on channel: ($requestchannel)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Status: Proceeding - Channel: $requestchannel - Nickname: $nick"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel add $requestchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(proceeding) "1"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(chan) "$requestchannel"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(nick) "$nick"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(required) "$require"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; bind raw - 315 [namespace current]::end<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; proc end {from key text} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; global request<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; variable reportchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {![info exists request(proceeding)]} { return }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set users "[llength [chanlist $request(chan)]]"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {$users &lt; "$request(required)"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "Not enough users."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "privmsg $request(nick) :(Request) Failed: Not enough users on $request(chan) you need $request(required) users, and currently have $users"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } elseif {![onchan $request(nick) $request(chan)]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "User not channel."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "privmsg $request(nick) :(Request) Failed: Didn`t found you on $request(chan)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } elseif {![isop $request(nick) $request(chan)]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "User not opped on channel."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "privmsg $request(nick) :(Request) Failed: You don`t have op on $request(chan)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } elseif {![onchan Q $request(chan)]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "Q not on channel"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "privmsg $request(nick) :(Request) Failed: Didn`t found Q on $request(chan)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $request(nick) :(Request) $request(nick) Your request is accepted, to remove me from $request(chan) you can ask bot owner: $::owner"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: Yes"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(nick)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(required)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(proceeding)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unbind raw - 315 [namespace current]::end<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; proc issuspended {chan} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![file exists request/suspended.txt]} { return 0 }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set file [open request/suspended.txt "r+"]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set found 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; while {![eof $file]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set info [gets $file]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[string equal -nocase "[lindex [split $info] 0]" $chan]} { set found "1" }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; close $file<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$found == "1"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 1<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; proc removebot {nick host hand chan text} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable reqchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable reportchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set removechannel [lindex [split $text] 0]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[string equal -nocase $removechannel "$reqchannel"]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) ($removechannel) not allowed."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {$removechannel == ""} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) $::lastbind &lt;#channel&gt;"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[validchan $removechannel] == "0"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putserv "PRIVMSG $chan :(Request) ($removechannel) is not a valid channel."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $removechannel<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Removed channel: $removechannel."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; proc need:check {chan type} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; global request<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable reportchannel<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![info exists request(proceeding)]} { return }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![string equal -nocase $chan "$request(chan)"]} { return }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; switch -exact -- [string tolower [lindex [split $type] 0]] {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "unban" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "Couldn`t check the channel because i found myself banned."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(nick)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(required)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(proceeding)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "invite" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "Couldn`t check the channel because the channel is set to +i (invite only)."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(nick)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(required)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(proceeding)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "limit" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "Couldn`t check the channel because the channel is set to +l (limit)."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(nick)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(required)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(proceeding)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "key" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; channel remove $request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set request(reason) "Couldn`t check the channel because the channel is set to +k (key)."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $reportchannel :(Request) Channel: $request(chan) - Nickname: $request(nick) - Accepted: No - Reason: $request(reason)"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(reason)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(chan)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(nick)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(required)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; unset request(proceeding)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; unbind raw - 315 [namespace current]::end<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; proc suspend {nick host hand chan text} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![file exists request/suspended.txt]} { set file [open request/suspended.txt w+]; close $file }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[lindex [split $text] 0] == "" || [join [lrange [split $text] 1 end]] == "" || [string index [lindex [split $text] 0] 0] != "#"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) $::lastbind &lt;#channel&gt; &lt;reason&gt;"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set file [open request/suspended.txt "r+"]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set found 0<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set suspendchan [lindex [split $text] 0]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set suspendreason [join [lrange [split $text] 1 end]]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; while {![eof $file]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set info [gets $file]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[string equal -nocase "[lindex [split $info] 0]" $suspendchan]} { incr found 1 }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {$found != "0"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) Already suspended."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; puts $file "$suspendchan $nick [strftime {%m/%d/%y}] $suspendreason"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) Suspended."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $file<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc unsuspend {nick host hand chan text} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![file exists request/suspended.txt]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) Couldn`t find the suspended channels list."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[lindex [split $text] 0] == "" || [string index [lindex [split $text] 0] 0] != "#"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) $::lastbind &lt;#channel&gt;"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set file [open request/suspended.txt "r"]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set found 0<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set list {}<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set suspendchan [lindex [split $text] 0]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; while {![eof $file]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set info [gets $file]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[eof $file]} { break }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[string equal -nocase "[lindex [split $info] 0]" $suspendchan]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; incr found 1<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; lappend list [join [split $info]] }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $file<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {$found == "0"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) $suspendchan is not suspended."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set file [open request/suspended.txt "w+"]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; foreach {info} $list {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; puts $file $info }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $file<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) $suspendchan has been removed from suspended list."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp;&nbsp; proc suspended {nick host hand chan text} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![file exists request/suspended.txt]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) Couldn`t find the suspended channels list."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } elseif {[lindex [split $text] 0] == "" || [string index [lindex [split $text] 0] 0] != "#"} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) $::lastbind &lt;#channel&gt;"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set file [open request/suspended.txt r]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set buffer [split [read $file] \n]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set suspendchan [lindex [split $text] 0]<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; foreach info $buffer {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[string equal -nocase "[lindex [split $info] 0]" $suspendchan]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) \'[lindex [split $info] 0]\' has been suspended by ([lindex [split $info] 1]) on [lindex [split $info] 2] with reason: [join [lrange [split $info] 3 end]]"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putquick "PRIVMSG $chan :(Request) No info found about $suspendchan, not suspended."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; close $file<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
}<br />
<br />
putlog "Request System ${request_system::reqversion} Is Scripted By 'Björn 'Turbo' B.'"]]></description>
            <author>Turbo</author>
            <pubDate>Sun, 17 Jun 2007 22:02:39 +0100</pubDate>
            <guid>http://tclhelp.net/unb/223</guid>
        </item>
        <item>
            <title>[TCL] StatsScript für pisg</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=209</link>
            <description><![CDATA[Hi,<br />
<br />
so, nun nen script wo ich glaub dass es die Welt brauchen könnte <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/wink.png" title=";)" alt=";)" align="middle" class="smilie" /><br />
<br />
Also dabei handelt es sich um ein script, das die pisg.cfg editiert je nach bedarf für die einzelnen Channels.<br />
<br />
Atm einstellbar für jeden channel einzeln (stand v2.14):<br />
- Sprache<br />
- Layout<br />
- Skin<br />
- On/Off natürlich <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/wink.png" title=";)" alt=";)" align="middle" class="smilie" /><br />
<br />
Alles dadrüber findet ihr in meinem Forum. Sollte da immer up2date sein: <a href="forum.php?req=derefer&amp;url=http%3A%2F%2Fwww.antenne-irc.de%2Findex.php%3Foption%3Dcom_joomlaboard%26Itemid%3D28%26func%3Dview%26id%3D4%26catid%3D5" title="http://www.antenne-irc.de/index.php?option=com_joomlaboard&amp;Itemid=28&amp;func=view&amp;id=4&amp;catid=5">Antenne-IRC.de Forum </a><br />
<br />
Wünsche euch viel Spaß damit <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/wink.png" title=";)" alt=";)" align="middle" class="smilie" /><br />
<br />
Euer UncleSam]]></description>
            <author>UncleSam</author>
            <pubDate>Wed, 31 Jan 2007 20:05:59 +0100</pubDate>
            <guid>http://tclhelp.net/unb/209</guid>
        </item>
        <item>
            <title>[Egg] Mediawiki/Wikipedia RC Announcer</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=204</link>
            <description><![CDATA[$ svn co <a href="http://svn.swordcoast.net/tcl/trunk/mediawiki/">http://svn.swordcoast.net/tcl/trunk/mediawiki/</a><br />
<br />
wikibot.tcl watches &amp; announces the recent changes table on a MySQL-Mediawiki Installation.]]></description>
            <author>elven</author>
            <pubDate>Wed, 08 Nov 2006 17:14:29 +0100</pubDate>
            <guid>http://tclhelp.net/unb/204</guid>
        </item>
        <item>
            <title>[EGG] Logtrim</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=185</link>
            <description><![CDATA[Hi,<br />
<br />
Mit dem script hier kann der Bot die Logs selbstständig auf die gewünschte größe trimmen. Alle Infos stehen im script.<br />
<br />
Wenn Fehler oder ähnliches auftauchen, dann bitte mir sagen <a href="mailto:UncleSam@Antenne-IRC.de">UncleSam@Antenne-IRC.de</a> oder #Antenne im Quakenet.<br />
<br />
Mfg UncleSam]]></description>
            <author>UncleSam</author>
            <pubDate>Wed, 21 Jun 2006 09:05:16 +0100</pubDate>
            <guid>http://tclhelp.net/unb/185</guid>
        </item>
        <item>
            <title>[EGG] Access</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=168</link>
            <description><![CDATA[This script will check Q-Auths against a Database with at least two columns, where one defines the auth and the other the channel the auth has access to.<br />
<br />
you can change access with the .access command (owners only) from the party line.<br />
<br />
I was writing this for Someone but only for one channel. So i though just in case someone needs something like that to expand it to multiple chans.<br />
<br />
[code]<br />
#Access (c) gotisch<br />
namespace eval Access {<br />
&nbsp;&nbsp;&nbsp; # Limit's Access to a Channel based on Q-Auth.<br />
&nbsp;&nbsp;&nbsp; # To check Q-Account we use: who nick n%nat,30<br />
&nbsp;&nbsp;&nbsp; # Config:<br />
&nbsp;&nbsp;&nbsp; variable mysql<br />
&nbsp;&nbsp;&nbsp; array set mysql {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; pkg&nbsp; &nbsp; &nbsp; &nbsp; ""<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; host&nbsp; &nbsp; "localhost"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; user&nbsp; &nbsp; "user"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; pass&nbsp; &nbsp; "pass"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; db&nbsp; &nbsp; &nbsp; &nbsp; "db"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; table&nbsp; &nbsp; "access"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; ncol&nbsp; &nbsp; "account"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; ccol&nbsp; &nbsp;&nbsp; "channel"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; #No need to change that prob.<br />
&nbsp;&nbsp;&nbsp; variable num 100<br />
&nbsp;&nbsp;&nbsp; variable chan ""<br />
&nbsp;&nbsp;&nbsp; #Channel flag<br />
&nbsp;&nbsp;&nbsp; setudef flag Access<br />
&nbsp;&nbsp;&nbsp; #Binds:<br />
&nbsp;&nbsp;&nbsp; bind join - * [namespace current]::OnJoin<br />
&nbsp;&nbsp;&nbsp; bind raw - 354 [namespace current]::OnRaw<br />
&nbsp;&nbsp;&nbsp; bind dcc n access&nbsp; [namespace current]::OnCommand<br />
&nbsp;&nbsp;&nbsp; #Procs:<br />
&nbsp;&nbsp;&nbsp; proc OnCommand { ha id te } {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set args [split $te]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[llength $args] &lt; 3} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; showhelp $id<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; foreach {cmd auth chan} $args break;<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; switch $cmd {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "add" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {![IsAllowed $auth $chan]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Allow $auth $chan<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putdcc $id "Done."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "remove" {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {[IsAllowed $auth $chan]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; UnAllow $auth $chan<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putdcc $id "Done."<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; default {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; showhelp $id<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc showhelp id {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putdcc $id "Syntax is: .access &lt;add/remove&gt; &lt;nick&gt; &lt;channel&gt;"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putdcc $id "Both can be masks so be carefull"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putdcc $id "For example '.access remove somenick %' will remove all access of that user."&nbsp; &nbsp; <br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc OnJoin { n uh ha ch } {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable num<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable chan<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[isbotnick $n]} {return}<br />
&nbsp;&nbsp; &nbsp;&nbsp; if {![channel get $ch Access]} {return}<br />
&nbsp;&nbsp; &nbsp;&nbsp; putquick "WHO $n n%nat,$num" -next<br />
&nbsp;&nbsp; &nbsp;&nbsp; putlog "[namespace current]: Testing $n on $ch"<br />
&nbsp;&nbsp; &nbsp;&nbsp; set chan $ch<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc OnRaw { from keyword arguments } {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable num<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable chan<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$keyword != 354} { return }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Got $arguments"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set list1 [split $arguments]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[lindex $list1 0] != $::botnick} { return }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: For me [lindex $list1 0]"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {[lindex $list1 1] != $num} { return }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Right Query"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {![IsAllowed [lindex $list1 3] $chan]} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Not Allowed"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Remove [lindex $list1 2] $chan<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; return<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc IsAllowed {auth chan} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable mysql<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$auth == "0"} { return 0 }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Authed as $auth"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; #1. Connect to Database:<br />
&nbsp;&nbsp;&nbsp; if { [ catch {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set handle [mysqlconnect -host $mysql(host) -u $mysql(user) -password $mysql(pass) -db $mysql(db)]&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } err ] } { <br />
&nbsp;&nbsp; &nbsp;&nbsp; putlog "[namespace current]: Could not connect to MYSQL."<br />
&nbsp;&nbsp; &nbsp;&nbsp; return 1<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; #2. We now have a valid mysql handle in $handle<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set result [mysqlsel $handle "SELECT `$mysql(ncol)` FROM `$mysql(table)` WHERE `$mysql(ncol)` LIKE '$auth' AND `$mysql(ccol)` LIKE '$chan'" -list]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; mysqlclose $handle<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: $result"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if {$result == {}} { return 0 }<br />
&nbsp;&nbsp;&nbsp; return 1<br />
&nbsp; }<br />
&nbsp; proc Allow { auth chan } {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable mysql<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if { [ catch {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set handle [mysqlconnect -host $mysql(host) -u $mysql(user) -password $mysql(pass) -db $mysql(db)]&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } err ] } { <br />
&nbsp;&nbsp; &nbsp;&nbsp; putlog "[namespace current]: Could not connect to MYSQL."<br />
&nbsp;&nbsp; &nbsp;&nbsp; return 1<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]:Allowing '$auth' to enter '$chan'"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set result [mysqlexec $handle "INSERT INTO `$mysql(table)` ($mysql(ncol), $mysql(ccol)) VALUES ('$auth','$chan')"]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: $result"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc UnAllow { auth chan } {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable mysql<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if { [ catch {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; set handle [mysqlconnect -host $mysql(host) -u $mysql(user) -password $mysql(pass) -db $mysql(db)]&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } err ] } { <br />
&nbsp;&nbsp; &nbsp;&nbsp; putlog "[namespace current]: Could not connect to MYSQL."<br />
&nbsp;&nbsp; &nbsp;&nbsp; return 1<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Removing '$auth's right to enter '$chan'"<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; set result [mysqlexec $handle "DELETE FROM `$mysql(table)` WHERE `$mysql(ncol)` LIKE '$auth' AND `$mysql(ccol)` LIKE '$chan'"]<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: $result"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc Remove {nick chan} {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {![channel get $chan Access]} { continue }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if {![onchan $nick $chan]} { continue }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; newchanban $chan [maskhost [getchanhost $nick $chan]] [namespace current] "No Access - 10min ban" 10 sticky<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putkick $chan $nick "No Access - 10min ban"<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Removing $nick from $chan. Reason: No Access"<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; proc ScriptLoad {} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; variable mysql<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Loading..."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if { $mysql(pkg) == "" } {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; #No package set so we try to just require it.<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if { [catch { package require mysqltcl } err ] } { putlog "[namespace current]: Could not load mysql, unloading"; ScriptUnload; return }<br />
&nbsp;&nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; #Mysqltcl should be a .so<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if { [catch { load $mysql(pkg) } err ] } { putlog "[namespace current]: Could not load mysql, unloading"; ScriptUnload; return }<br />
&nbsp;&nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; putlog "[namespace current]: Done..."<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; #This never gets called manually.<br />
&nbsp;&nbsp;&nbsp; proc ScriptUnload {} {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; putlog "[namespace current]: Unloading..."<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; foreach bind [binds [namespace current]*] {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; unbind [lindex $bind 0] [lindex $bind 1] [lindex $bind 2] [lindex $bind 4]<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; putlog "[namespace current]: Done..."<br />
&nbsp;&nbsp;&nbsp; namespace delete [namespace current]<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; #Start<br />
&nbsp;&nbsp;&nbsp; ScriptLoad<br />
}<br />
[/code]]]></description>
            <author>Gotisch</author>
            <pubDate>Sat, 18 Feb 2006 14:00:32 +0100</pubDate>
            <guid>http://tclhelp.net/unb/168</guid>
        </item>
        <item>
            <title>[EGG] Olympia Medaillenspiegel</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=163</link>
            <description><![CDATA[Heyho ihrs,<br />
<br />
hab mich gestern mal fix dran gesetzt und dieses mini script hier gebastelt. <br />
Und da die Spiele nur wenige Tage gehen, post ich es gleich mal hier, evtl gibt es Sportinteressierte die daran interesse haben. <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/wink.png" title=";)" alt=";)" align="middle" class="smilie" /><br />
<br />
<b>Beispielausgabe</b><br />
<br />
[code][01:22:48] &lt;@qzr|maniac&nbsp; &nbsp;&nbsp; &gt; !olympia<br />
[01:22:50] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt; Platz / Land&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; Gold / Silber / Bronze / Ausbeute<br />
[01:22:52] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 1 / Deutschland&nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 7 /&nbsp; &nbsp; &nbsp; 7 /&nbsp; &nbsp; &nbsp; 4 /&nbsp; &nbsp;&nbsp; 18<br />
[01:22:54] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 2 / USA&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 7 /&nbsp; &nbsp; &nbsp; 5 /&nbsp; &nbsp; &nbsp; 3 /&nbsp; &nbsp;&nbsp; 15<br />
[01:22:56] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; - / Österreich&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 7 /&nbsp; &nbsp; &nbsp; 5 /&nbsp; &nbsp; &nbsp; 3 /&nbsp; &nbsp;&nbsp; 15<br />
[01:22:58] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 4 / Russland&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 7 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 5 /&nbsp; &nbsp;&nbsp; 14<br />
[01:23:00] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 5 / Kanada&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 3 /&nbsp; &nbsp; &nbsp; 6 /&nbsp; &nbsp; &nbsp; 5 /&nbsp; &nbsp;&nbsp; 14<br />
[01:23:02] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 6 / Südkorea&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 3 /&nbsp; &nbsp; &nbsp; 3 /&nbsp; &nbsp; &nbsp; 1 /&nbsp; &nbsp; &nbsp; 7<br />
[01:23:04] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 7 / Frankreich&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 3 /&nbsp; &nbsp; &nbsp; 1 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 6<br />
[01:23:06] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 8 / Italien&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 3 /&nbsp; &nbsp; &nbsp; 0 /&nbsp; &nbsp; &nbsp; 4 /&nbsp; &nbsp; &nbsp; 7<br />
[01:23:08] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp;&nbsp; 9 / Estland&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 3 /&nbsp; &nbsp; &nbsp; 0 /&nbsp; &nbsp; &nbsp; 0 /&nbsp; &nbsp; &nbsp; 3<br />
[01:23:10] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp; 10 / Norwegen&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 2 /&nbsp; &nbsp; &nbsp; 7 /&nbsp; &nbsp; &nbsp; 8 /&nbsp; &nbsp;&nbsp; 17<br />
[01:23:12] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp; 11 / Schweiz&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 2 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 4 /&nbsp; &nbsp; &nbsp; 8<br />
[01:23:14] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp; 12 / Schweden&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 2 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 3 /&nbsp; &nbsp; &nbsp; 7<br />
[01:23:15] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp; 13 / Niederlande&nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 2 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 6<br />
[01:23:17] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp; 14 / China&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; &nbsp;&nbsp; 1 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 4 /&nbsp; &nbsp; &nbsp; 7<br />
[01:23:19] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt;&nbsp; &nbsp; 15 / Kroatien&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /&nbsp; &nbsp;&nbsp; 1 /&nbsp; &nbsp; &nbsp; 2 /&nbsp; &nbsp; &nbsp; 0 / <br />
[01:23:37] &lt;@Marv1n&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &gt; Der Medaillenspiegel basiert auf 54 von 84 Entscheidungen. [/code]<br />
<br />
grüsse Jens<br />
<br />
/edit Anzahl der Entscheidungen wurde hinzugefügt<br />
/edit² aktuelle Version <a href="forum.php?req=derefer&amp;url=http%3A%2F%2F217.20.114.205%2Fdownload%2Folympia.tcl" title="http://217.20.114.205/download/olympia.tcl">http://217.20.114.205/download/olympia.tcl</a><br />
<br />
PS: Es basiert auf einem snippet welches hier im Forum gepostet wurde, ich hab lediglich die auswertung und ausgabe geschrieben.]]></description>
            <author>qzr|maniac</author>
            <pubDate>Sun, 12 Feb 2006 16:46:28 +0100</pubDate>
            <guid>http://tclhelp.net/unb/163</guid>
        </item>
        <item>
            <title>[Site] Paste site</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=150</link>
            <description><![CDATA[The paste site has now colors for syntax highlight.. <br />
<br />
<ul><li><a href="http://paste.tclhelp.net">http://paste.tclhelp.net</a></li></ul><br />
Its now easier to find quote errors and wrong command..<br />
<br />
Have fun and good luck ...]]></description>
            <author>CyBex</author>
            <pubDate>Mon, 05 Dec 2005 18:36:36 +0100</pubDate>
            <guid>http://tclhelp.net/unb/150</guid>
        </item>
        <item>
            <title>[EGG] Leo</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=145</link>
            <description><![CDATA[Mein Verbessertes LEO Script kann nun auch Deutsch&lt;&gt;Französisch, mit !leofr &lt;wort&gt; oder "!leo fr &lt;wort&gt;"... <br />
<br />
<a href="http://cybex.b0rk.de/files/tcl/powered/">http://cybex.b0rk.de/files/tcl/powered/</a>]]></description>
            <author>CyBex</author>
            <pubDate>Thu, 01 Dec 2005 23:33:43 +0100</pubDate>
            <guid>http://tclhelp.net/unb/145</guid>
        </item>
        <item>
            <title>[EGG] TV Script (German stations)</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=144</link>
            <description><![CDATA[Mit der Vorarbeit von thommey konnte ein sehr nettes TV Script entstehen, was einem 5 und direkt zum Start einer Sendung im IRC drauf aufmerksam macht... Und es funktioniert auch um 20:15, wo normalerweise die TV-Seiten überlastet sind, da es diese Information bereits irgendwann morgens holt.<br />
Nach dem ersten Start is das Script aber auch nich sofort Einsatzbereit, da es erstmal den Cache füllen muss. Dieses könnt ihr auf der Partyline verfolgen.<br />
<br />
Hier gehts zum Script: <a href="http://cybex.b0rk.de/files/tcl/powered/">http://cybex.b0rk.de/files/tcl/powered/</a><br />
<br />
Eine kleine Anleitung vom Script (is auch oben der Kopf)..<br />
<br />
[quote]Hilfe:<br />
<ol>
<li>!tv &lt;sender&gt;&nbsp; zeigt die nächsten Sendungen<br /></li>
<li>!tvsearch &lt;suchwort&gt;&nbsp; sucht halt überall im Namen nach diesem Suchwort<br /></li>
<li>!tvadd &lt;sender&gt; &lt;sendung&gt;&nbsp; fügt eine Sendung zur Beobachtungliste hinzu, die dann im Channel gemeldet wird.<br /></li>
<li>!tvdel &lt;sender&gt; &lt;sendung&gt;&nbsp; entfernt wieder Sendungen.<br /></li>
<li>!tvlist&nbsp; zeigt alle Sendung an, nach denen Ausschau gehalten wird.<br /></li>
<li>!addhaupt &lt;sender&gt;&nbsp; fügt einen Sender zu den Hauptsender hinzu<br /></li>
<li>!delaupt &lt;sender&gt;&nbsp; entfernt einen Sender von den Hauptsender<br /></li>
<li>!tvhaupt &lt;sender&gt;&nbsp; listet alle Hauptsender auf.<br /></li>
<li>!tv on/off&nbsp; schaltet das script im channel an/aus.<br /></li>
<li>!tv get&nbsp; zeigt die aktuellen Rechte/Flood/Hauptsender einstellung.<br /></li>
<li>!tv set &lt;type&gt; &lt;wert&gt;&nbsp; aendert die aktuelle einstellung, folgende typen sind erlaubt: allow, chanmodes, userflags, flood und haupt(sender).<br /></li>
</ol>
<br />
<br />
Beispiele:<br />
<ol>
<li>!tv rtl (listet die ndchsten 3 Sendung von RTL)<br /></li>
<li>!tv haupt (listet die aktuellen Sendungen von den Hauptsendern)<br /></li>
<li>!tv 2015 (listet die Hauptsender um 20:15 auf)<br /></li>
<li>!tv 23:45 (listet die Hauptsender um 23:45 auf)<br /></li>
<li>!tvsearch Simpsons (sucht nach den Simpsons)<br /></li>
<li>!tvadd pro7 Simpsons (f|gt die Simpsons zur Erinnerungsliste hinzu)<br /></li>
<li>!tvadd pro7 Family Guy (wie bei den Simpsons)<br /></li>
<li>!tvdel pro7 Simps (Entfernt das erste, was auf Simps was, vermutlich die Simpsons)<br /></li>
<li>!tvhaupt (listet alle Hauptsender auf)<br /></li>
<li>!addhaupt ard (f|gt Ard zu den Hauptsender hinzu)<br /></li>
<li>!delhaupt pro7 (lvscht Pro7 von den Hauptsendern)<br /></li>
<li>!tv set allow 5 (f|r Channelmodes und Userflags pr|fung)<br /></li>
<li>!tv set chanmodes op halfop (erlaubt nur f|r OPs die benutzung des TV-Scripts, sofern der Allow-Mode auf eine ChanMode pr|fung steht)<br /></li>
<li>!tv set userflags +nmol|+nmol (erlaubt nur f|r OPs oder grv_er die ..., sofern der Allow-Mode auf eine UserFlag pr|fung steht)<br /></li>
<li>!tv set flood 5:600 (erlaubt 5x in 10 minuten und antwortet danach als Notice und nicht mehr vffentlich)<br /></li>
<li>!tv set haupt ard zdf rbb (ersetzt alle Hauptsender aufeinmal, statt mit !addhaupt einzellne hinzuzuf|gen)<br /></li>
</ol>
<br />
<br />
Config:<br />
<ol>
<li>Und diese werte werden mehr oder weniger auch nur als default Einstellung für die Channels benutzt<br /></li>
<li>Danach wird alles dynamisch im Chanfile gespeichert bzw diese werte wer bei neu hinzugefügten Channels benutzt.<br /></li>
<li>Für spezielle Channel configuration benutzt den .chanset Befehl, zB:<br /></li>
<li>.chanset #chan tv-allow 4<br /></li>
<li>.chanset #chan tv-chanmodes voice op<br /></li>
<li>.chanset #chan tv-userflags +vo-dq<br /></li>
<li>.chanset * tvflood 3:300<br /></li>
<li>Wenn ihr nochmal alle Default(Global) einstellungen laden wollt, könnt ihr das wie folgt machen:<br /></li>
<li>.chanset * tv-allow 0<br /></li>
<li>.chanset #chan tv-chanmodes<br /></li>
<li>.chanset * tv-userflags<br /></li>
<li>.chanset #chan2 tv-flood<br /></li>
<li>Alternativ kann man es mit !tv set &lt;type&gt; &lt;wert&gt; einstellen<br /></li>
</ol>
<br />
global-tv-allow (digit)<br />
<ol>
<li>1 = Alle dürfen und es wird auch kein Chanmode oder Userflag geprüft<br /></li>
<li>2 = Prüft die Chanmodes (isop, isvoice usw)<br /></li>
<li>3 = Prüft die Userflags im Bot (zB +m für master, -dq für alle die nicht voice oder op haben dürfen, +m-dq ein mix aus beidem)<br /></li>
<li>4 = Prüft die Chanmodes oder die Userflags, man braucht also eins von beidem<br /></li>
<li>5 = Prüft die Chanmodes und die Userflags, man braucht also beides<br /></li>
</ol>
set global-tv-allow 1<br />
<br />
global-tv-chan (string)<br />
<ol>
<li>Prüft, wenn "allow" auf 1,3 oder 4 steht.<br /></li>
<li>default: voice halfop op<br /></li>
<li>Darf nie leer ("") sein, regelt das über den allow einsteller! (sonst erkennt der Bot nich, wann er default werte laden soll)<br /></li>
</ol>
set global-tv-chanmodes "voice halfop op"<br />
<br />
global-tv-flags (string)<br />
<ol>
<li>zB +m für master, -dq für alle die nicht voice oder op haben dürfen, +m-dq ein mix aus beidem<br /></li>
<li>* = muss beim Bot geadded sein, muss aber nich unbedingt flags haben.<br /></li>
<li>Darf nie leer ("") sein, regelt das über den allow einsteller!<br /></li>
<li>set global-tv-userflags "+nmolavgf-kdrq|+nmolavgf-kdrq"<br /></li>
</ol>
set global-tv-userflags "*"<br />
<br />
global-tv-flood (digit:digit)<br />
<ol>
<li>Anzahl:Zeit in sekunden, aus is, wenn eins von beidem auf 0 steht.<br /></li>
<li>3:1800 bedeutet, der Bot antwortet 3x öffentlich in 10 Minuten und schaltet dann automatisch die antwort direkt an Nick um<br /></li>
<li>set global-tv-flood 0:0 ; # aus <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/smile.png" title=":)" alt=":)" align="middle" class="smilie" /><br /></li>
</ol>
set global-tv-flood 3:1800<br />
<br />
global-tv-haupt (string)<br />
<ol>
<li>die default haupt sender<br /></li>
</ol>
set global-tv-haupt "pro7 sat1 rtl rtl2 vox"<br />
<br />
tv-show-syntax (boolean 0/1)<br />
<ol>
<li>bei !tv die syntax anzeigen oder gleich die Hauptsender?<br /></li>
</ol>
set tv-show-syntax 0<br />
<br />
<ol>
<li>tv-master (string)<br /></li>
<li>flags die nötig sind, um Einstellungen zu verändert oder das Script an/aus zuschalten.<br /></li>
</ol>
set tv-master "+nmol-kdrq|+nmol-kdrq"<br />
<br />
<ol>
<li>tv-op (string)<br /></li>
<li>flags die nötig sind, um Sendungen/Sender zu verändern<br /></li>
</ol>
set tv-op "+nmoavgfl-kdrq|+nmoavgfl-kdrq"<br />
<br />
<ol>
<li>tv-trigger (char)<br /></li>
</ol>
set tv-trigger "!"[/quote]<br />
<br />
Feedback wäre toll&nbsp; <img src="http://tclhelp.net/unb/bb_designs/_smile/unb/listen.png" title=":listen:" alt=":listen:" align="middle" class="smilie" />]]></description>
            <author>CyBex</author>
            <pubDate>Thu, 01 Dec 2005 23:31:23 +0100</pubDate>
            <guid>http://tclhelp.net/unb/144</guid>
        </item>
        <item>
            <title>Role of this forum</title>
            <link>http://tclhelp.net/unb/forum.php?req=thread&amp;id=27</link>
            <description><![CDATA[This forum is made to allow you opening <b>YOUR WORKING</b> scripts to the public. <br />
To do this, simply create a new thread, put a short, significant description into the subject and a detailed one in the message. After all, append a link to your script.<br />
<br />
<b>This forum is not for requesting help!</b>]]></description>
            <author>Mirage</author>
            <pubDate>Tue, 01 Jun 2004 13:34:36 +0100</pubDate>
            <guid>http://tclhelp.net/unb/27</guid>
        </item>
    </channel>
</rss>
