Jump to content
chain

TLC Time show

Recommended Posts

  • Administrators
# Set the next lines as the triggers and random responses you want
set ai_data {
 {
  {"What time is it?" "*time*" "What is the time?" "What's the time?" "Anyone have the time?"} {
   "$nick, it's [clock format [clock seconds]]"
  }
 }
}

# Set the next line as the channels you want to run in
set ai_chans "#test1, #test2"
bind pubm - * pub_ai

putlog "Time Show by Beliata"

proc pub_ai {nick uhost hand chan arg} {
 global ai_data ai_chans botnick
 if {(([lsearch -exact [string tolower $ai_chans] [string tolower $chan]] != -1) || ($ai_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
  foreach block $ai_data {
   set triggers [lindex $block 0]
   set responses [lindex $block 1]
   foreach trigger $triggers {
    if {[string match [string tolower $trigger] [string tolower $arg]]} {
     putserv "PRIVMSG $chan :[subst [lindex $responses [rand [llength $responses]]]]"
    }
   }
  }
 }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...