From 849e13bd34d55d4a98b6463a5826683053995df7 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Wed, 6 Oct 2021 18:13:55 -0400 Subject: Fixed an important bug! --- atom.xml | 4 ++-- log-211006-1.gmi | 10 +++++----- tak | 13 +++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/atom.xml b/atom.xml index 50671c3..33d9e47 100644 --- a/atom.xml +++ b/atom.xml @@ -2,7 +2,7 @@ gemini://l-3.space/ l-3.space - 2021-10-06T13:16:38.103000+00:00 + 2021-10-06T22:28:53.414000+00:00 tslil hello@l-3.space @@ -66,7 +66,7 @@ gemini://l-3.space/log-211006-1.gmi Play Tak against a bot over Gemini! - 2021-10-06T13:16:38.103000+00:00 + 2021-10-06T22:28:53.414000+00:00 diff --git a/log-211006-1.gmi b/log-211006-1.gmi index 81daed1..3117f4f 100644 --- a/log-211006-1.gmi +++ b/log-211006-1.gmi @@ -1,4 +1,4 @@ -Time-stamp: <2021-10-06 13h16 UTC> +Time-stamp: <2021-10-06 22h28 UTC> # Play Tak against a bot over Gemini! @@ -12,10 +12,10 @@ At present i've attempted to limit the server to running 10 instances of the bot #!/bin/bash META="text/gemini; charset=utf-8" -input="${QUERY_STRING//[^abcde12345CFW+\-><]/}" +input="${QUERY_STRING//[^abcde12345CFS+\-><]/}" if [ -n "$input" ]; then - new_ptn="${PATH_INFO//[^abcde12345CFW.+\-LR]/}" - new_ptn="$(echo ${new_ptn} | tr 'LR' '<>')" + new_ptn="${PATH_INFO//[^abcde12345CFS.+\-LR]/}" + new_ptn=$(echo $new_ptn | tr 'LR' '<>') printf '20 %s\r\n' "$META" printf '```\n' while [ "$(pgrep geminict | wc -l)" > "10" ]; do @@ -32,7 +32,7 @@ if [ -n "$input" ]; then printf '```\n' echo 'Please be patient, ct1986 is a slow bot and no more than 10 instances are allowed concurrently on the server.' echo "=> gemini://l-3.space/tak/$new_ptn/ Enter ply" - echo 'Note: all input is stripped to match only [abcde12345CFW+-<>].' + echo 'Note: all input is stripped to match only [abcde12345CFS+-<>].' else printf "10 Enter ply:\r\n" fi; diff --git a/tak b/tak index 9121cdb..32371bf 100755 --- a/tak +++ b/tak @@ -1,10 +1,10 @@ #!/bin/bash META="text/gemini; charset=utf-8" -input="${QUERY_STRING//[^abcde12345CFW+-><]/}" +input="${QUERY_STRING//[^abcde12345CFS+\-><]/}" if [ -n "$input" ]; then - new_ptn="${PATH_INFO//[^abcde12345CFW.+-LR]/}" - new_ptn=$(echo ${new_ptn@Q} | tr 'LR' '<>') + new_ptn="${PATH_INFO//[^abcde12345CFS.+\-LR]/}" + new_ptn=$(echo $new_ptn | tr 'LR' '<>') printf '20 %s\r\n' "$META" printf '```\n' while [ "$(pgrep geminict | wc -l)" > "10" ]; do @@ -14,13 +14,14 @@ if [ -n "$input" ]; then output=$(geminict ${attempt_ptn@Q}) if [ "$?" == "0" ]; then ct1986=$(echo "$output" | awk '/ct1986 says:/ {print $3}') - new_ptn="$attempt_ptn.$ct1986." + new_ptn="$attempt_ptn$ct1986." fi; + new_ptn=${new_ptn//>/R}; new_ptn=${new_ptn// gemini://l-3.space/tak/$(echo ${new_ptn@Q} | tr '<>' 'LR')/ Enter ply" - echo 'Note: all input is stripped to match only [abcde12345CFW+-<>].' + echo "=> gemini://l-3.space/tak/$new_ptn/ Enter ply" + echo 'Note: all input is stripped to match only [abcde12345CFS+-<>].' else printf "10 Enter ply:\r\n" fi; -- cgit v1.3.1