From 49868ec32c72b8f40ae2d39a9c06894be9f585d0 Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Wed, 17 Jul 2013 21:11:00 +0100 Subject: [PATCH] commented some code --- bot.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.sh b/bot.sh index 067b80d..5064067 100755 --- a/bot.sh +++ b/bot.sh @@ -7,10 +7,11 @@ echo "NICK $nick" > $config echo "USER $user" >> $config echo "JOIN #$channel" >> $config -tail -f $config | telnet $server 6667 | while read res; +tail -f $config | telnet $server 6667 | while read res do # do things when you see output case "$res" in + # respond to ping requests from the server PING*) echo "$res" | sed "s/PING/PONG/" >> $config ;; @@ -18,14 +19,17 @@ do *"You have not"*) echo "JOIN #$channel" >> $config ;; + # run when someone joins *JOIN*) who=$(echo "$res" | sed -r "s/:(.*)\!.*@.*/\1/") if [ "$who" = "$nick" ] then continue fi - echo "PRIVMSG #$channel :Welcome $who" >> $config + echo "PRIVMSG #$channel :Welcome $who, have some op :)" >> $config + echo "MODE #$channel +o $who" >> $config ;; + # run when a message is seen *PRIVMSG*) echo "$res" who=$(echo "$res" | sed -r "s/:(.*)\!.*@.*/\1/")