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 

Looking for a brief history bot. Record and display 10 lines

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
bradleylauchlin
Voice


Joined: 14 Apr 2008
Posts: 6

PostPosted: Mon Apr 14, 2008 8:06 pm    Post subject: Looking for a brief history bot. Record and display 10 lines Reply with quote

Hi, I am looking to add a script to my bot where it records the last 10 lines from the conversation and then will message, or notice them to a user when they join the channel so that they know what is going on, and are not completely oblivious to the converstation going on as they enter.

I am fairly new to TCL scripting and can do basic stuff, but am not sure how to best approach this. If someone could get me started that would be great. Thanks.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Apr 15, 2008 9:12 am    Post subject: Reply with quote

Code:
bind pubm - "#channel *" record:lines
bind join - "#channel *" notice:lines

set last10Lines [list]

proc record:lines {nick uhost hand chan arg} {
 global last10Lines
 lappend last10Lines "<$nick> $arg"
 if {[llength $last10Lines] > 10} {
  set last10Lines [lrange $last10Lines end-9 end]
 }
}

proc notice:lines {nick uhost hand chan} {
 global last10Lines
 foreach line $last10Lines {
  puthelp "notice $nick :$line"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
bradleylauchlin
Voice


Joined: 14 Apr 2008
Posts: 6

PostPosted: Sat Apr 19, 2008 9:18 pm    Post subject: Reply with quote

Thanks, modified it a bit for my bot, and it works perfectly. Thanks for the hand.
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 Requests 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