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

	<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>2011-10-05T14:19:05-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Arkadietz]]></name></author>
		<updated>2011-10-05T14:19:05-04:00</updated>

		<published>2011-10-05T14:19:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97850#p97850</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97850#p97850"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97850#p97850"><![CDATA[
i found a little bug<br><br><br>[21:15:32] &lt;Kiril&gt; !seen SmasHinG<br>[21:15:33] &lt;Elionor&gt; Kiril: I haven't seen that nick so far. They might not have spoken yet.<br><br>and smashing is on channel may you have to changed to "Nick is in on channel look around you <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7974">Arkadietz</a> — Wed Oct 05, 2011 2:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-09-27T12:31:16-04:00</updated>

		<published>2011-09-27T12:31:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97795#p97795</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97795#p97795"/>
		<title type="html"><![CDATA[minor update]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97795#p97795"><![CDATA[
Script has been moved to a separate repository. New github link is: <br><a href="https://github.com/lee8oi/seend/blob/master/seend.tcl" class="postlink">https://github.com/lee8oi/seend/blob/master/seend.tcl</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Tue Sep 27, 2011 12:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-08-06T19:53:05-04:00</updated>

		<published>2011-08-06T19:53:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97343#p97343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97343#p97343"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97343#p97343"><![CDATA[
There actually is an automatic interval backup system in place. it automatically backs up the seen data at intervals of your choice. Theres a setting for it in the configuration section in the script.<br>the script also backs up the data when the bot is restarted or when '.die' command is used. And restores the data on load. So basically there isn't much to do by hand.<br><blockquote class="uncited"><div>hi <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>you working so hard on this script ,i thank you for this:)<br><br>i already use this on one of my eggdrop but ..i would like to ask that to ..<br><br>this seend backup and restore things is realy been problem for me .. why ?... because i have 6 eggdrops and one mirc-bot running on 4 different servers and i can forgot all of these scripts commands etc..<br><br>so those backup and restore works could be auto ? within this script ..cus i dont connect in every moment with bots partyline for to make kinda things and if bots logout or if shell provider down for awhile .i should restart bot and all seen data fly away...<br><br>my opinion is this script has to creat a seend.db in botdir and it has to make backup and restore seend data with auto timing periods ..<br><br>i have some kinda protection scripts into bot works like this and thats very usefull.i add-load one time and i forget that. cus script works auto and done everything itself..<br><br>thank you ...and excuse me for my bad bad english...i hope i can tell everythings what i've thinking</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Sat Aug 06, 2011 7:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[heartbroken]]></name></author>
		<updated>2011-08-06T19:46:03-04:00</updated>

		<published>2011-08-06T19:46:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97342#p97342</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97342#p97342"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97342#p97342"><![CDATA[
hi <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>you working so hard on this script ,i thank you for this:)<br><br>i already use this on one of my eggdrop but ..i would like to ask that to ..<br><br>this seend backup and restore things is realy been problem for me .. why ?... because i have 6 eggdrops and one mirc-bot running on 4 different servers and i can forgot all of these scripts commands etc..<br><br>so those backup and restore works could be auto ? within this script ..cus i dont connect in every moment with bots partyline for to make kinda things and if bots logout or if shell provider down for awhile .i should restart bot and all seen data fly away...<br><br>my opinion is this script has to creat a seend.db in botdir and it has to make backup and restore seend data with auto timing periods ..<br><br>i have some kinda protection scripts into bot works like this and thats very usefull.i add-load one time and i forget that. cus script works auto and done everything itself..<br><br>thank you ...and excuse me for my bad bad english...i hope i can tell everythings what i've thinking<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11703">heartbroken</a> — Sat Aug 06, 2011 7:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-08-06T16:05:14-04:00</updated>

		<published>2011-08-06T16:05:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97337#p97337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97337#p97337"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97337#p97337"><![CDATA[
Another bugfix related to the nicks with caps.<br>v1.8.3<br><div class="codebox"><p>Code: </p><pre><code>namespace eval seend {######################################################################### Copyright ©2011 lee8oi@gmail.com## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# http://www.gnu.org/licenses/## Seend v1.8.3 (8-6-11)# by: &lt;lee8oiAtgmail&gt;&lt;lee8oiOnfreenode&gt;# egghelp forum: http://forum.egghelp.org/viewtopic.php?t=18493# github link: https://github.com/lee8oi/eggdrop/blob/master/seend.tcl## Original Sseend based on:# Sseen v0.2.22 by samu (IRC: samu@pirc.pl)## ----------------------------------------------------------## Seend is a seen script that will tell you how long ago the bot# last seen the specified nick, what channel they were on, and what their# last message was to that channel. It also allows you to do partial# nick searches using * and even lets you .seen yourself!## Seend uses an automatic system for backing up and restoring seen# data. Which also includes the .seend partyline command for manually# backing up and restoring seen data.## In the config section owners can enable/disable: User name prefixing,# displaying last channel, and displaying last message. Also can set# up Not seen responses, bot search for self response, backup file# location/name, automatic backup interval time, toggle seen requests,# interval backup logging, show time as duration, and public &amp; dcc command triggers.## Initial channel setup:# (starts logging and enables .seen command)# .chanset #channel +seend## Public command syntax:# .seen ?nick|help|*?## DCC (partyline) command syntax:# .seend ?backup|restore?## Example Usage:# (public)# &lt;lee8oi&gt; .seen help# &lt;dukelovett&gt; ~Seend 1.8~ Usage: .seen ?nick|help|*?# &lt;lee8oi&gt; .seen# &lt;dukelovett&gt; lee8oi: I last saw you 1 hour 3 minutes 39 seconds ago on# #dukelovett. Last message: Sseen script was awsome. My version improves on it.# &lt;lee8oi&gt; .seen dukelovett# &lt;dukelovett&gt; lee8oi: I last saw myself just now. Right here.# &lt;lee8oi&gt; .seen lee*# &lt;dukelovett&gt; lee8oi: The pattern 'lee*' matches: lee8oi## (console)# &lt;lee8oi&gt; .seend# &lt;dukelovett&gt; ~Seend 1.8~ Usage: Seend ?backup|restore?# &lt;lee8oi&gt; .seend backup# &lt;dukelovett&gt; Seend data backup performed.# &lt;lee8oi&gt; .seend restore# &lt;dukelovett&gt; Seend data restore performed.## Note:# Automatic backup system saves seen data on .die &amp; .restart and# restores data on load. Interval backups are every 15 mins by default.## Thanks:# Thanks to thommey, nml375, and jack3 for their great code suggestions# and all the helpful answers that made this script possible.## Updates:# v1.8# 1. Added configuration for enabling/disabling interval backup logging.# 2. Added configuration to enable/disable showing last seen time as duration.# 3. Created get_info procedure to grab seen info and format the output# message according to configuration.## v1.8 new fixes:# 1. Fixed bug in seend data saving. Script now correctly ignores lines that# start with the currently set public seen command trigger. Which can # now also be set in configuration along with the dcc trigger.# 2. Fixed bug that prevented names with caps from being retrieved correctly# 3. Fixed another bug with caps issues.## ----------------------------------------------------------# CONFIGURATION# ----------------------------------------------------------## Public command trigger variable pubCmd !seen## DCC command triggervariable dccCmd seend## Not Seen Responses## note: Escape special characters with '\' example: '\{'# in the message.### 1.When users supply their own nick or no nick, and bot has NOT seen them:set isUsersOwn "I haven't seen you yet. Say something."### 2.When users supply an other nick and bot has NOT seen it yet:set isOtherUser "I haven't seen that nick so far. They might not have spoken yet."### 3.When users supply the bots own name:set isBotsName "I last saw myself just now! Right here."## ----------------------------------------------------------# Seen Results# (0=disable,1=enable)### 1.Prefix results with users name.variable usename 1### 3.Show last channel in results.variable showchannel 1### 2.Show last message in results.variable showmessage 1### 3.Show last seen time as duration. (1=enable,0=disable)# (off shows date and time instead)variable showduration 1### ----------------------------------------------------------# Backup file### Set relative path to backup file.variable backupfile "scripts/SeendData.tcl"### set backup interval time in minutes.variable interval 15### log interval backups. Uses 'putlog'. (1=enable,0=disable)variable logintervals 0### log .seen requests. Uses 'putlog'. (1=enable,0=disable)variable logseens 0## ----------------------------------------------------------# END CONFIGURATION## NOTE: Only edit below if you know what you are doing. Any# Incorrectly editing code can cause undesirable results.#####################################################################variable isUsersOwn [split $isUsersOwn]variable isOtherUser [split $isOtherUser]variable isBotsName [split $isBotsName]variable lastseenvariable lastchanvariable lastmsgvariable ver "1.8.3"}bind pubm - * ::seend::pub_msg_savebind sign - * ::seend::pub_msg_savebind pub - [set ::seend::pubCmd] ::seend::pub_show_seenbind evnt - prerestart ::seend::prerestartbind evnt - loaded ::seend::loadedbind dcc n [set ::seend::dccCmd] ::seend::dccsetudef flag seendif {![info exists ::seend_dietrace]} {   # .die trigger. do backup   trace add execution *dcc:die enter ::seend::backup   trace add execution *msg:die enter ::seend::backup}if {![info exists timer_running]} {   # no existing timer. start new one.   timer [set seend::interval] ::seend::timer_proc   set timer_running 1}namespace eval seend {   proc restore {args} {      # restore from file      source [set seend::backupfile]   }   proc prerestart {type} {      # prerestart trigger. do backup.      ::seend::backup      putlog "Seend data saved."   }   proc loaded {type} {      # bot loaded trigger do restore.      ::seend::restore      putlog "Seend data restored."   }      proc timer_proc {args} {      # call self at timed intervals. do backup      ::seend::backup      timer [set seend::interval] ::seend::timer_proc      if {[set seend::logintervals]} {         # logging is enabled.         putlog "Interval Seend backup performed."      }      return 1   }   proc backup {args} {      # backup to file: Write lines to file so it can      # be sourced as a script during restore.      variable ::seend::lastseen      variable ::seend::lastchan      variable ::seend::lastmsg      set fs [open [set seend::backupfile] w+]      # write variable lines for loading namespace vars.      puts $fs "variable ::seend::lastseen"      puts $fs "variable ::seend::lastchan"      puts $fs "variable ::seend::lastmsg"      # create 'array set' lines using array data.      foreach arr {lastseen lastchan lastmsg} {         puts $fs "array set $arr [list [array get $arr]]"      }      close $fs;   }   proc dcc {handle idx text} {      # dcc/partyline .seend command      set text [string tolower [lindex [split $text] 0]]      if {$text == "" || $text == "help"} {         # show help.         variable ::seend::ver         putdcc $idx "~Seend $ver~ Usage: .[set ::seend::dccCmd] ?backup|restore?"      } elseif {$text == "backup"} {         # run backup procedure.         ::seend::backup         putdcc $idx "Seend data saved."      } elseif {$text == "restore"} {         # run restore procedure.         ::seend::restore         putdcc $idx "Seend data restored."      }   }   proc pub_msg_save {nick userhost handle channel text} {      # grab seen data from channel message.      set first [lindex [split $text] 0]      if {[channel get $channel seend]} {         # channel has seend flag         if {$first != [set ::seend::pubCmd]} {            # not a .seen request. Ok to save.            set seend::lastseen($nick) [clock seconds]            set seend::lastchan($nick) $channel            set seend::lastmsg($nick) $text         } else {            variable ::seend::logseens            if {$logseens} {               putlog "New .seen request from $nick: $text"            }         }      }   }   proc get_info {nick who} {      variable ::seend::lastseen      variable ::seend::lastchan      variable ::seend::lastmsg      set chanmsg ""      set storedmsg ""      set time $lastseen($who)      if {[set ::seend::showduration] == 1} {         set last "[duration [expr {[clock seconds] - $time}]] ago"      } else {         set last [string map {"\n" ""} [clock format $time -format {%Y/%m/%d %H:%M:%S}]]      }      if {[set seend::showchannel]} {         # showchannel is enabled. Add last channel.         set chanmsg " on $lastchan($who)"      }      if {[set seend::showmessage]} {         # show message is enabled. Add last message.         set storedmsg " Last message: $lastmsg($who)"      }      if {$nick == $who} {         set result "I last saw you $last${chanmsg}.${storedmsg}"      } else {         set result "I last saw $who $last${chanmsg}.${storedmsg}"      }      return $result   }   proc pub_show_seen {nick userhost handle channel text} {      # Retrive and display seen info or help.      if {[channel get $channel seend]} {         variable ::seend::lastseen         variable ::seend::lastchan         variable ::seend::lastmsg         set name ""         set chanmsg ""         set storedmsg ""         # channel has sseen flag set         set otext [lindex [split $text] 0]          set ctext [string tolower $otext]         if {[set seend::usename]} {            # usename is enabled. Add nick.            set name "${nick}: "         }         if {$ctext == "help"} {            # No args supplied. Show help:            variable ::seend::ver            putserv "PRIVMSG $channel :~Seend $ver~ Usage: [set ::seend::pubCmd] ?nick|help|\*?"         } elseif {[isbotnick $otext]} {            # User supplied bots name as arg            variable ::seend::isBotsName            putserv "PRIVMSG $channel :${name}[join [lrange $isBotsName 0 end]]"         } elseif {[regexp {\*} $otext]} {            # text includes a * so it must be a pattern search.            set namelist [array names lastseen $otext]            if { $namelist != "" } {               # names matching pattern exist.               putserv "PRIVMSG $channel :${name}The pattern '${otext}' matches: ${namelist}"            } else {               # no names match pattern.               putserv "PRIVMSG $channel :${name}No match found for '${otext}'."            }         } elseif {$otext == $nick || $otext == ""} {            # User supplied their own name or no name.            if {[info exists lastseen($nick)]} {               # seen data available               set output [::seend::get_info $nick $nick]               putserv "PRIVMSG $channel :${name}$output"            } else {               # seen data not available.               variable ::seend::isUsersOwn               putserv "PRIVMSG $channel :${name}${isUsersOwn}"            }         } else {            # User supplied other user name            if {[info exists lastseen($otext)]} {               # seen data available               set output [::seend::get_info $nick $otext]               putserv "PRIVMSG $channel :${name}$output"            } else {               # seen data not available.               variable ::seend::isOtherUser               putserv "PRIVMSG $channel :${name}${isOtherUser}"            }         }      }   }   namespace export backup restore prerestart loaded dcc pub_msg_save pub_show_seen}putlog "Seend [set ::seend::ver] loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Sat Aug 06, 2011 4:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-08-05T20:29:16-04:00</updated>

		<published>2011-08-05T20:29:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97332#p97332</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97332#p97332"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.2]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97332#p97332"><![CDATA[
v1.8.2 fixes:<br>1. Fixed bug in seend data saving. Script now correctly ignores lines that start with the currently set public seen command trigger. Which can now also be set in configuration along with the dcc trigger.<br>2. Fixed bug that prevented names with caps from being retrieved correctly<br><div class="codebox"><p>Code: </p><pre><code>namespace eval seend {######################################################################### Copyright ©2011 lee8oi@gmail.com## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# http://www.gnu.org/licenses/## Seend v1.8.2 (8-5-11-8)# by: &lt;lee8oiAtgmail&gt;&lt;lee8oiOnfreenode&gt;# egghelp forum: http://forum.egghelp.org/viewtopic.php?t=18493# github link: https://github.com/lee8oi/eggdrop/blob/master/seend.tcl## Original Sseend based on:# Sseen v0.2.22 by samu (IRC: samu@pirc.pl)## ----------------------------------------------------------## Seend is a seen script that will tell you how long ago the bot# last seen the specified nick, what channel they were on, and what their# last message was to that channel. It also allows you to do partial# nick searches using * and even lets you .seen yourself!## Seend uses an automatic system for backing up and restoring seen# data. Which also includes the .seend partyline command for manually# backing up and restoring seen data.## In the config section owners can enable/disable: User name prefixing,# displaying last channel, and displaying last message. Also can set# up Not seen responses, bot search for self response, backup file# location/name, automatic backup interval time, toggle seen requests,# interval backup logging, show time as duration, and public &amp; dcc command triggers.## Initial channel setup:# (starts logging and enables .seen command)# .chanset #channel +seend## Public command syntax:# .seen ?nick|help|*?## DCC (partyline) command syntax:# .seend ?backup|restore?## Example Usage:# (public)# &lt;lee8oi&gt; .seen help# &lt;dukelovett&gt; ~Seend 1.8~ Usage: .seen ?nick|help|*?# &lt;lee8oi&gt; .seen# &lt;dukelovett&gt; lee8oi: I last saw you 1 hour 3 minutes 39 seconds ago on# #dukelovett. Last message: Sseen script was awsome. My version improves on it.# &lt;lee8oi&gt; .seen dukelovett# &lt;dukelovett&gt; lee8oi: I last saw myself just now. Right here.# &lt;lee8oi&gt; .seen lee*# &lt;dukelovett&gt; lee8oi: The pattern 'lee*' matches: lee8oi## (console)# &lt;lee8oi&gt; .seend# &lt;dukelovett&gt; ~Seend 1.8~ Usage: Seend ?backup|restore?# &lt;lee8oi&gt; .seend backup# &lt;dukelovett&gt; Seend data backup performed.# &lt;lee8oi&gt; .seend restore# &lt;dukelovett&gt; Seend data restore performed.## Note:# Automatic backup system saves seen data on .die &amp; .restart and# restores data on load. Interval backups are every 15 mins by default.## Thanks:# Thanks to thommey, nml375, and jack3 for their great code suggestions# and all the helpful answers that made this script possible.## Updates:# v1.8# 1. Added configuration for enabling/disabling interval backup logging.# 2. Added configuration to enable/disable showing last seen time as duration.# 3. Created get_info procedure to grab seen info and format the output# message according to configuration.## v1.8 new fixes:# 1. Fixed bug in seend data saving. Script now correctly ignores lines that# start with the currently set public seen command trigger. Which can # now also be set in configuration along with the dcc trigger.# 2. Fixed bug that prevented names with caps from being retrieved correctly# # ----------------------------------------------------------# CONFIGURATION# ----------------------------------------------------------## Public command trigger variable pubCmd !seen## DCC command triggervariable dccCmd seend## Not Seen Responses## note: Escape special characters with '\' example: '\{'# in the message.### 1.When users supply their own nick or no nick, and bot has NOT seen them:set isUsersOwn "I haven't seen you yet. Say something."### 2.When users supply an other nick and bot has NOT seen it yet:set isOtherUser "I haven't seen that nick so far. They might not have spoken yet."### 3.When users supply the bots own name:set isBotsName "I last saw myself just now! Right here."## ----------------------------------------------------------# Seen Results# (0=disable,1=enable)### 1.Prefix results with users name.variable usename 1### 3.Show last channel in results.variable showchannel 1### 2.Show last message in results.variable showmessage 1### 3.Show last seen time as duration. (1=enable,0=disable)# (off shows date and time instead)variable showduration 1### ----------------------------------------------------------# Backup file### Set relative path to backup file.variable backupfile "scripts/SeendData.tcl"### set backup interval time in minutes.variable interval 15### log interval backups. Uses 'putlog'. (1=enable,0=disable)variable logintervals 0### log .seen requests. Uses 'putlog'. (1=enable,0=disable)variable logseens 0## ----------------------------------------------------------# END CONFIGURATION## NOTE: Only edit below if you know what you are doing. Any# Incorrectly editing code can cause undesirable results.#####################################################################variable isUsersOwn [split $isUsersOwn]variable isOtherUser [split $isOtherUser]variable isBotsName [split $isBotsName]variable lastseenvariable lastchanvariable lastmsgvariable ver "1.8.2"}bind pubm - * ::seend::pub_msg_savebind sign - * ::seend::pub_msg_savebind pub - [set ::seend::pubCmd] ::seend::pub_show_seenbind evnt - prerestart ::seend::prerestartbind evnt - loaded ::seend::loadedbind dcc n [set ::seend::dccCmd] ::seend::dccsetudef flag seendif {![info exists ::seend_dietrace]} {   # .die trigger. do backup   trace add execution *dcc:die enter ::seend::backup   trace add execution *msg:die enter ::seend::backup}if {![info exists timer_running]} {   # no existing timer. start new one.   timer [set seend::interval] ::seend::timer_proc   set timer_running 1}namespace eval seend {   proc restore {args} {      # restore from file      source [set seend::backupfile]   }   proc prerestart {type} {      # prerestart trigger. do backup.      ::seend::backup      putlog "Seend data saved."   }   proc loaded {type} {      # bot loaded trigger do restore.      ::seend::restore      putlog "Seend data restored."   }      proc timer_proc {args} {      # call self at timed intervals. do backup      ::seend::backup      timer [set seend::interval] ::seend::timer_proc      if {[set seend::logintervals]} {         # logging is enabled.         putlog "Interval Seend backup performed."      }      return 1   }   proc backup {args} {      # backup to file: Write lines to file so it can      # be sourced as a script during restore.      variable ::seend::lastseen      variable ::seend::lastchan      variable ::seend::lastmsg      set fs [open [set seend::backupfile] w+]      # write variable lines for loading namespace vars.      puts $fs "variable ::seend::lastseen"      puts $fs "variable ::seend::lastchan"      puts $fs "variable ::seend::lastmsg"      # create 'array set' lines using array data.      foreach arr {lastseen lastchan lastmsg} {         puts $fs "array set $arr [list [array get $arr]]"      }      close $fs;   }   proc dcc {handle idx text} {      # dcc/partyline .seend command      set text [string tolower [lindex [split $text] 0]]      if {$text == "" || $text == "help"} {         # show help.         variable ::seend::ver         putdcc $idx "~Seend $ver~ Usage: .[set ::seend::dccCmd] ?backup|restore?"      } elseif {$text == "backup"} {         # run backup procedure.         ::seend::backup         putdcc $idx "Seend data saved."      } elseif {$text == "restore"} {         # run restore procedure.         ::seend::restore         putdcc $idx "Seend data restored."      }   }   proc pub_msg_save {nick userhost handle channel text} {      # grab seen data from channel message.      set first [string tolower [lindex [split $text] 0]]      if {[channel get $channel seend]} {         # channel has seend flag         if {$first != [set ::seend::pubCmd]} {            # not a .seen request. Ok to save.            set seend::lastseen($nick) [clock seconds]            set seend::lastchan($nick) $channel            set seend::lastmsg($nick) $text         } else {            variable ::seend::logseens            if {$logseens} {               putlog "New .seen request from $nick: $text"            }         }      }   }   proc get_info {nick who} {      variable ::seend::lastseen      variable ::seend::lastchan      variable ::seend::lastmsg      set chanmsg ""      set storedmsg ""      set time $lastseen($who)      if {[set ::seend::showduration] == 1} {         set last "[duration [expr {[clock seconds] - $time}]] ago"      } else {         set last [string map {"\n" ""} [clock format $time -format {%Y/%m/%d %H:%M:%S}]]      }      if {[set seend::showchannel]} {         # showchannel is enabled. Add last channel.         set chanmsg " on $lastchan($who)"      }      if {[set seend::showmessage]} {         # show message is enabled. Add last message.         set storedmsg " Last message: $lastmsg($who)"      }      if {$nick == $who} {         set result "I last saw you $last${chanmsg}.${storedmsg}"      } else {         set result "I last saw $who $last${chanmsg}.${storedmsg}"      }      return $result   }   proc pub_show_seen {nick userhost handle channel text} {      # Retrive and display seen info or help.      if {[channel get $channel seend]} {         variable ::seend::lastseen         variable ::seend::lastchan         variable ::seend::lastmsg         set name ""         set chanmsg ""         set storedmsg ""         # channel has sseen flag set         set otext [lindex [split $text] 0]          set text [string tolower $otext]         if {[set seend::usename]} {            # usename is enabled. Add nick.            set name "${nick}: "         }         if {$text == "help"} {            # No args supplied. Show help:            variable ::seend::ver            putserv "PRIVMSG $channel :~Seend $ver~ Usage: [set ::seend::pubCmd] ?nick|help|\*?"         } elseif {[isbotnick $text]} {            # User supplied bots name as arg            variable ::seend::isBotsName            putserv "PRIVMSG $channel :${name}[join [lrange $isBotsName 0 end]]"         } elseif {[regexp {\*} $text]} {            # text includes a * so it must be a pattern search.            set namelist [array names lastseen $text]            if { $namelist != "" } {               # names matching pattern exist.               putserv "PRIVMSG $channel :${name}The pattern '${text}' matches: ${namelist}"            } else {               # no names match pattern.               putserv "PRIVMSG $channel :${name}No match found for '${text}'."            }         } elseif {$text == $nick || $text == ""} {            # User supplied their own name or no name.            if {[info exists lastseen($nick)]} {               # seen data available               set output [::seend::get_info $nick $nick]               putserv "PRIVMSG $channel :${name}$output"            } else {               # seen data not available.               variable ::seend::isUsersOwn               putserv "PRIVMSG $channel :${name}${isUsersOwn}"            }         } else {            # User supplied other user name            if {[info exists lastseen($otext)]} {               # seen data available               set output [::seend::get_info $nick $otext]               putserv "PRIVMSG $channel :${name}$output"            } else {               # seen data not available.               variable ::seend::isOtherUser               putserv "PRIVMSG $channel :${name}${isOtherUser}"            }         }      }   }   namespace export backup restore prerestart loaded dcc pub_msg_save pub_show_seen}putlog "Seend [set ::seend::ver] loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Fri Aug 05, 2011 8:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-30T14:58:04-04:00</updated>

		<published>2011-06-30T14:58:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97136#p97136</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97136#p97136"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97136#p97136"><![CDATA[
Updates:<br>v1.8<br>    1. Added configuration for enabling/disabling interval backup logging.<br>    2. Added configuration to enable/disable showing last seen time as duration.<br>    3. Created get_info procedure to grab seen info and format the output<br>    message according to configuration.<div class="codebox"><p>Code: </p><pre><code>namespace eval seend {#########################################################################   Copyright ©2011 lee8oi@gmail.com##   This program is free software; you can redistribute it and/or modify#   it under the terms of the GNU General Public License as published by#   the Free Software Foundation; either version 2 of the License, or#   (at your option) any later version.##   This program is distributed in the hope that it will be useful,#   but WITHOUT ANY WARRANTY; without even the implied warranty of#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#   GNU General Public License for more details.#   http://www.gnu.org/licenses/##   Seend v1.8 (6-8-11)#   by: &lt;lee8oiAtgmail&gt;&lt;lee8oiOnfreenode&gt;#   egghelp forum: http://forum.egghelp.org/viewtopic.php?t=18493#   github link: https://github.com/lee8oi/eggdrop/blob/master/seend.tcl##   Original Sseend based on:#   Sseen v0.2.22 by samu (IRC: samu@pirc.pl)##    ----------------------------------------------------------##   Seend is a seen script that will tell you how long ago the bot#   last seen the specified nick, what channel they were on, and what their#   last message was to that channel. It also allows you to do partial#   nick searches using * and even lets you .seen yourself!##   Seend uses an automatic system for backing up and restoring seen#   data. Which also includes the .seend partyline command for manually#   backing up and restoring seen data.##   In the config section owners can enable/disable: User name prefixing,#   displaying last channel, and displaying last message. Also can set#   up Not seen responses, bot search for self response, backup file#   location/name, automatic backup interval time, toggle seen requests,#   interval backup logging, and show time as duration.##   Initial channel setup:#   (starts logging and enables .seen command)#    .chanset #channel +seend##   Public command syntax:#    .seen ?nick|help|*?##   DCC (partyline) command syntax:#    .seend ?backup|restore?##   Example Usage:#    (public)#    &lt;lee8oi&gt; .seen help#    &lt;dukelovett&gt; ~Seend 1.8~ Usage: .seen ?nick|help|*?#    &lt;lee8oi&gt; .seen#    &lt;dukelovett&gt; lee8oi: I last saw you 1 hour 3 minutes 39 seconds ago on#    #dukelovett. Last message: Sseen script was awsome. My version improves on it.#    &lt;lee8oi&gt; .seen dukelovett#    &lt;dukelovett&gt; lee8oi: I last saw myself just now. Right here.#    &lt;lee8oi&gt; .seen lee*#    &lt;dukelovett&gt; lee8oi: The pattern 'lee*' matches: lee8oi##    (console)#    &lt;lee8oi&gt; .seend#    &lt;dukelovett&gt; ~Seend 1.8~ Usage: Seend ?backup|restore?#    &lt;lee8oi&gt; .seend backup#    &lt;dukelovett&gt; Seend data backup performed.#    &lt;lee8oi&gt; .seend restore#    &lt;dukelovett&gt; Seend data restore performed.##   Note:#    Automatic backup system saves seen data on .die &amp; .restart and#    restores data on load. Interval backups are every 15 mins by default.##   Thanks:#    Thanks to thommey, nml375, and jack3 for their great code suggestions#    and all the helpful answers that made this script possible.##   Updates:#    v1.8#     1. Added configuration for enabling/disabling interval backup logging.#     2. Added configuration to enable/disable showing last seen time as duration.#     3. Created get_info procedure to grab seen info and format the output#     message according to configuration.##    ----------------------------------------------------------#           CONFIGURATION#    ----------------------------------------------------------#                       Not Seen Responses##   note: Escape special characters with '\' example: '\{'#   in the message.#   ##  1.When users supply their own nick or no nick, and bot has NOT seen them:set isUsersOwn "I haven't seen you yet. Say something."###  2.When users supply an other nick and bot has NOT seen it yet:set isOtherUser "I haven't seen that nick so far. They might not have spoken yet."###  3.When users supply the bots own name:set isBotsName "I last saw myself just now! Right here."##    ----------------------------------------------------------#                        Seen Results#   (0=disable,1=enable)###  1.Prefix results with users name.variable usename 1###  3.Show last channel in results.variable showchannel 1###  2.Show last message in results.variable showmessage 1###  3.Show last seen time as duration. (1=enable,0=disable)#  (off shows date and time instead)variable showduration 1###    ----------------------------------------------------------#                        Backup file### Set relative path to backup file.variable backupfile "scripts/SeendData.tcl"### set backup interval time in minutes.variable interval 15### log interval backups. Uses 'putlog'. (1=enable,0=disable)variable logintervals 0### log .seen requests. Uses 'putlog'. (1=enable,0=disable)variable logseens 0##    ----------------------------------------------------------#                      END CONFIGURATION##  NOTE: Only edit below if you know what you are doing. Any#  Incorrectly editing code can cause undesirable results.#####################################################################variable isUsersOwn [split $isUsersOwn]variable isOtherUser [split $isOtherUser]variable isBotsName [split $isBotsName]variable lastseenvariable lastchanvariable lastmsgvariable ver "1.8"}bind pubm - * ::seend::pub_msg_savebind sign - * ::seend::pub_msg_savebind pub - .seen ::seend::pub_show_seenbind evnt - prerestart ::seend::prerestartbind evnt - loaded ::seend::loadedbind dcc n seend ::seend::dccsetudef flag seendif {![info exists ::seend_dietrace]} {   # .die trigger. do backup   trace add execution *dcc:die enter ::seend::backup   trace add execution *msg:die enter ::seend::backup}if {![info exists timer_running]} {   # no existing timer. start new one.   timer [set seend::interval] ::seend::timer_proc   set timer_running 1}namespace eval seend {   proc restore {args} {      # restore from file      source [set seend::backupfile]   }   proc prerestart {type} {      # prerestart trigger. do backup.      ::seend::backup      putlog "Seend data saved."   }   proc loaded {type} {      # bot loaded trigger do restore.      ::seend::restore      putlog "Seend data restored."   }      proc timer_proc {args} {      # call self at timed intervals. do backup      ::seend::backup      timer [set seend::interval] ::seend::timer_proc      if {[set seend::logintervals]} {         # logging is enabled.         putlog "Interval Seend backup performed."      }      return 1   }   proc backup {args} {      # backup to file: Write lines to file so it can      # be sourced as a script during restore.      variable ::seend::lastseen      variable ::seend::lastchan      variable ::seend::lastmsg      set fs [open [set seend::backupfile] w+]      # write variable lines for loading namespace vars.      puts $fs "variable ::seend::lastseen"      puts $fs "variable ::seend::lastchan"      puts $fs "variable ::seend::lastmsg"      # create 'array set' lines using array data.      foreach arr {lastseen lastchan lastmsg} {         puts $fs "array set $arr [list [array get $arr]]"      }      close $fs;   }   proc dcc {handle idx text} {      # dcc/partyline .seend command      set text [string tolower [lindex [split $text] 0]]      if {$text == "" || $text == "help"} {         # show help.         variable ::seend::ver         putdcc $idx "~Seend $ver~ Usage: Seend ?backup|restore?"      } elseif {$text == "backup"} {         # run backup procedure.         ::seend::backup         putdcc $idx "Seend data saved."      } elseif {$text == "restore"} {         # run restore procedure.         ::seend::restore         putdcc $idx "Seend data restored."      }   }   proc pub_msg_save {nick userhost handle channel text} {      # grab seen data from channel message.      set first [string tolower [lindex [split $text] 0]]      if {[channel get $channel seend]} {         # channel has seend flag         if {$first != ".seen"} {            # not a .seen request. Ok to save.            set seend::lastseen($nick) [clock seconds]            set seend::lastchan($nick) $channel            set seend::lastmsg($nick) $text         } else {            variable ::seend::logseens            if {$logseens} {               putlog "New .seen request from $nick: $text"            }         }      }   }   proc get_info {nick who} {      variable ::seend::lastseen      variable ::seend::lastchan      variable ::seend::lastmsg      set chanmsg ""      set storedmsg ""      set time $lastseen($who)      if {[set ::seend::showduration] == 1} {         set last "[duration [expr {[clock seconds] - $time}]] ago"      } else {         set last [string map {"\n" ""} [clock format $time -format {%Y/%m/%d %H:%M:%S}]]      }      if {[set seend::showchannel]} {         # showchannel is enabled. Add last channel.         set chanmsg " on $lastchan($who)"      }      if {[set seend::showmessage]} {         # show message is enabled. Add last message.         set storedmsg " Last message: $lastmsg($who)"      }      if {$nick == $who} {         set result "I last saw you $last${chanmsg}.${storedmsg}"      } else {         set result "I last saw $who $last${chanmsg}.${storedmsg}"      }      return $result   }   proc pub_show_seen {nick userhost handle channel text} {      # Retrive and display seen info or help.      if {[channel get $channel seend]} {         variable ::seend::lastseen         variable ::seend::lastchan         variable ::seend::lastmsg         set name ""         set chanmsg ""         set storedmsg ""         # channel has sseen flag set         set text [string tolower [lindex [split $text] 0]]         if {[set seend::usename]} {            # usename is enabled. Add nick.            set name "${nick}: "         }         if {$text == "help"} {            # No args supplied. Show help:            variable ::seend::ver            putserv "PRIVMSG $channel :~Seend $ver~ Usage: .seen ?nick|help|\*?"         } elseif {[isbotnick $text]} {            # User supplied bots name as arg            variable ::seend::isBotsName            putserv "PRIVMSG $channel :${name}[join [lrange $isBotsName 0 end]]"         } elseif {[regexp {\*} $text]} {            # text includes a * so it must be a pattern search.            set namelist [array names lastseen $text]            if { $namelist != "" } {               # names matching pattern exist.               putserv "PRIVMSG $channel :${name}The pattern '${text}' matches: ${namelist}"            } else {               # no names match pattern.               putserv "PRIVMSG $channel :${name}No match found for '${text}'."            }         } elseif {$text == $nick || $text == ""} {            # User supplied their own name or no name.            if {[info exists lastseen($nick)]} {               # seen data available               set output [::seend::get_info $nick $nick]               putserv "PRIVMSG $channel :${name}$output"            } else {               # seen data not available.               variable ::seend::isUsersOwn               putserv "PRIVMSG $channel :${name}${isUsersOwn}"            }         } else {            # User supplied other user name            if {[info exists lastseen($text)]} {               # seen data available               set output [::seend::get_info $nick $text]               putserv "PRIVMSG $channel :${name}$output"            } else {               # seen data not available.               variable ::seend::isOtherUser               putserv "PRIVMSG $channel :${name}${isOtherUser}"            }         }      }   }   namespace export backup restore prerestart loaded dcc pub_msg_save pub_show_seen}putlog "Seend [set ::seend::ver] loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Thu Jun 30, 2011 2:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-14T08:31:00-04:00</updated>

		<published>2011-06-14T08:31:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97021#p97021</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97021#p97021"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97021#p97021"><![CDATA[
<blockquote class="uncited"><div>Link? <br><br>:&gt;</div></blockquote>The code is posted its really mostly a copy and paste job. They don't update the archive much. But you can paste it into an editor and save it in the scripts dir then add the appropriate source line to your eggdrop.conf and it will work the same. 'seend.tcl' isn't a bad choice for a file name.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Tue Jun 14, 2011 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kurthalis]]></name></author>
		<updated>2011-06-14T01:45:25-04:00</updated>

		<published>2011-06-14T01:45:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97018#p97018</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97018#p97018"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97018#p97018"><![CDATA[
Link? <br><br>:&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11687">Kurthalis</a> — Tue Jun 14, 2011 1:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-08T15:23:32-04:00</updated>

		<published>2011-06-08T15:23:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97001#p97001</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97001#p97001"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.7]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97001#p97001"><![CDATA[
Updates:<br>   v1.7<br>    1. Removed 'me' feature. Simply because someone might just use that for a nickname one day.(thanks ente)<br>    2. Help is now accessed by using '.seen help'. Running .seen without a nick is the same as running seen on your own nick.<br>    3. Partyline command '.seend' can now use 'help' or no arg to display  command help.<br>    4. Added automatic interval backup system. Including config section for setting the interval time in minutes.<br>    5. Added pattern searching. Users can now use partial names with * to see matching names in the seen database.<br>    6. Added .seen request logging which uses 'putlog'. This can be turned on &amp; off in the config section.<br>    7. Cleaned up namespace variable references and made minor code changes to reduce unnecessary references. Also tried to move  smaller code bits higher up in procs for quicker execution.<div class="codebox"><p>Code: </p><pre><code>namespace eval seend {#########################################################################   Copyright ©2011 lee8oi@gmail.com##   This program is free software; you can redistribute it and/or modify#   it under the terms of the GNU General Public License as published by#   the Free Software Foundation; either version 2 of the License, or#   (at your option) any later version.##   This program is distributed in the hope that it will be useful,#   but WITHOUT ANY WARRANTY; without even the implied warranty of#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#   GNU General Public License for more details.#   http://www.gnu.org/licenses/##   Seend v1.7 (6-8-11)#   by: &lt;lee8oiAtgmail&gt;&lt;lee8oiOnfreenode&gt;##   Original Sseend based on:#   Sseen v0.2.22 by samu (IRC: samu@pirc.pl)##    ----------------------------------------------------------##   Seend is a seen script that will tell you how long ago the bot#   last seen the specified nick, what channel they were on, and what their#   last message was to that channel. It also allows you to do partial#   nick searches using * and even lets you .seen yourself!##   Seend uses an automatic system for backing up and restoring seen#   data. Which also includes the .seend partyline command for manually#   backing up and restoring seen data.##   In the config section owners can enable/disable: User name prefixing,#   displaying last channel, and displaying last message. And can also set#   up Not seen responses, bot search for self response, backup file#   location/name, automatic backup interval time, and toggle log seen requests.##   Initial channel setup:#   (starts logging and enables .seen command)#    .chanset #channel +seend##   Public command syntax:#    .seen ?nick|help|*?##   DCC (partyline) command syntax:#    .seend ?backup|restore?##   Example Usage:#    (public)#    &lt;lee8oi&gt; .seen help#    &lt;dukelovett&gt; ~Seend 1.7~ Usage: .seen ?nick|help|*?#    &lt;lee8oi&gt; .seen#    &lt;dukelovett&gt; lee8oi: I last saw you 1 hour 3 minutes 39 seconds ago on#    #dukelovett. Last message: Sseen script was awsome. My version improves on it.#    &lt;lee8oi&gt; .seen dukelovett#    &lt;dukelovett&gt; lee8oi: I last saw myself just now. Right here.#    &lt;lee8oi&gt; .seen lee*#    &lt;dukelovett&gt; lee8oi: The pattern 'lee*' matches: lee8oi##    (console)#    &lt;lee8oi&gt; .seend#    &lt;dukelovett&gt; ~Seend 1.7~ Usage: Seend ?backup|restore?#    &lt;lee8oi&gt; .seend backup#    &lt;dukelovett&gt; Seend data backup performed.#    &lt;lee8oi&gt; .seend restore#    &lt;dukelovett&gt; Seend data restore performed.##   Note:#    Automatic backup system saves seen data on .die &amp; .restart and#    restores data on load. Interval backups are every 15 mins by default.##   Thanks:#    Thanks to thommey, nml375, and jack3 for their great code suggestions#    and all the helpful answers that made this script possible.##   Updates:#    v1.7#    1. Removed 'me' feature. Simply because someone might just use that#       for a nickname one day.(thanks ente)#    2. Help is now accessed by using '.seen help'. Running .seen without#       a nick is the same as running seen on your own nick.#    3. Partyline command '.seend' can now use 'help' or no arg to display#       command help.#    4. Added automatic interval backup system. Including#       config section for setting the interval time in minutes.#    5. Added pattern searching. Users can now use partial names with * to#       see matching names in the seen database.#    6. Added .seen request logging which uses 'putlog'. This can be#       turned on &amp; off in the config section.#    7. Cleaned up namespace variable references and made minor code#       changes to reduce unnecessary references. Also tried to move#       smaller code bits higher up in procs for quicker execution.##    ----------------------------------------------------------#  CONFIGURATION#    ----------------------------------------------------------#         Not Seen Responses##   note: Escape special characters with '\' example: '\{' #   in the message.###  1.When users supply their own nick or no nick, and bot has NOT seen them:set isUsersOwn "I haven't seen you yet. Say something."###  2.When users supply an other nick and bot has NOT seen it yet:set isOtherUser "I haven't seen that nick so far. They might not have spoken yet."###  3.When users supply the bots own name:set isBotsName "I last saw myself just now! Right here."##    ----------------------------------------------------------#                        Seen Results#   (0=disable,1=enable)###  1.Prefix results with users name.variable usename 1###  3.Show last channel in results.variable showchannel 1###  2.Show last message in results.variable showmessage 1##    ----------------------------------------------------------#                        Backup file### Set relative path to backup file.variable backupfile "scripts/SeendData.tcl"### set backup interval time in minutes.variable interval 15## log .seen requests. Uses 'putlog'. (1=enable,0=disable)variable logseens 1##    ----------------------------------------------------------#                      END CONFIGURATION##  NOTE: Only edit below if you know what you are doing. Any#  Incorrectly editing code can cause undesirable results.#####################################################################variable isUsersOwn [split $isUsersOwn]variable isOtherUser [split $isOtherUser]variable isBotsName [split $isBotsName]variable lastseenvariable lastchanvariable lastmsgvariable ver "1.7"}bind pubm - * ::seend::pub_msg_savebind sign - * ::seend::pub_msg_savebind pub - .seen ::seend::pub_show_seenbind evnt - prerestart ::seend::prerestartbind evnt - loaded ::seend::loadedbind dcc n seend ::seend::dccsetudef flag seendif {![info exists ::seend_dietrace]} {# .die trigger. do backuptrace add execution *dcc:die enter ::seend::backuptrace add execution *msg:die enter ::seend::backup}if {![info exists timer_running]} {# no existing timer. start new one.timer [set seend::interval] ::seend::timer_procset timer_running 1}namespace eval seend {proc timer_proc {args} {# call self at timed intervals. do backup::seend::backupputlog "Interval Seend backup performed."timer [set seend::interval] ::seend::timer_procreturn 1}proc restore {args} {# restore from filesource [set seend::backupfile]}proc prerestart {type} {# prerestart trigger. do backup.::seend::backupputlog "Seend data saved."}proc loaded {type} {# bot loaded trigger do restore.::seend::restoreputlog "Seend data restored."}proc backup {args} {# backup to file: Write lines to file so it can# be sourced as a script during restore.variable ::seend::lastseenvariable ::seend::lastchanvariable ::seend::lastmsgset fs [open [set seend::backupfile] w+]# write variable lines for loading namespace vars.puts $fs "variable ::seend::lastseen"puts $fs "variable ::seend::lastchan"puts $fs "variable ::seend::lastmsg"# create 'array set' lines using array data.foreach arr {lastseen lastchan lastmsg} {puts $fs "array set $arr [list [array get $arr]]"}close $fs;}proc dcc {handle idx text} {# dcc/partyline .seend commandset text [string tolower [lindex [split $text] 0]]if {$text == "" || $text == "help"} {# show help.variable ::seend::verputdcc $idx "~Seend $ver~ Usage: Seend ?backup|restore?"} elseif {$text == "backup"} {# run backup procedure.::seend::backupputdcc $idx "Seend data saved."} elseif {$text == "restore"} {# run restore procedure.::seend::restoreputdcc $idx "Seend data restored."} }proc pub_msg_save {nick userhost handle channel text} {# grab seen data from channel message.set first [string tolower [lindex [split $text] 0]]if {[channel get $channel seend]} {# channel has seend flagif {$first != ".seen"} {# not a .seen request. Ok to save.set seend::lastseen($nick) [clock seconds]set seend::lastchan($nick) $channelset seend::lastmsg($nick) $text} else {variable ::seend::logseensif {$logseens} {putlog "New .seen request from $nick: $text"}}}}proc pub_show_seen {nick userhost handle channel text} {# Retrive and display seen info or help.if {[channel get $channel seend]} {variable ::seend::lastseenvariable ::seend::lastchanvariable ::seend::lastmsgset name ""set chanmsg ""set storedmsg ""# channel has sseen flag setset text [string tolower [lindex [split $text] 0]]if {[set seend::usename]} {# usename is enabled. Add nick.set name "${nick}: "}if {$text == "help"} {# No args supplied. Show help:variable ::seend::verputserv "PRIVMSG $channel :~Seend $ver~ Usage: .seen ?nick|help|\*?"} elseif {[isbotnick $text]} {# User supplied bots name as argvariable ::seend::isBotsNameputserv "PRIVMSG $channel :${name}[join [lrange $isBotsName 0 end]]"} elseif {[regexp {\*} $text]} {# text includes a * so it must be a pattern search.set namelist [array names lastseen $text]if { $namelist != "" } {# names matching pattern exist.putserv "PRIVMSG $channel :${name}The pattern '${text}' matches: ${namelist}"} else {# no names match pattern.putserv "PRIVMSG $channel :${name}No match found for '${text}'."}} elseif {$text == $nick || $text == ""} {# User supplied their own name or 'me' as argif {[info exists lastseen($nick)]} {# seen data availableset last [duration [expr {[clock seconds] - $lastseen($nick)}]]if {[set seend::showchannel]} {# showchannel is enabled. Add last channel.set chanmsg " on $lastchan($nick)"}if {[set seend::showmessage]} {# show message is enabled. Add last message.set storedmsg " Last message: $lastmsg($nick)"}putserv "PRIVMSG $channel :${name}I last saw you $last\ago${chanmsg}.${storedmsg}"} else {# seen data not available.variable ::seend::isUsersOwnputserv "PRIVMSG $channel :${name}${isUsersOwn}"}} else {# User supplied other user nameif {[info exists lastseen($text)]} {# seen data availableset last [duration [expr {[clock seconds] - $lastseen($text)}]]if {[set seend::showchannel]} {# showchannel is enabled. Add last channel.set chanmsg " on $lastchan($text)"}if {[set seend::showmessage]} {# show message is enabled. Add last message.set storedmsg " Last message: $lastmsg($text)"}putserv "PRIVMSG $channel :${name}I last saw $text $last\ago${chanmsg}.${storedmsg}"} else {# seen data not available.variable ::seend::isOtherUserputserv "PRIVMSG $channel :${name}${isOtherUser}"}}}}namespace export backup restore prerestart loaded dcc pub_msg_save pub_show_seen}putlog "Seend 1.7 by &lt;lee8oiAtgmail&gt; loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Wed Jun 08, 2011 3:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-07T17:15:14-04:00</updated>

		<published>2011-06-07T17:15:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96999#p96999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96999#p96999"/>
		<title type="html"><![CDATA[Seend Script version 1.6]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96999#p96999"><![CDATA[
Updates:<br>   v1.6<br>1. Implemented automatic backup and restore system that saves seen data on .restart &amp; .die and restores data on load.<br>2. Created a namespace to keep procs and variables isolated to avoid future conflicts with other scripts.<br>3. Not seen responses are now 'split' and rejoined to allow better handling of special characters in response messages.<br>4. Rewrote description and comment documentation. And added copyright and GPL license reference and more code comments.<div class="codebox"><p>Code: </p><pre><code>namespace eval seend {#########################################################################   Copyright ©2011 lee8oi@gmail.com##   This program is free software; you can redistribute it and/or modify#   it under the terms of the GNU General Public License as published by#   the Free Software Foundation; either version 2 of the License, or#   (at your option) any later version.##   This program is distributed in the hope that it will be useful,#   but WITHOUT ANY WARRANTY; without even the implied warranty of#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#   GNU General Public License for more details.#   http://www.gnu.org/licenses/##   Seend v1.6 (6-7-11)#   by: &lt;lee8oiAtgmail&gt;&lt;lee8oiOnfreenode&gt;##   Original Sseend based on:#   Sseen v0.2.22 by samu (IRC: samu@pirc.pl)##    ----------------------------------------------------------##   Seend is a seen script that will tell you how long ago the bot#   last seen the specified nick, what channel they were on, and what their#   last message was to that channel. It even allows users to .seen#   themselves! Seend uses an automatic system for backing up seen data#   and restoring it on load along with the .seend partyline command to#   manually backup and restore seen data.#   In the config section owners can enable/disable: User name prefixing,#   displaying last channel, and displaying last message. And can also set#   up Not seen responses, bot search for self response, and backup file#   location/name.##   Initial channel setup:#   (starts logging and enables .seen command)#    .chanset #channel +seend##   Public command syntax:#    .seen ?username|me?##   DCC (partyline) command syntax:#    .seend ?backup|restore?##   Example Usage:#    (public)#    &lt;lee8oi&gt; .seen#    &lt;dukelovett&gt; ~Seend 1.6~ Usage: .seen ?nick|me?#    &lt;lee8oi&gt; .seen me#    &lt;dukelovett&gt; I last saw you 1 hour 3 minutes 39 seconds ago on#    #dukelovett. Last message: Sseen script was awsome. My version improves on it.#    &lt;lee8oi&gt; .seen dukelovett#    &lt;dukelovett&gt; I last saw myself just now. Right here.##    (console)#    &lt;lee8oi&gt; .seend#    &lt;dukelovett&gt; ~Seend 1.6~ Usage: Seend ?backup|restore?#    &lt;lee8oi&gt; .seend backup#    &lt;dukelovett&gt; Seend data backup performed.#    &lt;lee8oi&gt; .seend restore#    &lt;dukelovett&gt; Seend data restore performed.##   Note:#    Automatic backup system saves seen data on .die &amp; .restart and#    restores data on load.##   Thanks:#    Thanks to thommey, nml375, and jack3 for their great code suggestions#    and all the helpful answers that made this script possible.##   Updates:#    v1.6#    1. Implemented automatic backup and restore system that saves#       seen data on .restart &amp; .die and restores data on load.#    2. Created a namespace to keep procs and variables isolated to#       avoid future conflicts with other scripts.#    3. Not seen responses are now 'split' and rejoined to allow#       better handling of special characters in response messages.#    4. Rewrote description and comment documentation. And added#       copyright and GPL license reference and more code comments.##    ----------------------------------------------------------#  CONFIGURATION#    ----------------------------------------------------------#         Not Seen Responses##   note: Escape special characters with '\' example: '\{' #   in the message.###  1.When users supply their own nick or 'me' and bot has NOT seen them:set isUsersOwn "I haven't seen you yet. Say something."###  2.When users supply an other nick and bot has NOT seen them:set isOtherUser "I haven't seen that nick so far. They might not have spoken yet."###  3.When users supply the bots own name:set isBotsName "I last saw myself just now! Right here."##    ----------------------------------------------------------#                        Seen Results#   (0=disable,1=enable)###  1.Prefix results with users name.variable usename 1###  3.Show last channel in results.variable showchannel 1###  2.Show last message in results.variable showmessage 1##    ----------------------------------------------------------#                        Backup file### Set relative path to backup file.variable backupfile "scripts/SeendData.fs"##    ----------------------------------------------------------#                      END CONFIGURATION##  NOTE: Only edit below if you know what you are doing. Any#  Incorrectly editing code can cause undesirable results.#####################################################################variable isUsersOwn [split $isUsersOwn]variable isOtherUser [split $isOtherUser]variable isBotsName [split $isBotsName]variable lastseenvariable lastchanvariable lastmsgvariable ver "1.6"}bind pubm - * ::seend::pub_msg_savebind sign - * ::seend::pub_msg_savebind pub - .seen ::seend::pub_show_seenbind evnt - prerestart ::seend::prerestartbind evnt - loaded ::seend::loadedbind dcc n seend ::seend::dccsetudef flag seendif {![info exists ::seend_dietrace]} {# .die trigger. do backuptrace add execution *dcc:die enter ::seend::backuptrace add execution *msg:die enter ::seend::backup}namespace eval seend {proc restore {args} {# restore from filevariable ::seend::backupfilesource $backupfile}proc prerestart {type} {# prerestart trigger. Do backup.::seend::backupputlog "Seend data saved."}proc loaded {type} {# bot loaded trigger do restore.::seend::restoreputlog "Seend data restored."}proc backup {args} {# backup to file: Write lines to file so it can# be sourced as a script during restore.variable ::seend::backupfilevariable ::seend::lastseenvariable ::seend::lastchanvariable ::seend::lastmsgset fs [open $backupfile w+]# write variable lines for loading namespace vars.puts $fs "variable ::seend::lastseen"puts $fs "variable ::seend::lastchan"puts $fs "variable ::seend::lastmsg"foreach arr {lastseen lastchan lastmsg} {# create 'array set' lines using array data.puts $fs "array set $arr [list [array get $arr]]"}close $fs;}proc dcc {handle idx text} {# dcc/partyline .seend commandvariable ::seend::verset text [string tolower [lindex [split $text] 0]]if {$text == ""} {# show help.putdcc $idx "~Seend $ver~ Usage: Seend ?backup|restore?"} elseif {$text == "backup"} {# run backup procedure.::seend::backupputdcc $idx "Seend data saved."} elseif {$text == "restore"} {# run restore procedure.::seend::restoreputdcc $idx "Seend data restored."} }proc pub_msg_save {nick userhost handle channel text} {# grab seen data from channel message. set first [string tolower [lindex [split $text] 0]]if {[channel get $channel seend]} {# channel has seend flagif {$first != ".seen"} {# not a .seen request. Ok to save.set seend::lastseen($nick) [clock seconds]set seend::lastchan($nick) $channelset seend::lastmsg($nick) $text}}}proc pub_show_seen {nick userhost handle channel text} {# Retrive and display seen info or help.variable ::seend::vervariable ::seend::usenamevariable ::seend::showchannelvariable ::seend::showmessagevariable ::seend::isUsersOwnvariable ::seend::isOtherUservariable ::seend::isBotsNamevariable ::seend::lastseenvariable ::seend::lastchanvariable ::seend::lastmsgset name ""set chanmsg ""set storedmsg ""if {[channel get $channel seend]} {# channel has sseen flag setset text [string tolower [lindex [split $text] 0]]if {$usename} {# usename is enabled. Add nick.set name "${nick}: "}if {$text == ""} {# No args supplied. Show help:putserv "PRIVMSG $channel :~Seend $ver~ Usage: .seen ?nick|me?"} elseif {[isbotnick $text]} {# User supplied bots name as argputserv "PRIVMSG $channel :${name}[join [lrange $isBotsName 0 end]]"} elseif {$text == $nick || $text == "me"} {# User supplied their own name or 'me' as argif {[info exists lastseen($nick)]} {# seen data availableset last [duration [expr {[clock seconds] - $lastseen($nick)}]]if {$showchannel} {# showchannel is enabled. Add last channel.set chanmsg " on $lastchan($nick)"}if {$showmessage} {# show message is enabled. Add last message.set storedmsg " Last message: $lastmsg($nick)"}putserv "PRIVMSG $channel :${name}I last saw you $last\ago${chanmsg}.${storedmsg}"} else {# seen data not available.putserv "PRIVMSG $channel :${name}${isUsersOwn}"}} else {# User supplied other user nameif {[info exists lastseen($text)]} {# seen data availableset last [duration [expr {[clock seconds] - $lastseen($text)}]]if {$showchannel} {# showchannel is enabled. Add last channel.set chanmsg " on $lastchan($text)"}if {$showmessage} {# show message is enabled. Add last message.set storedmsg " Last message: $lastmsg($text)"}putserv "PRIVMSG $channel :${name}I last saw $text $last\ago${chanmsg}.${storedmsg}"} else {# seen data not available.putserv "PRIVMSG $channel :${name}${isOtherUser}"}}}}namespace export backup restore prerestart loaded dcc pub_msg_save pub_show_seen}putlog "Seend $ver by &lt;lee8oiAtgmail&gt; loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Tue Jun 07, 2011 5:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-06T17:13:06-04:00</updated>

		<published>2011-06-06T17:13:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96989#p96989</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96989#p96989"/>
		<title type="html"><![CDATA[Seend Script version 1.5!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96989#p96989"><![CDATA[
v1.5<br>   1. Added partyline command '.seend' for managing seen data. Includes 'backup' and 'restore' optional arguments for backing up and restoring seen data. Using .seend with no argument shows script version and usage info.<br>   2. Incorporated code changes suggested by nml375(6-6-11)<br>   3. Renamed script name and channel flag to seend instead of sseend. Since this script is evolving so much, 'Simple' might not be  the right word to describe it anymore.<br>   <br>NOTE TO USERS OF Sseend v1.4 OR EARLIER:<br>       remove -sseen flag from channels, and add '+seend' to update to this version of Seend script.<div class="codebox"><p>Code: </p><pre><code>#  ----------------------------------------------------------##   Seend v1.5 (6-6-11-17)#   by: &lt;lee8oiAtgmail&gt;&lt;lee8oiOnfreenode&gt; (thanks thommey)##   Original Sseend based on:#   Sseen v0.2.22 by samu (IRC: samu@pirc.pl)##  ----------------------------------------------------------##  This is Seen 'Duke' (pronounced 'Seend' by lee8oi).#  Seend is a seen script forked from Sseen that will tell you how#  long ago the bot last seen the specified nick, what channel they#  were on, and what their last message was to that channel. Seend#  also allows users to .seen themselves!(demanded). Via script edits#  Bot owners can enable/disable: prefixing seen results with users name,#  showing last channel, and showing last message. Owners also#  have access to the '.seend' partyline command for backing up#  and restoring seen data.##  Initial channel setup:#  (starts logging and enables .seen command)#    .chanset #channel +seend##  Public command syntax:#    .seen ?username|me?##  DCC (partyline) command syntax:#    .seend ?backup|restore?##  Example Usage:#    (public)#    &lt;lee8oi&gt; .seen#    &lt;dukelovett&gt; ~Seend 1.5~ Usage: .seen ?nick|me?#    &lt;lee8oi&gt; .seen me#    &lt;dukelovett&gt; I last saw you 1 hour 3 minutes 39 seconds ago on#    #dukelovett. Last message: Sseen script was awsome. My version improves on it.#    &lt;lee8oi&gt; .seen dukelovett#    &lt;dukelovett&gt; I last saw myself just now. Right here.##    (partyline)#    &lt;lee8oi&gt; .seend#    &lt;dukelovett&gt; ~Seend 1.5~ Usage: Seend ?backup|restore?#    &lt;lee8oi&gt; .seend backup#    &lt;dukelovett&gt; Seend data backup performed.#    &lt;lee8oi&gt; .seend restore#    &lt;dukelovett&gt; Seend data restore performed.##  Note:#    Restarting the bot will clear all stored seen data. But Rehashing#    normally does not clear the data.#  #  Updates:##    v1.5#    1. Added partyline command '.seend' for managing seen data.#       Includes 'backup' and 'restore' optional arguments for#       backing up and restoring seen data via partyline with .seend#       no argument shows script version and usage info.#    2. Incorporated code changes suggested by nml375(6-6-11)#    3. Renamed script and channel flag to seend instead of sseend.#       Since this script is evolving so much, 'Simple' might not be#       the right word to describe it anymore.#    NOTE to users of v1.4 or earlier:#       remove -sseen flag from channels, and add '+seend' to update#       to this version of Seend.#       ###  ----------------------------------------------------------#  CONFIG: (.rehash after editing)#  ----------------------------------------------------------#   Not Seen Responses:##  1.When users supply their own nick or 'me' and bot has NOT seen them:set isUsersOwn "I haven't seen you yet. Say something."##  2.When users supply an other nick and bot has NOT seen them:set isOtherUser "I haven't seen that nick so far. They might not have spoken yet."##  3.When users supply the bots own name:set isBotsName "I last saw myself just now. Right here."#  ----------------------------------------------------------#   Seen Results Output: (0=disable,1=enable)##  1.Prefix results with users name.set usename 1##  3.Show last channel in results.set showchannel 1##  2.Show last message in results.set showmessage 1set backupfile "scripts/SseendData.fs"#  ----------------------------------------------------------#  END CONFIG#  ----------------------------------------------------------#  NOTE: Only edit below if you know what you are doing. Any#  Incorrect edits can cause undesirable results.#  ----------------------------------------------------------bind pubm - * public_msg_savebind sign - * public_msg_savebind pub - .seen pub_show_seenbind dcc n seend dcc_seendset ver "1.5"setudef flag seendproc dcc_seend {handle idx text} {global lastseen lastchan lastmsg ver backupfileset text [string tolower [lindex [split $text] 0]]if {$text == ""} {putdcc $idx "~Seend $ver~ Usage: Seend ?backup|restore?"} elseif {$text == "backup"} {set fs [open $backupfile w+]foreach arr {lastseen lastchan lastmsg} {puts $fs "array set $arr [list [array get $arr]]"}close $fs;putdcc $idx "Seend data backup performed."} elseif {$text == "restore"} {source $backupfileputdcc $idx "Seend data restore performed."} }proc public_msg_save {nick userhost handle channel text} {global lastseen lastchan lastmsgset first [string tolower [lindex [split $text] 0]]if {[channel get $channel seend]} {# channel has seend flag setif {$first != ".seen"} {# not a .seen request. save data.set lastseen($nick) [clock seconds]set lastchan($nick) $channelset lastmsg($nick) $text}}}proc pub_show_seen {nick userhost handle channel text} {global ver lastseen lastchan lastmsgglobal isBotsName isUsersOwn isOtherUserglobal usename showmessage showchannelset name ""set chanmsg ""set storedmsg ""if {[channel get $channel seend]} {# channel has sseen flag setset text [string tolower [lindex [split $text] 0]]if {$usename} {set name "${nick}: "}if {$text == ""} {# No args supplied. Show help:putserv "PRIVMSG $channel :~Seend $ver~ Usage: .seen ?nick|me?"} elseif {[isbotnick $text]} {# User supplied bots name as argputserv "PRIVMSG $channel :${name}$isBotsName"} elseif {$text == $nick || $text == "me"} {# User supplied their own name or 'me' as argif {[info exists lastseen($nick)]} {# seen data availableset last [duration [expr {[clock seconds] - $lastseen($nick)}]]if {$showchannel} {set chanmsg " on $lastchan($nick)"}if {$showmessage} {set storedmsg " Last message: $lastmsg($nick)"}putserv "PRIVMSG $channel :${name}I last saw you $last\ago${chanmsg}.${storedmsg}"} else {# seen data not available.putserv "PRIVMSG $channel :${name}${isUsersOwn}"}} else {# User supplied other user nameif {[info exists lastseen($text)]} {# seen data availableset last [duration [expr {[clock seconds] - $lastseen($text)}]]if {$showchannel} {set chanmsg " on $lastchan($text)"}if {$showmessage} {set storedmsg " Last message: $lastmsg($text)"}putserv "PRIVMSG $channel :${name}I last saw $text $last\ago${chanmsg}.${storedmsg}"} else {# seen data not available.putserv "PRIVMSG $channel :${name}${isOtherUser}"}}}}putlog "Seend $ver by &lt;lee8oiAtgmail&gt; loaded!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Mon Jun 06, 2011 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-06-06T15:57:20-04:00</updated>

		<published>2011-06-06T15:57:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96987#p96987</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96987#p96987"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96987#p96987"><![CDATA[
Yep, you're right. I'll update my previous post to fix those issues..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Jun 06, 2011 3:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-06T15:25:20-04:00</updated>

		<published>2011-06-06T15:25:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96986#p96986</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96986#p96986"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96986#p96986"><![CDATA[
set lastmsg " Last message: $lastmsg($nick)"  <br><br>doesn't work because lastmsg is the name of the global array. I got the following error:<br>Tcl error [pub_show_seen]: can't set "lastmsg": variable is array<br><br>and its:<br>[duration [expr {[clock seconds] - $lastseen($nick)}]]<br>not<br>[duration [expr {[clock seconds] - $lastchan($nick)}]]<br><br>So you almost got it right. Gotta use something else for the one var name. and use the correct varnames in thier places <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> But I'm working your suggestions in...thanks again good info!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Mon Jun 06, 2011 3:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2011-06-06T16:00:35-04:00</updated>

		<published>2011-06-06T11:59:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96985#p96985</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96985#p96985"/>
		<title type="html"><![CDATA[Seend script. Latest version: 1.8.3]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96985#p96985"><![CDATA[
Another suggestion, rather than having multiple <em class="text-italics">global</em> commands on the same line, consider using a single <em class="text-italics">global</em> command with multiple parameters:<div class="codebox"><p>Code: </p><pre><code>global ver lastseen lastchan lastmsg isBotsName isUsersOwn isOtherUser username showmessage showchannel</code></pre></div>It generally makes the code a lot more reader-friendly.<br><br>Also, avoid embedding code in output-strings if they don't contribute to the actual contents; setting unused variables to return a conditional value is not the prefered way, consider using the <em class="text-italics">expr</em> command (be cautious of double-evaluation though), or defining the variables outside the string, and using them within the string:<div class="codebox"><p>Code: </p><pre><code>...putserv "PRIVMSG $channel :[expr { $usename ? "${nick}:" : "" }]\I last saw you [duration [expr {[clock seconds] - $lastseen($nick)}]] ago\[expr { $showchannel ? " on $lastchan($nick)." : "." }]"### Another way of doing this:...set name ""set chanmsg ""set lastwhat ""set last [duration [expr {[clock seconds] - $lastseen($nick)}]]if {$usename} {  set name "${nick}:"}if {$showchannel} {  set chanmsg " on $lastchan($nick)"}if {$showmessage} {  set lastwhat " Last message: $lastmsg($nick)"}putserv "PRIVMSG $channel :$name I last saw you $last ago${chanmsg}.${lastwhat}"...</code></pre></div>There's probably an abundance of ways to write this piece of code, general rule of thumb though, if you define a variable - use it.<br><br>Edit: Fixed two issues with mixed up variable names.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Jun 06, 2011 11:59 am</p><hr />
]]></content>
	</entry>
	</feed>
