4
0

insult.tcl 4.1 KB

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