<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19479" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2013-07-22T00:42:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[darksis]]></name></author>
		<updated>2013-07-22T00:42:07-04:00</updated>

		<published>2013-07-22T00:42:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101876#p101876</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101876#p101876"/>
		<title type="html"><![CDATA[AutoReinvite Script Help.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101876#p101876"><![CDATA[
Hello your script its very cool but when the commands for that?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12047">darksis</a> — Mon Jul 22, 2013 12:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ecoste]]></name></author>
		<updated>2013-07-20T04:40:49-04:00</updated>

		<published>2013-07-20T04:40:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101872#p101872</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101872#p101872"/>
		<title type="html"><![CDATA[AutoReinvite Script Help.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101872#p101872"><![CDATA[
Hello, I'm running AutoReinvite.tcl script on my Eggdrop. The script works, but it only invites people back if they didn't disconnect from the server, if they get kicked or leave the channel the bot re-invites, but if they disconnect from the server the bot doesn't re-invite when they join back. I either didn't do something in the config file or the watch list has an issue. I'm running the bot on SwiftIRC which has the /watch command up and running, anybody know what the issue is? <br><div class="codebox"><p>Code: </p><pre><code># autoReinvite by Artix &lt;loyauflorian@gmail.com&gt;# Version: 1.1 - 30/10/2010## Compatibility: Requires eggdrop 1.6 (1.8 should work too), Tcl8.5/8.6# and the channels, server and irc modules.## Since the script uses the watch list, you'll need to be on an unrealIRCd server# that supports it. I haven't heard of other server type that support it so far.## Note that using other scripts that count on the watchlist at same time is a bad idea.## Contact me by mail at loyauflorian@gmail.com# or on IRC, irc.epiknet.org, channel #eggdrop# ### Script description:## Auto-reinvites (yeah, seriously!) people on a chan under# specific events. ## Features: #- Auto-reinvite on part or kick#- Add to watch list when quitting (or netsplit loss)#- Auto-invite when reconnecting while in watch list# - The watch list is saved in a database file# - Automatic trimming of the database#- Hourly saving of the database#- Invites done only if the guy is not banned on channel#- Fully (but lightly) commented code## Version 1.1:#- Bindings uninstalling now properly working, thanks to MenzAgitat#- Same for bindings that would trigger on EVERY channel. Thanks once more.# - When the watchlist is full, oldest entries are now removed - instead of# removing a random entry from the list.### Note that the database isn't supposed to be modified or# read. Let the script do the stuff, and delete the file# if you want to erase the database.## The database is saved at hourly-updates time set in# the config file, once every hour.# You can change this at the end of the file if needed.## YOU HAVE TO set the chan below in the configuration# for the script to work.## Thanks to thommey of eggheads for fixing# my poor database writing code ._.'# If the file was sourced already, better get rid of everything# before reloading it.if {[info procs ::autoReinvite::uninstall] ne ""} { ::autoReinvite::uninstall }namespace eval ::autoReinvite {#===================## CONFIG START ###===================# UNIQUE chan the script will work onvariable bindedchan "#RuP_HF"# Toggles invitesvariable enabled 1# Path to the watch nick databasevariable watchdb "autoReinvite.db"# Maximum entries in the database# Technical notes: previous entries will be replaced, # the script won't delete any entry while running.# The watch list is only trimmmed when saving.variable maxwatch 500##  CONFIG END  ### Watch List initialisationvariable watchlist {}# Either add or remove the whole watchlist at once # + to add, - to remove allproc modwatch {symbol} {variable watchlist# Add every nick to watch one by oneforeach entry $watchlist {lappend output "$symbol[lindex $entry 0]"}# Send 'em to the server.if {![info exists output]} returnputquick "WATCH [join $output]"}# Loads the watch DB. Done automatically on startup.proc loadWatchDB {} {variable watchdbvariable watchlist# Get rid of ALL previous watches!modwatch -set watchlist {}# Open the new file and load itif {![file exists $watchdb]} returnset channelID [open $watchdb r]set watchlist [gets $channelID]close $channelID# Add the new watchesmodwatch +}# Since we're loading the script, better load the DB too.loadWatchDB# Save the watch dbproc saveWatchDB {args} {variable watchdbvariable watchlistvariable maxwatch# Eventually trim the database if it's too bigif {[llength $watchlist] &gt; $maxwatch} {set watchlist [lrange $watchlist 0 $maxwatch-1]}# Open the file and write the watchlist into itset channelID [open $watchdb w+]puts -nonewline $channelID $watchlistclose $channelID}# Clear watches and bindings, save DB, delete the namespaceproc uninstall {args} {saveWatchDBmodwatch -foreach bind [binds ::autoReinvite::*] {catch { unbind [lindex $bind 0] [lindex $bind 1] [lindex $bind 2] [lindex $bind 4] }}namespace delete ::autoReinvitereturn }# If a watch get detected, invite the guy.proc watchDetection {from keyword data} { set data [split $data]::autoReinvite::invite [lindex $data 1] [lindex $data 2]@[lindex $data 3] }# In case of a part, we reinvite the guy!proc partDetection {nick uhost hand chan reason} { ::autoReinvite::invite $nick $uhost 1 }# In case of a kick, we reinvite the guy!proc kickDetection {nick uhost hand chan victim reason} { ::autoReinvite::invite $victim [getchanhost $victim $chan] 1 }# Invite someone.. if he's not banned!proc invite {nick uhost {override_onchan_check 0}} {# NOTE: We need an argument to override the onchan check# because the bot will say someone that triggered a part# or kick bind is still on channel.variable enabledvariable bindedchan# If the guy's already here, or the script disabled, don't botherif {([onchan $nick $bindedchan] &amp;&amp; !$override_onchan_check) || !$enabled} return# Check every chan ban for a matchforeach line [chanbans $bindedchan] {if {[string match -nocase [string map "\[ \\\[ \] \\\]" [lindex $line 0]] $nick!$uhost]} return}# In case everything's ok, we just invite him.putquick "INVITE $nick $bindedchan"}# Add someone to the watchlist and start# watching him.proc addWatch {nick uhost hand chan reason} {variable bindedchanvariable watchlistvariable maxwatch# Cancel if it's the wrong chanif {$chan ne $bindedchan} return# Clear previous matching watchesif {[clearWatch $nick $uhost $hand 1]} {# Start watching the guy on IRCputquick "WATCH +$nick"}# Add a fresh watch in the listlappend watchlist [list $nick $uhost $hand]# If the watchlist grows too big, we delete the first entry in the listif {([llength $watchlist] - 1) &lt; $maxwatch} {clearWatch {*}[lindex $watchlist 0]}}# Deletes a current watch (on channel join)proc delWatch {nick uhost hand chan args} {variable bindedchan# Just laugh loud if it's the bot joining or wrong chanif {$nick eq $::nick || $chan ne $bindedchan} return# Else remove the watchclearWatch $nick $uhost $hand# Pretty simple eh?return}# Clears a watch from the watchlist# Based on nick/uhost/handle# Stuff matching either one will get removed# Corresponding IRC watchs get removed as wellproc clearWatch {nick uhost hand {nowatch 0}} {variable watchlist# If the list is empty, just gtfo! Might cause errors otherwise.if {![llength $watchlist]} { return 0 }# If the nick matchs an existing watch, remove itif {[set nickIndex [lsearch -exact -index 0 $watchlist $nick]] != -1} { removeEntry $nickIndex # Same for userhost...} elseif {[set uhostIndex [lsearch -exact -index 1 $watchlist $uhost]] != -1} { removeEntry $uhostIndex # ...and handle.} elseif {$hand ne "*" &amp;&amp; [set handIndex [lsearch -exact -index 2 $watchlist $hand]] != -1} { removeEntry $handIndex# If a match was found, we remove the watch on IRC too} else { return 0 }if {!$nowatch} { putquick "WATCH -$nick" }return 1}# Deletes an entry from the watchlist in a conveninent wayproc removeEntry {index} {variable watchlistset watchlist [lreplace $watchlist $index $index]}# Bind on 'logged in' watch messagebind raw - 600 ::autoReinvite::watchDetection# Bind on someone parting to reinvite him asapbind part - "$::autoReinvite::bindedchan *" ::autoReinvite::partDetectionbind kick - "$::autoReinvite::bindedchan *" ::autoReinvite::kickDetection# Bind on someone quitting to add the watchbind sign - "$::autoReinvite::bindedchan *" ::autoReinvite::addWatch# Bind on someone rejoining to remove the watchbind join - "$::autoReinvite::bindedchan *" ::autoReinvite::delWatch# rehash script uninstall bindingbind evnt - prerehash ::autoReinvite::uninstallputlog "autoReinvite by Artix &lt;loyauflorian@gmail.com&gt; loaded succesfully."}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12264">Ecoste</a> — Sat Jul 20, 2013 4:40 am</p><hr />
]]></content>
	</entry>
	</feed>
