egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Topic Recover script updated by me.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Feb 28, 2006 12:35 am    Post subject: Topic Recover script updated by me. Reply with quote

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! Smile

I've put the script here:
TopicRecover v2112
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Feb 28, 2006 5:09 am    Post subject: Reply with quote

why don't you just test it yourself?
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Feb 28, 2006 5:31 am    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Feb 28, 2006 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Aug 29, 2006 3:09 pm    Post subject: v0.5 update Reply with quote

# 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber