This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

History script

Old posts that have not been replied to for several years.
Locked
S
Slicer121
Voice
Posts: 7
Joined: Tue Dec 14, 2004 4:19 am

History script

Post by Slicer121 »

I'm looking for a script that buffers, for instance the last 20 lines on my channel and displays them on join. Does this exist?

Slicer121
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set bsize 20
bind pubm - * foo
proc foo {n u h c t} {
  if {[info exists ::buf($c)] && [llength $::buf($c)] == $::bsize} {
    set ::buf($c) [lreplace $::buf($c) 0 0]
  }
  lappend ::buf($c) $t
}
bind join - * bar
proc bar {n u h c} {
  if [info exists ::buf($c)] {
    foreach line $::buf($c) {puthelp "notice $n :$line"} 
  }
}
S
Slicer121
Voice
Posts: 7
Joined: Tue Dec 14, 2004 4:19 am

Thanks

Post by Slicer121 »

I works like a charm! Thank you very much!!

S
S
Slicer121
Voice
Posts: 7
Joined: Tue Dec 14, 2004 4:19 am

Slow

Post by Slicer121 »

1. I don't know if it's my connection but I the history is displayed very slowly. I tried putserv instead of puthelp but the result is the same.

2. Is there a way of showing the nick on each line as well?

Slicer
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

this will show: <nick> text

Code: Select all

set bsize 20
bind pubm - * foo
proc foo {n u h c t} {
  if {[info exists ::buf($c)] && [llength $::buf($c)] == $::bsize} {
    set ::buf($c) [lreplace $::buf($c) 0 0]
  }
  lappend ::buf($c) "<$n> $t"
}
bind join - * bar
proc bar {n u h c} {
  if [info exists ::buf($c)] {
    foreach line $::buf($c) {puthelp "notice $n :$line"}
  }
} 
[putserv] should be faster than [puthelp] since the server queue has higher flush priority than the help queue
Locked