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 

Loud Bot

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


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Tue Feb 16, 2010 5:15 pm    Post subject: Loud Bot Reply with quote

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


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Feb 17, 2010 8:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Thu Feb 18, 2010 7:01 am    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Feb 18, 2010 8:18 am    Post subject: Reply with quote

Remove the "!" from this line
Code:
if {![channel get $chan loud]} {

_________________
Follow me on GitHub

- Opposing

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


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Thu Feb 18, 2010 8:40 am    Post subject: Reply with quote

Thank worked, cheers!
_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Thu Feb 18, 2010 10:42 am    Post subject: Reply with quote

[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, Very Happy

[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> Very Happy
[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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Feb 18, 2010 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
radix
Voice


Joined: 10 Jan 2012
Posts: 3

PostPosted: Thu Jan 12, 2012 2:41 pm    Post subject: Reply with quote

any chance flat file storage could be added to this? thanks.
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