insult.tcl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # insult.tcl
  2. #
  3. # This rather silly script generates random insults and insults people with the
  4. # !insult command.
  5. #
  6. # The script used to connect to insulthost.colorado.edu:1695 to get the
  7. # insults. Unfortunately, the server does not exist any more. Apparently, the
  8. # source code of the insultd created by garnett@colorado.edu that was running
  9. # on insulthost.colorado.edu:1695 was released. The insultd source code can
  10. # still be found in the attachments of the following Mozilla bugzilla:
  11. # https://bugzilla.mozilla.org/show_bug.cgi?id=204356
  12. # All the insults in this script are taken from the insultd source code.
  13. #
  14. # Usage:
  15. # !insult insult yourself
  16. # !insult user insult user
  17. #
  18. # Enable for a channel with: .chanset #channel +insult
  19. # Disable for a channel with: .chanset #channel -insult
  20. # tested versions, might run on earlier versions
  21. package require Tcl 8.6
  22. package require eggdrop 1.8.4
  23. namespace eval ::insult {
  24. # channel flag for enabling/disabling
  25. setudef flag insult
  26. # insult parts from insultd.cf in insultd source code
  27. variable adjectives "acidic antique contemptible culturally-unsound
  28. despicable evil fermented festering foul fulminating humid impure inept
  29. inferior industrial left-over low-quality malodorous off-color
  30. penguin-molesting petrified pointy-nosed salty sausage-snorfling
  31. tastless tempestuous tepid tofu-nibbling unintelligent unoriginal
  32. uninspiring weasel-smelling wretched spam-sucking egg-sucking decayed
  33. halfbaked infected squishy porous pickled coughed-up thick vapid
  34. hacked-up unmuzzled bawdy vain lumpish churlish fobbing rank craven
  35. puking jarring fly-bitten pox-marked fen-sucked spongy droning gleeking
  36. warped currish milk-livered surly mammering ill-borne beef-witted
  37. tickle-brained half-faced headless wayward rump-fed onion-eyed
  38. beslubbering villainous lewd-minded cockered full-gorged rude-snouted
  39. crook-pated pribbling dread-bolted fool-born puny fawning sheep-biting
  40. dankish goatish weather-bitten knotty-pated malt-wormy saucyspleened
  41. motley-mind it-fowling vassal-willed loggerheaded clapper-clawed frothy
  42. ruttish clouted common-kissing pignutted folly-fallen plume-plucked
  43. flap-mouthed swag-bellied dizzy-eyed gorbellied weedy reeky measled
  44. spur-galled mangled impertinent bootless toad-spotted hasty-witted
  45. horn-beat yeasty imp-bladdereddle-headed boil-brained tottering
  46. hedge-born hugger-muggered elf-skinned"
  47. variable amounts "accumulation bucket coagulation enema-bucketful gob
  48. half-mouthful heap mass mound petrification pile puddle stack
  49. thimbleful tongueful ooze quart bag plate ass-full assload"
  50. variable nouns "bat|toenails bug|spit cat|hair chicken|piss dog|vomit
  51. dung fat-woman's|stomach-bile fish|heads guano gunk pond|scum rat|retch
  52. red|dye|number-9 Sun|IPC|manuals waffle-house|grits yoo-hoo dog|balls
  53. seagull|puke cat|bladders pus urine|samples squirrel|guts
  54. snake|assholes snake|bait buzzard|gizzards cat-hair-balls rat-farts
  55. pods armadillo|snouts entrails snake|snot eel|ooze slurpee-backwash
  56. toxic|waste Stimpy-drool poopy poop craptacular|carpet|droppings jizzum
  57. cold|sores anal|warts"
  58. }
  59. proc ::insult::insult { nick host hand chan arg } {
  60. variable adjectives
  61. variable amounts
  62. variable nouns
  63. # check channel flag if enabled in this channel
  64. if {![channel get $chan insult]} {
  65. return 0
  66. }
  67. # set name of insulted person
  68. set insultnick $nick
  69. if {$arg != ""} {
  70. set insultnick [lindex $arg 0]
  71. }
  72. # generate insult:
  73. # You are nothing but a(n) {adj1} {amt} of {adj2} {noun}
  74. set adj1 [lindex $adjectives [rand [llength $adjectives]]]
  75. set adj2 [lindex $adjectives [rand [llength $adjectives]]]
  76. set amt [lindex $amounts [rand [llength $amounts]]]
  77. set noun [lindex $nouns [rand [llength $nouns]]]
  78. set noun [string map {"|" " "} $noun]
  79. set an "a"
  80. if {[string match {[aeiouh]} [string index $adj1 0]]} {
  81. set an "an"
  82. }
  83. set insult "You are nothing but $an $adj1 $amt of $adj2 $noun"
  84. puthelp "PRIVMSG $chan :$insultnick: $insult"
  85. return 1
  86. }
  87. namespace eval ::insult {
  88. bind pub - !insult ::insult::insult
  89. putlog "Loaded insult.tcl"
  90. }