diff options
author | Joe <joe@joelightning.com> | 2012-03-14 12:18:05 +0000 |
---|---|---|
committer | Joe <joe@joelightning.com> | 2012-03-14 12:18:05 +0000 |
commit | 489e7e8ca6609f2c72a0f4fc00459ec19a5d9038 (patch) | |
tree | 9c755e1a2bffd45834ab5d496ef7bbfa47c26535 | |
parent | 7ef4f7a7f8c7810fa0fc7385a055453ac1694c79 (diff) |
Tweaked code that repeats something that other people say to not repeat the same thing twice.
-rw-r--r-- | hack_of_all_hacks | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hack_of_all_hacks b/hack_of_all_hacks index a3f9d87..5a044c9 100644 --- a/hack_of_all_hacks +++ b/hack_of_all_hacks @@ -48,11 +48,15 @@ function l33t_codes stuff_said="$( echo ${line} | cut --complement -d ' ' -f 1,2,3 )" stuff_said="${stuff_said#:}" + [[ ${stuff_said} != ${i_repeated} ]] && say_again=yesyes + # If two different people say the same thing in a row then say it again # for fun. - if [[ ${stuff_said} == ${lastline} ]] && [[ ${person} != ${lastsender} ]] + if [[ ${stuff_said} == ${lastline} ]] && [[ ${person} != ${lastsender} ]] && [[ ${say_again} != nono ]] then send_msg "${channel_it_came_from}" "${stuff_said}" + i_repeated="${stuff_said}" + say_again=nono fi lastline="${stuff_said}" |