| View previous topic :: View next topic |
| Author |
Message |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Tue Feb 16, 2010 5:15 pm Post subject: Loud Bot |
|
|
Hey, I`m looking for a scrirpt that when someone shouts in caps it will reply in all caps with another message that was shouted in all caps by someone else. _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Feb 17, 2010 8:02 pm Post subject: |
|
|
| Code: | # flag
setudef flag loud
# bind
bind pubm - * my:reply:catcher
# create catch for LOUD chatter
proc my:reply:catcher {nick uhost hand chan text} {
# loud is activated on the channel?
if {[channel get $chan loud]} {
# does this string even have alphabet characters
if {[regexp -nocase {[::alpha::]} $text]} {
# yes, is this person using ALL CAPS?
if {[string equal [string toupper $text] $text]} {
# yes, before replying is there even a reply or is
# our list corrupt?
if {[string length [set reply [my:reply:proc $text]]]} {
# LOUD reply isn't empty so let's spam it :)
putserv "privmsg $chan :[string toupper $nick], $reply"
}
}
}
}
# this is a pubm bind, we must return 0 here because the last
# value returned otherwise will be 1 from the putserv. We do
# NOT want a 1 returned from a pubm bind. This causes it to
# do the reverse of what you think. pubm binds differ from
# pub binds in this way.
return 0
}
# reply proc helper for the catcher
proc my:reply:proc {text} {
# do we already have a LOUD list built?
if {[info exists ::__my_list]} {
# yes, then reply randomly from the present list
# before we add this text to our list
set reply [lindex $::__my_list [rand [llength $::__my_list]]]
} else {
# no, then reply that they are LOOOUUDDD!
set reply "LOOOOUUUDDDDDD!!!!"
}
# add the text to our LOUD list
lappend ::__my_list $text
# return the LOUD reply
return $reply
}
#eof |
fixed.
added alpha check before replying LOUDLY. _________________ speechles' eggdrop tcl archive
Last edited by speechles on Thu Feb 18, 2010 5:50 pm; edited 1 time in total |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Thu Feb 18, 2010 7:01 am Post subject: |
|
|
.chanset #Xabriel +loud
Successfully set modes { +loud } on #Xabriel.
[13:01:05] <McShizzle> OMG
[13:01:06] <McShizzle> LOL
The bot doesn't reply _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Feb 18, 2010 8:18 am Post subject: |
|
|
Remove the "!" from this line
| Code: | | if {![channel get $chan loud]} { |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Thu Feb 18, 2010 8:40 am Post subject: |
|
|
Thank worked, cheers! _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
Football Master
Joined: 26 Dec 2008 Posts: 205 Location: Quakenet, #Football
|
Posted: Thu Feb 18, 2010 10:42 am Post subject: |
|
|
[16:20:16] <@Allyn> Cash-strapped Portsmouth are understood to have asked the Premier League for permission to sell players outside the transfer window.
[16:20:19] <@Allyn> ............
[16:20:21] <@EPL> ALLYN,
[15:35:09] <ahmadinejad> well good for you that you managed to google it, Oreo, despite the fact that you are.. you.
[15:35:11] <ahmadinejad>
[15:35:12] <@EPL> AHMADINEJAD, OMG
Uhm seems like sometimes it replies even though the person didn't write the text with caps.. _________________ Idling at #Football, Quakenet. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Feb 18, 2010 5:52 pm Post subject: |
|
|
| Football wrote: | | Uhm seems like sometimes it replies even though the person didn't write the text with caps.. |
It didn't contain an alphabet check, now it does. Use the code I've altered found above. [::alpha::] should behave differently than [a-z] (foreign languages) in regard to full alphabetic ranges. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
radix Voice
Joined: 10 Jan 2012 Posts: 3
|
Posted: Thu Jan 12, 2012 2:41 pm Post subject: |
|
|
| any chance flat file storage could be added to this? thanks. |
|
| Back to top |
|
 |
|