trans

Unnamed repository; edit this file 'description' to name the repository.
git clone git://fqcor.com/trans.git
torsocks git clone git://fqcoretoclxwqpy3dwktkskmwywrcktgnpviesveq6vrjhqhdc6y4fid.onion/trans.git
Log | Files | Refs | README | LICENSE

commit 5ffc77924e4a00454e438351c01246be7cc5d69e
parent 67dbd1266aba0942fb70787b0d49d865a87f2caf
Author: mys <>
Date:   Tue,  4 Aug 2020 04:11:09 +0200

Add rots

Diffstat:
Mbotreply | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/botreply b/botreply @@ -2,6 +2,22 @@ source botenv +rot(){ + [ "$1" -lt 27 ] || return 1 + vals=( $(echo -n $2 | od -An -tuC) ) + for i in "${!vals[@]}"; do + if ((${vals[i]}>64 && ${vals[i]}<91)) + then + printf "\x$(printf %x $(( (vals[i]-65+$1)%26 +65 )))" + elif ((${vals[i]}>96 && ${vals[i]}<123)) + then + printf "\x$(printf %x $(( (vals[i]-97+$1)%26 +97 )))" + else + printf "\x$(printf %x ${vals[i]})" + fi + done +} + case "$1" in *"PING "*) sed 's/.*\(:.*\)/PONG \1/' <<< $1 @@ -14,6 +30,14 @@ case "$1" in echo "JOIN $channel" echo "MODE $nick +B" ;; + *"PRIVMSG "*":$nick: :rot"*|*"PRIVMSG "*":$nick, :rot"*) + num=$(echo "$1" | sed "s/.*:$nick[,:] :rot\([0-9]*\).*/\1/") + exp=$(echo "$1" | sed "s/.*:$nick[,:] :rot[0-9]* //") + rot=$(rot $num "$exp") + name=${1%%!*} + name=${name#:} + echo "$1" | awk -v "name=$name" -v "rot=$rot" '{print "PRIVMSG "$3" :"name": "rot}' + ;; *"PRIVMSG "*":$nick:"*|*"PRIVMSG "*":$nick,"*) direction=$(echo "$1" | sed "/.*:$nick[,:] \([a-z]*\)-*[:>]\([a-z]*\) .*/!d;s//\1:\2/") if [ -n "$direction" ];