Posted to tcl by an7y at Thu Jul 18 07:02:45 GMT 2019view pretty

#         Script : Tourettes v1.00 by David Proper (Dr. Nibble [DrN])
#                  Copyright 2004 Radical Computer Systems
#                             All Rights Reserved
#     -=: Currently in closed alpha testing -=- Not for distrabution :=-
#
#  _  _  _ _______  ______ __   _ _____ __   _  ______
#  |  |  | |_____| |_____/ | \  |   |   | \  | |  ____ .
#  |__|__| |     | |    \_ |  \_| __|__ |  \_| |_____| .
#
#  If you are easily offended, do not like profanity, or are just
#  a general puritan asshole, do NOT run nor view any more of this script!
#
#
#
#       Testing
#      Platforms : Linux 2.4.18   TCL v8.3.4
#                  Eggdrop v1.5.4
#                  Eggdrop v1.6.12
#            And : SunOS 5.8      TCL v8.3
#                  Eggdrop v1.5.4
#
#    Description : I was wrong about decide.tcl... THIS is the lamest script
#                  I have ever done... What Tourettes does is... well...
#                  it gives your bot tourettes syndrom.
#                  It will randomly spew forth profanity into the channel(s)
#                  Don't you want to hurry up and load this into your bot?
#                  LOL OK. So this will prob be one of my least liked, much
#                  less, used scripts I've ever done.
#
#        History : 01/22/2004 - First Release
#                  01/22/2004 - v1.01
#                              o Oh fuck. Forgot to reset the timer. DOH
#
#      Donations : https://www.paypal.com/xclick/business=rainbows%40chaotix.net
# (If you don't have PayPal and want to donate, EMail me for an address.
#  Will take money or hardware/computer donations)
#  Significant (or even non-significant donations) can be published on a
#  web site if you so choose.
#
#   Future Plans : Fix Bugs. :)
#
# Author Contact :     Email - DProper@chaotix.net
#                   Homepage - http://www.chaotix.net/~dproper
#                        IRC - Primary Nick: DrN
#                     UseNet - alt.irc.bots.eggdrop
# Support Channels: #RCS @UnderNet.Org
#                   #RCS @DALnet
#                   #RCS @EFnet
#                   #RCS @Choatix Addiction
#            Other channels - Check contact page for current list
#
#                Current contact information can be located at:
#                 http://rcs.chaotix.net/contact.html
#
# New TCL releases are sent to the following sites as soon as they're released:
#
# FTP Site                   | Directory                     
# ---------------------------+-------------------------------
# ftp.chaotix.net            | /pub/RCS
# ftp.eggheads.org           | Various
# ftp.egghelp.org            | Various
#
# Chaotix.Net has returned. Web site and mailing list back online
#
#   Radical Computer Systems - http://rcs.chaotix.net/
# To subscribe to the RCS mailing list: 
#  http://www.chaotix.net/mailman/listinfo/rcs-list
#
#  Feel free to Email me any suggestions/bug reports/etc.
# 
# You are free to use this TCL/script as long as:
#  1) You don't remove or change author credit
#  2) You don't release it in modified form. (Only the original)
# 
# If you have a "too cool" modification, send it to me and it'll be
# included in the official release. (With your credit)
#
# Commands Added:
#  Where     F CMD          F CMD            F CMD           F CMD
#  -------   - ----------   - ------------   - -----------   - ----------
#  Public:   N/A
#     MSG:   N/A
#     DCC:   N/A
#
# Public Matching: N/A
#



set tourettes(ver) "v1.00.01"

# [0/1] If set to 1, will give letters a random chance of being bold,
#       reverse, or colored
set tourettes(funkify) 1

# Base time before going spaz again
# Total delay is figured as: time + ( rand 0 - timepad)
# With the default values of 30 and 20, a spazattack will be triggered
# anytime between 30 and 50 minutes apart.
set tourettes(time) 30
set tourettes(timepad) 20

# Set this to the channels you want to spaz on. Set to * for all chans.
set tourettes(channel) "#RCS #Freak"

# Nicks to ignore when getting a random nick
set tourettes(bots) "W X ChanServ ^Elviraa^ LadySin IsleBot GoD UWorld Freakywok HoneyDew AcidGod CyrixSux"


# Maximum number of words to spew
set tourettes(wordcount) 6

# Minimum number of words to spew
set tourettes(minwords) 3

# List of words to spew
set tourettes(words) {
 {fuck}
 {shit}
 {piss}
 {cunt}
 {bitch}
 {cock}
 {pussy}
 {twat}
                     }

# List of phrases to say. $words will be replaces with the words picked.
set tourettes(phrases) {
 {\001ACTION starts to twitch and yells '$words'!\001}
 {$words!}
 {BAWK! BAWK! $words!}
 {AAAAAAAAAAAA! $words}
 {\001ACTION gets up and screams '$words'\001}
 {\001ACTION grabs $nick's crotch.... '$words'\001}
 {Hey $nick, $words}
 {\001ACTION smacks $nick and yells '$words'} 
 {BOOGER! BOOGER! $words}
                       }

# Random crap to put between words to spew.
set tourettes(worddiv) {
{}
{ }
{!}
                        }

proc tourettes.gospaz {} {
global tourettes
 set chans $tourettes(channel)
 if {$chans == "*"} {set chans [string tolower [channels]]}

 foreach chan $chans {
 set outmsg [randomline $tourettes(phrases)]
 set wordcount [rand $tourettes(wordcount)]
 if {$wordcount < $tourettes(minwords)} {set wordcount $tourettes(minwords)}
 
 set words "";
 for {set l 0} {$l < $wordcount} {incr l} {
  set rword [string tolower [randomline $tourettes(words)]]
  set nword ""
  for {set l2 0} {$l2 < [string length $rword]} {incr l2} {
   set letter [string index $rword $l2]
   if {[rand 2] == 1} {set letter [string toupper $letter]}
 if {$tourettes(funkify) == 1} {set rn [rand 5]} {set rn 0}

 switch $rn {
  "0" {set letter "\002$letter\002"}
  "2" {set letter "\026$letter\026"}
  "4" {set letter "\003[string index "0123456789" [rand 11]]$letter\003"}
            }
   set nword $nword$letter
                                                          }
  set words "${words}${nword}[randomline $tourettes(worddiv)]"
                                          }
                                            
 set user [tourettes.rnduser $chan]
 regsub -all {\$nick} $outmsg $user outmsg
 regsub -all {\$words} $outmsg $words outmsg
 regsub -all {\\001} $outmsg \001 outmsg
 regsub -all {\\002} $outmsg \002 outmsg
 putserv "PRIVMSG $chan :$outmsg"
}
set tourettes(timerid) [timer [expr $tourettes(time) + [rand $tourettes(timepad)]] tourettes.gospaz]
}
set tourettes(timerid) [timer [expr $tourettes(time) + [rand $tourettes(timepad)]] tourettes.gospaz]


proc randomline {text} {
 return [lindex $text [rand [llength $text]]]
}

proc tourettes.rnduser {chan} {
global botnick tourettes
 set clist [chanlist $chan]
 if {([llength $clist] == 1)} {set clist "$clist her"}
 set pickeduser 0
while {$pickeduser == 0} {
                          set user [lindex $clist [rand [llength $clist]]]
                          set pickeduser 1

    foreach n $tourettes(bots) {
     if {([string tolower $user] == [string tolower $n])} {set pickeduser 0}
                              }

                         }
 set uhand [nick2hand $user $chan]
 return $user
}

putlog "Tourettes $tourettes(ver) by David Proper (DrN) -:LoadeD:-"
return "Tourettes $tourettes(ver) by David Proper (DrN) -:LoadeD:-"







These timers:
set tourettes(timerid) [timer [expr $tourettes(time) + [rand $tourettes(timepad)]] tourettes.gospaz]
}
set tourettes(timerid) [timer [expr $tourettes(time) + [rand $tourettes(timepad)]] tourettes.gospaz]

why are there 2 of them?

Why aren't they resetted?

How to reset them after successful usage?