diff options
author | Joe <joe@joelightning.com> | 2011-11-11 20:38:46 +0000 |
---|---|---|
committer | Joe <joe@joelightning.com> | 2011-11-11 20:38:46 +0000 |
commit | c63297e77c3bc5df23712a6222288a0ec8347e77 (patch) | |
tree | 7cb739bc77c8b81d93e43fb2e4ea609d327b83dd /hack_of_all_hacks | |
parent | f8cb9c1197e5a35e979842b125f8f77177d28ee4 (diff) |
Tried to fix repeat code
Diffstat (limited to 'hack_of_all_hacks')
-rw-r--r-- | hack_of_all_hacks | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hack_of_all_hacks b/hack_of_all_hacks index 69f7197..1ab75e8 100644 --- a/hack_of_all_hacks +++ b/hack_of_all_hacks @@ -28,14 +28,16 @@ function l33t_codes # Repeat # ########## + stuff_said="$( echo ${line} | cut --complement -d ' ' -f 1,2,3 )" + # If two different people say the same thing in a row then say it again # for fun. - if [[ ${line##*PRIVMSG} == ${lastline} ]] && [[ ${person} != ${lastsender} ]] + if [[ ${stuff_said} == ${lastline} ]] && [[ ${person} != ${lastsender} ]] then - send_msg "${channel_it_came_from}" "${line##*PRIVMSG}" + send_msg "${channel_it_came_from}" "${stuff_said}" fi - lastline="${line##*PRIVMSG}" + lastline="${stuff_said}" lastsender="${person}" ################# |