2016-09-06 14:25:46 -04:00
[ -f functions.sh ] && source functions.sh
2017-05-15 20:01:14 -04:00
who = " ${ 1 %!* } "
who = " ${ who // : } "
2016-09-06 18:17:34 -04:00
shift
2016-09-06 14:25:46 -04:00
chan = " $1 "
shift
# each word is stored in an associative array, with the actions to be taken as the array's contents.
2016-09-06 18:17:34 -04:00
# the variable $chan contains the channel that caused the trigger.
# the variable $who contains the nick that caused the trigger.
2016-09-06 14:25:46 -04:00
declare -A keywords
2017-04-08 00:33:42 -04:00
keywords[ linux] = " msg \" $chan \" \"Linux is $( shuf -n1 -e awesome God great lovely fantastic amazing wonderful) !\" "
2017-05-07 15:24:00 -04:00
keywords[ windows] = " msg \" $chan \" \" $( shuf -n1 -e\
"Failure is not an option, it comes bundled with Windows!" \
"Apple got all pissed off because I farted in their store. It's not my falt they don't have Windows..." \
"Windows is dumb!" \
"Did you know that Micro Soft is Linda's pet name for Bill Gates?" \
"A computer without Windows is like a chocolate cake without the mustard." \
"Windows is stupid" \
"In a world without walls and fences - who needs windows and gates?" \
"Windows, plug and pray." \
"Windows - Just another pain in the glass." \
"Windows, it's not pretty, it's not ugly, but it's pretty ugly." ) !\" "
2020-08-14 21:39:51 -04:00
keywords[ emacs] = " msg \" $chan \" \" $who , Real men of genius use vim!\" "
2017-05-13 23:42:21 -04:00
keywords[ eloquence] = " msg \" $chan \" \" $( shuf -n1 -e \
"anticaesure" \
"caesure" \
2020-07-23 01:16:57 -04:00
"Goodhesville" \
2017-05-13 23:42:21 -04:00
"hh've" \
2020-07-23 01:16:57 -04:00
"Hoobhestank" \
2017-05-13 23:42:21 -04:00
"tzsche" \
"uncosp" \
"webhesday" \
"wedhesday" ) \" "
2017-05-13 23:28:25 -04:00
keywords[ eloquents] = " msg \" $chan \" \" $( shuf -n1 -e \
"anticaesure" \
"caesure" \
"hh've" \
"tzsche" \
"uncosp" \
"webhesday" \
"wedhesday" ) \" "
2017-05-15 20:01:14 -04:00
keywords[ jaws] = " msg \" $chan \" \" $( shuf -n1 -e \
" ${ who } : watch out for sharks! " \
" Ooooo! Jaws! Yeah, let's spend 1,500 bucks to buy what NVDA can do for free... Not much of an accountant are you ${ who } ? " ) \" "
2017-05-24 14:16:47 -04:00
keywords[ jfw] = " msg \" $chan \" JFW: Acronym that means: Jaws! FUCKING WORTHLESS! "
2020-08-14 21:39:51 -04:00
keywords[ emacspeak] = " msg \" $chan \" \" $who , Real men of genius use vim!\" "
keywords[ nano] = " msg \" $chan \" \" $who , Real men of genius use vim!\" "
keywords[ pidgin] = " msg \" $chan \" \" $who , Real men of genius use irssi!\" "
keywords[ weechat] = " msg \" $chan \" \" $who , Real men of genius use irssi!\" "
keywords[ thunderbird] = " msg \" $chan \" \" $who , Real dogs use mutt, real men of genius use cat on a mailbox file!\" "
keywords[ gedit] = " msg \" $chan \" \" $who , Real men of genius use vim!\" "
keywords[ pluma] = " msg \" $chan \" \" $who , Real men of genius use vim!\" "
2017-05-13 07:02:53 -04:00
keywords[ chicken] = " msg \" $chan \" \" $who , I'm gonna grab me $( shuf -n1 -e "a case of beer" "a weed eater" "a 5 gallon jug of vaseline" "a can of wd40" ) and a $( shuf -n1 -e dead frozen live young baby) chicken, and $( shuf -n1 -e "have fun" "make chicks" "lay it like an egg" "put my beak where it don't belong" ) ALL NIGHT LONG!!!\" "
2018-11-06 16:47:08 -05:00
keywords[ feather] = " msg \" $chan \" \" $who : Erotic is using a feather. Kinky is using the whole chicken!!!\" "
2020-04-20 18:12:16 -04:00
keywords[ feathers] = " msg \" $chan \" \" $who : Erotic is using a feather. Kinky is using the whole chicken!!!\" "
2016-09-06 22:35:15 -04:00
keywords[ dragonforce] = " msg \" $chan \" \" $who : I love DragonForce!!!\" "
2017-05-07 13:59:14 -04:00
keywords[ vim] = " msg \" $chan \" \" $( shuf -n1 -e \
"Praise vim! HA" \
2017-05-07 15:24:00 -04:00
"In times of trouble, just ask yourself, 'What would Bram Moolenaar do?'." \
2017-05-08 08:24:55 -04:00
"Vim is like a Ferrari, if you're a beginner, it handles like a bitch, but once you get the hang of it, it's small, powerful and FAST!" \
"VIM is like a new model Ferrari, and sounds like one too - 'VIIIIIIMMM!'" \
2017-05-07 13:59:14 -04:00
"Only through vim can you be saved! HA" ) \" "
2016-09-06 14:25:46 -04:00
2016-09-06 22:35:15 -04:00
wordList = " $( echo " ${ @,, } " | tr '[:space:]' $'\n' | sort -u) "
2016-09-06 14:25:46 -04:00
for w in ${ wordList //[[ : punct : ]]/ } ; do
2017-05-06 13:06:30 -04:00
if [ [ -n " ${ keywords [ ${ w ,, } ] } " && " $lastWordMatch " != " ${ keywords [ ${ w ,, } ] } " ] ] ; then
2016-09-06 14:25:46 -04:00
eval ${ keywords [ ${ w ,, } ] }
2017-05-06 13:06:30 -04:00
lastWordMatch = " ${ keywords [ ${ w ,, } ] } "
2016-09-06 14:25:46 -04:00
fi
done
2016-09-16 22:00:59 -04:00
# Example of dealing with multi word triggers.
2016-09-25 00:25:52 -04:00
# Reset wordList without sorting it and with spaces removed.
wordList = " $( echo " ${ @,, } " | tr -d '[:space:]' ) "
2020-12-01 20:48:26 -05:00
if [ [ " ${ wordList ,, } " = ~ .*nowplaying:.* ] ] ; then
2018-11-06 16:47:08 -05:00
if [ " $who " = "lilmike" ] ; then
msg " $chan " "Ewww, it sounds like 2 robots making out!"
else
2016-09-25 00:27:31 -04:00
act " $chan " " $( shuf -n1 -e "cranks the volume up to 11" "got soooo high at that show" "boogies down to the sound of the band" ) ! "
2016-09-16 22:00:59 -04:00
fi
2018-11-06 16:47:08 -05:00
fi