Code: Select all
# 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've put the script here:
TopicRecover v2112