| View previous topic :: View next topic |
| Author |
Message |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Feb 28, 2006 12:35 am Post subject: Topic Recover script updated by me. |
|
|
Having been unable to contact the author of this script, I've taken it upon myself to update and enhance it quite a bit. The script was barely working out of the box from the archives, so I fixed the problems. I've also done the following:
| Code: |
# Updated by Rosc2112 at yahoo.com Feb.2006
#
# Originally based on: Meltdowns Topic-Recover V0.2 08-03-2004
# meltdown@gmx.at | #lamer or #meltdown on quakenet
#
# Stores every chantopic into a file to recover the last topic.
#
# Changes:
# Made all commands work by /msg (No sense spamming channels)
# Added a timer to check if the topic is empty, and reset it with recovertopic.
# Added a deltopic function to allow deleting the topics.
# Modified rolltopic to work based on Epoch time/index number which allows rolling back any topic you wish,
# not just the first one by date as originally scripted.
# Added an undotopic function, mainly for testing, but it's there for whatever may be useful.
# Added a default help file.
# Fixed various errors in proc:rectopic{} such as not having $aktuell, $aktuellnick and $aktuellzeit set before
# trying to use them. TCL seems rather picky about that..I can't tell that those vars serve a useful function
# but they were causing problems, so I took the path of least resistance.
#
# It ain't pretty, and I've left my debug putcmdlogs, commented out, and it's definitely not
# optimized, since I've only been using eggdrop/tcl for 3 days now :P
# But it all works from my testing, ymmv. Updates/fixes/clues welcome :P
#
# Todo:
# Make the script work with multiple channels in all functions.
# Could probably remove the somewhat silly cleanup function, since you can delete topics manually now.
# Better yet, redo the functions to CHECK for duplicate topics BEFORE adding them to the topic file.
#
# Commands:
# .topic - in channel/public command, will show the current topic in msg to user.
# topic - /msg $botnick topic - will show the current topic, and if user is +o,
# will show the commands helpfile.
# searchtopic - /msg $botnick searchtopic - shows the saved topics and their Epoch time/Index number
# rolltopic - /msg $botnick rolltopic - roll back topic with the one specified by Epoch time/Index number
# deltopic - /msg $botnick deltopic - delete topic with Epoch time/Index number
# rectopic - /msg $botnick rectopic - recover the last saved topic
# retopic - /msg $botnick retopic - same as rectopic, except this UNSETS topic first, then recovers last set.
# undotopic - /msg $botnick undotopic - simply unsets the topic, making it blank
#
#
|
I would greatly appreciate any experienced tcl coders looking over the script and correcting any huge and ugly errors I've put into this effort. As stated above, I've only been using tcl for 3 days or so (I think I did pretty good considering!
I've put the script here:
TopicRecover v2112 |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Feb 28, 2006 5:09 am Post subject: |
|
|
| why don't you just test it yourself? |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Feb 28, 2006 5:31 am Post subject: |
|
|
| Quote: | | I would greatly appreciate any experienced tcl coders looking over the script and correcting any huge and ugly errors I've put into this effort. |
Errors would mean it doesn't work. That's what i based my reply on.
Furthermore, you seem to global chan alot, i haven't taken a look as to where you define it but that would pretty much limit your script to 1 channel.
Maybe you should realise that's the reason why it was using pub, to allow multiple channels without problems. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Feb 28, 2006 6:02 am Post subject: |
|
|
bloated script; restoring topic is as simple as:
| Code: |
foreach c [channels] {
if [botonchan $c] {set t($c) [topic $c]}
}
bind join - * foo
proc foo {n u h c} {
if [isbotnick $n] {set ::t($c) [topic $c]}
}
bind pub o !restore bar
proc bar {n u h c t} {
set t [topic $c]
if [info exists ::t($c)] {
puthelp "topic $c :$::t($c)"
set ::t($c) $t
}
}
|
_________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Aug 29, 2006 3:09 pm Post subject: v0.5 update |
|
|
# Aug 29 2006 - Changed .topicsearch to show newest to oldest topics. Fixed a typo "catc" shoulda been "catch".
Fixed help output to show correct synxtax (duh).
BTW,
The script was updated some time ago to work in multiple channels with set tchan "channel list" |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|