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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Jcb
Voice
Posts: 4 Joined: Sun May 07, 2006 3:05 pm
Location: Netherlands
Post
by Jcb » Sun May 07, 2006 3:12 pm
Hello!
I've been looking for a script for my eggdrop that automaticly stores quotes from people in my channel. Once a person leaves and later joins the same channel again, I'd like the eggdrop to randomly pick one quote that person has said and spit it out in the channel.
A lot of quote systems I have encountered are systems where you can only add quotes, eg: !add <quote>. That's is not what I'm looking for. Any help would be greatly appreciated!
Jcb.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun May 07, 2006 5:31 pm
So, you want your bot to add every line said by every user to a file?
Jcb
Voice
Posts: 4 Joined: Sun May 07, 2006 3:05 pm
Location: Netherlands
Post
by Jcb » Sun May 07, 2006 7:09 pm
Sir_Fz wrote: So, you want your bot to add every line said by every user to a file?
Thats too much obviously. Is there a way to work with chances? Like 5% it stores the quote?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun May 07, 2006 7:26 pm
Try:
Code: Select all
bind time - ?0* savequotes
bind pubm - * addquote
bind join - * printquote
if {![file exists scripts/quotelist.txt]} { close [open scripts/quotelist.txt w] }
set quotelist [split [read [set qlfile [open scripts/quotelist.txt]]] \n][close $qlfile]
proc savequotes args {
global quotelist
set f [open scripts/quotelist.txt w]
foreach e $quotelist {
if {$e != ""} { puts $f $e }
}
close $f
}
proc addquote {nick uhost hand chan arg} {
global quotelist
set nick [string tolower $nick]
if {[rand 100] < 5} {
if {[lsearch $quotelist "$nick $arg"] == -1} {
lappend quotelist "$nick $arg"
}
}
}
proc printquote {nick uhost hand chan} {
global quotelist
set nick [string tolower $nick]
if {[lsearch $quotelist "$nick *"] != -1} {
set quote [getquote $nick]
puthelp "privmsg $chan :$nick : $quote"
}
}
proc getquote n {
global quotelist
foreach e $quotelist {
if {[lindex [split $e] 0] == $n} {
lappend nq [join [lrange [split $e] 1 end]]
}
}
return [lindex $nq [rand [llength $nq]]]
}
Jcb
Voice
Posts: 4 Joined: Sun May 07, 2006 3:05 pm
Location: Netherlands
Post
by Jcb » Mon May 08, 2006 3:34 am
Thanks a lot! I will try this inmediatly.