diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 0000000..bbf1de4 --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,14 @@ +[tasks.BUILD] +description = "Build hoge" +script = [''' +#!/usr/bin/env bash +echo "build ${@}..." +'''] + +[tasks.TEST] +description = "Test hoge" +script = [''' +#!/usr/bin/env python3 +print("test ...") +'''] +dependencies = ["BUILD"] diff --git a/scpt/api_card.zsh b/scpt/api_card.zsh index a710227..0145ebf 100755 --- a/scpt/api_card.zsh +++ b/scpt/api_card.zsh @@ -1,8 +1,8 @@ #!/bin/zsh # raid-boss-admin -cfg=$HOME/.config/atr/scpt/card_config.json -cfg_ai=$HOME/.config/atr/scpt/card_config_ai.json +cfg=$HOME/.config/ai/scpt/card_config.json +cfg_ai=$HOME/.config/ai/scpt/card_config_ai.json # { # "raid_admin":"yui.bsky.social", # "raid_time": "", @@ -16,7 +16,7 @@ case $OSTYPE in esac # 1=handle, 2=did, 3=opt, 4=sub -fav_com=$HOME/.config/atr/scpt/api_fav.zsh +fav_com=$HOME/.config/ai/scpt/api_fav.zsh function user_data(){ u=`echo $data|jq -r .username` @@ -348,9 +348,9 @@ function user_card(){ } function battle_raid(){ - f_raid_user=$HOME/.config/atr/txt/card_raid_user.txt - f_raid_start_cp=$HOME/.config/atr/txt/card_raid_start_cp.txt - f_raid_start_time=$HOME/.config/atr/txt/card_raid_start_time.txt + f_raid_user=$HOME/.config/ai/txt/card_raid_user.txt + f_raid_start_cp=$HOME/.config/ai/txt/card_raid_start_cp.txt + f_raid_start_time=$HOME/.config/ai/txt/card_raid_start_time.txt boss_cp=150000 if [ `date +%u` -ge 6 ];then @@ -658,16 +658,16 @@ function battle_server(){ rr=`date +"%H%M"` a_team=bluesky b_team=mastodon - f_server_prezent=$HOME/.config/atr/txt/card_server_prezent.txt - f_server=$HOME/.config/atr/txt/card_server.txt - f_server_user_at=$HOME/.config/atr/txt/card_server_user_at.txt - f_server_user_ap=$HOME/.config/atr/txt/card_server_user_ap.txt - f_server_ap=$HOME/.config/atr/txt/card_server_ap.txt - f_server_at=$HOME/.config/atr/txt/card_server_at.txt - f_server_start_time=$HOME/.config/atr/txt/card_server_start_time.txt + f_server_prezent=$HOME/.config/ai/txt/card_server_prezent.txt + f_server=$HOME/.config/ai/txt/card_server.txt + f_server_user_at=$HOME/.config/ai/txt/card_server_user_at.txt + f_server_user_ap=$HOME/.config/ai/txt/card_server_user_ap.txt + f_server_ap=$HOME/.config/ai/txt/card_server_ap.txt + f_server_at=$HOME/.config/ai/txt/card_server_at.txt + f_server_start_time=$HOME/.config/ai/txt/card_server_start_time.txt at_endpoint=`curl -sL https://plc.directory/$did|jq -r ".service.[].serviceEndpoint"|cut -d . -f 1-2|cut -d / -f 3` - at_endpoint_f=$HOME/.config/atr/txt/at_endpoint_${at_endpoint}_.txt + at_endpoint_f=$HOME/.config/ai/txt/at_endpoint_${at_endpoint}_.txt touch $at_endpoint_f a_team=$at_endpoint f_server_at=$at_endpoint_f @@ -780,7 +780,7 @@ function battle_server(){ #echo "┗ @${commit_user_ap}" #echo "----" #mastodon - at_end_t=`ls $HOME/.config/atr/txt/at_endpoint_*.txt` + at_end_t=`ls $HOME/.config/ai/txt/at_endpoint_*.txt` at_end_n=`echo "$at_end_t"|wc -l` for ((ati=1;ati<=$at_end_n;ati++)) do @@ -871,7 +871,7 @@ function l_cards() { } url=https://api.syui.ai -cfg=$HOME/.config/atr/scpt/card_config.json +cfg=$HOME/.config/ai/scpt/card_config.json if [ -f $cfg ];then raid_run=`cat $cfg|jq -r .raid_run` raid_boss_admin=`cat $cfg|jq -r .raid_admin` @@ -881,16 +881,16 @@ if [ -f $cfg ];then raid_sp_card=`cat $cfg|jq -r .raid_card` fi -f_raid=$HOME/.config/atr/txt/card_raid.txt +f_raid=$HOME/.config/ai/txt/card_raid.txt raid_cp=`cat $f_raid` d=`date +"%Y%m%d"` nd=`date +"%Y%m%d" -d '1 day'` username=`echo $1|cut -d . -f 1` handle=$1 url_user_all="$url/users?itemsPerPage=2000" -f=$HOME/.config/atr/scpt/t.webp -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +f=$HOME/.config/ai/scpt/t.webp +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` if [ -z "$1" ];then exit fi @@ -999,7 +999,7 @@ server_at_n=`date --iso-8601=seconds` day_m=`date +"%H%M"` day_mm=`date +"%H%M" -d "-1 min"` day_mmm=`date +"%H%M" -d "-2 min"` -f_raid=$HOME/.config/atr/txt/card_raid.txt +f_raid=$HOME/.config/ai/txt/card_raid.txt # luck luck=`echo $data|jq -r .luck` @@ -1072,7 +1072,7 @@ if [ "atp" = "`echo $3|cut -d = -f 1`" ];then fi if [ "server_battle_mode" = "$3" ];then - f_server_prezent=$HOME/.config/atr/txt/card_server_prezent.txt + f_server_prezent=$HOME/.config/ai/txt/card_server_prezent.txt if [ "syui.ai" != "$1" ];then no admin exit diff --git a/scpt/api_card_raid_win.zsh b/scpt/api_card_raid_win.zsh index 74fa2e0..cae21f9 100755 --- a/scpt/api_card_raid_win.zsh +++ b/scpt/api_card_raid_win.zsh @@ -1,9 +1,9 @@ #!/bin/zsh url=https://api.syui.ai -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -f_reid_user=$HOME/.config/atr/txt/card_reid_user.txt +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +f_reid_user=$HOME/.config/ai/txt/card_reid_user.txt n=`cat $f_reid_user|wc -l` for ((i=1;i<=$n;i++)) diff --git a/scpt/api_chara.zsh b/scpt/api_chara.zsh index 891eaa3..75a5183 100755 --- a/scpt/api_chara.zsh +++ b/scpt/api_chara.zsh @@ -66,8 +66,8 @@ host_card=https://card.syui.ai/json/card.json ran=$(($RANDOM % 3)) -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` handle=$1 did=$2 diff --git a/scpt/api_egg.zsh b/scpt/api_egg.zsh index 2d68e83..732a775 100755 --- a/scpt/api_egg.zsh +++ b/scpt/api_egg.zsh @@ -9,8 +9,8 @@ esac atr=$HOME/.cargo/bin/atr host=https://api.syui.ai -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` egg_card=40 diff --git a/scpt/api_fav.zsh b/scpt/api_fav.zsh index b5006b4..4ea779d 100755 --- a/scpt/api_fav.zsh +++ b/scpt/api_fav.zsh @@ -9,8 +9,8 @@ esac atr=$HOME/.cargo/bin/atr host=https://api.syui.ai -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` handle=$1 did=$2 diff --git a/scpt/api_ten.zsh b/scpt/api_ten.zsh index c99bafa..0d9cd46 100755 --- a/scpt/api_ten.zsh +++ b/scpt/api_ten.zsh @@ -22,17 +22,17 @@ if [ -z "$5" ];then exit fi -card_pay=$HOME/.config/atr/scpt/card_pay.zsh +card_pay=$HOME/.config/ai/scpt/card_pay.zsh atr=$HOME/.cargo/bin/atr host=https://api.syui.ai host_card=https://card.syui.ai/json/card.json host_card_json=`curl -sL $host_card` -n_cid=$HOME/.config/atr/txt/tmp_notify_cid.txt -f_cfg=$HOME/.config/atr/txt/tmp_ten_config.txt +n_cid=$HOME/.config/ai/txt/tmp_notify_cid.txt +f_cfg=$HOME/.config/ai/txt/tmp_ten_config.txt function moon_check(){ moon_now=`date +"%Y%m%d"` - moon_j=$HOME/.config/atr/scpt/full_moon.j + moon_j=$HOME/.config/ai/scpt/full_moon.j if [ -f $moon_j ];then moon_t=`cat $moon_j|jq ".[]|select(.data == \"$moon_now\")"` if [ -n "$moon_t" ];then @@ -59,8 +59,8 @@ ran_z=$(($RANDOM % 540)) ran_cm=$(($RANDOM % 3)) ran_first=$(($RANDOM % 6)) -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` handle=$1 did=$2 diff --git a/scpt/api_ten_auto.zsh b/scpt/api_ten_auto.zsh index c5c9362..5e5f29c 100755 --- a/scpt/api_ten_auto.zsh +++ b/scpt/api_ten_auto.zsh @@ -6,13 +6,13 @@ case $OSTYPE in ;; esac -card_pay=$HOME/.config/atr/scpt/card_pay.zsh +card_pay=$HOME/.config/ai/scpt/card_pay.zsh atr=$HOME/.cargo/bin/atr host=https://api.syui.ai host_card=https://card.syui.ai/json/card.json host_card_json=`curl -sL $host_card` -n_cid=$HOME/.config/atr/txt/tmp_notify_cid.txt -f_cfg=$HOME/.config/atr/txt/tmp_ten_config.txt +n_cid=$HOME/.config/ai/txt/tmp_notify_cid.txt +f_cfg=$HOME/.config/ai/txt/tmp_ten_config.txt handle=$1 did=$2 username=`echo $1|cut -d . -f 1` @@ -27,8 +27,8 @@ if [ -f $f_cfg ];then nn=`cat $f_cfg|wc -c` fi -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` function ten_yak() { unset ran_a diff --git a/scpt/at_img.zsh b/scpt/at_img.zsh index fee5a65..adb51e2 100755 --- a/scpt/at_img.zsh +++ b/scpt/at_img.zsh @@ -1,8 +1,8 @@ #!/bin/zsh dir=${0:a:h} -f=$HOME/.config/atr/scpt/png/t.png -f_sleep=$HOME/.config/atr/scpt/png/sleep +f=$HOME/.config/ai/scpt/png/t.png +f_sleep=$HOME/.config/ai/scpt/png/sleep cid=$1 uri=$2 diff --git a/scpt/bot_card.zsh b/scpt/bot_card.zsh index 27bcc7e..62e099a 100755 --- a/scpt/bot_card.zsh +++ b/scpt/bot_card.zsh @@ -2,11 +2,11 @@ host_at=bsky.social url_at=https://$host_at/xrpc/com.atproto.repo.listRecords -scpt=$HOME/.config/atr/scpt/api_card.zsh +scpt=$HOME/.config/ai/scpt/api_card.zsh handle=skychan.social did=did:plc:7hgow77uky7lgbinwyvbzhar -f=$HOME/.config/atr/card_bot.txt +f=$HOME/.config/ai/card_bot.txt touch $f n=5 diff --git a/scpt/bot_kawaii.zsh b/scpt/bot_kawaii.zsh index e09abbb..325d17d 100755 --- a/scpt/bot_kawaii.zsh +++ b/scpt/bot_kawaii.zsh @@ -1,6 +1,6 @@ #!/bin/zsh -d=$HOME/.config/atr/txt +d=$HOME/.config/ai/txt mkdir -p $d f=$d/kawaii.txt diff --git a/scpt/card_box.zsh b/scpt/card_box.zsh index 311d0b9..c66685a 100755 --- a/scpt/card_box.zsh +++ b/scpt/card_box.zsh @@ -5,15 +5,15 @@ exit atr=$HOME/.cargo/bin/atr url_j=https://card.syui.ai/json/card.json -tcid=$HOME/.config/atr/txt/tmp_notify_cid.txt +tcid=$HOME/.config/ai/txt/tmp_notify_cid.txt handle=$1 did=$2 cid=$3 uri=$4 -if [ ! -d $HOME/.config/atr/txt ];then - mkdir -p $HOME/.config/atr/txt +if [ ! -d $HOME/.config/ai/txt ];then + mkdir -p $HOME/.config/ai/txt fi case $OSTYPE in diff --git a/scpt/card_fortune.zsh b/scpt/card_fortune.zsh index c7fd860..3f1d70f 100755 --- a/scpt/card_fortune.zsh +++ b/scpt/card_fortune.zsh @@ -2,15 +2,15 @@ atr=$HOME/.cargo/bin/atr url_j=https://card.syui.ai/json/card.json -tcid=$HOME/.config/atr/txt/tmp_notify_cid.txt +tcid=$HOME/.config/ai/txt/tmp_notify_cid.txt handle=$1 did=$2 cid=$3 uri=$4 -if [ ! -d $HOME/.config/atr/txt ];then - mkdir -p $HOME/.config/atr/txt +if [ ! -d $HOME/.config/ai/txt ];then + mkdir -p $HOME/.config/ai/txt fi case $OSTYPE in @@ -150,8 +150,8 @@ if [ "`cat $tcid`" != "$cid" ];then fi fi -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` if [ $luck -eq 7 ];then tmp=`curl -X PATCH -H "Content-Type: application/json" -d "{\"luck_at\":\"$luck_at_n\",\"token\":\"$token\",\"luck\": $luck, \"next\": \"$nd\"}" -s $url/users/$uid` diff --git a/scpt/card_fortune_en.zsh b/scpt/card_fortune_en.zsh index ab2d053..04f18fa 100755 --- a/scpt/card_fortune_en.zsh +++ b/scpt/card_fortune_en.zsh @@ -2,15 +2,15 @@ atr=$HOME/.cargo/bin/atr url_j=https://card.syui.ai/json/card.json -tcid=$HOME/.config/atr/txt/tmp_notify_cid.txt +tcid=$HOME/.config/ai/txt/tmp_notify_cid.txt handle=$1 did=$2 cid=$3 uri=$4 -if [ ! -d $HOME/.config/atr/txt ];then - mkdir -p $HOME/.config/atr/txt +if [ ! -d $HOME/.config/ai/txt ];then + mkdir -p $HOME/.config/ai/txt fi case $OSTYPE in @@ -136,8 +136,8 @@ if [ "`cat $tcid`" != "$cid" ];then fi fi -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` if [ $luck -eq 7 ];then tmp=`curl -X PATCH -H "Content-Type: application/json" -d "{\"luck_at\":\"$luck_at_n\",\"token\":\"$token\",\"luck\": $luck, \"next\": \"$nd\"}" -s $url/users/$uid` diff --git a/scpt/card_pay.zsh b/scpt/card_pay.zsh index df11f56..c5080f5 100755 --- a/scpt/card_pay.zsh +++ b/scpt/card_pay.zsh @@ -9,8 +9,8 @@ esac atr=$HOME/.cargo/bin/atr host=https://api.syui.ai host_card=https://card.syui.ai/json/card.json -pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` handle=$1 username=`echo $1|cut -d . -f 1` did=$2 diff --git a/scpt/card_tarot_en.zsh b/scpt/card_tarot_en.zsh index aea2281..0b0f966 100755 --- a/scpt/card_tarot_en.zsh +++ b/scpt/card_tarot_en.zsh @@ -2,15 +2,15 @@ atr=$HOME/.cargo/bin/atr url_j=https://card.syui.ai/json/card.json -tcid=$HOME/.config/atr/txt/tmp_notify_cid.txt +tcid=$HOME/.config/ai/txt/tmp_notify_cid.txt handle=$1 did=$2 cid=$3 uri=$4 -if [ ! -d $HOME/.config/atr/txt ];then - mkdir -p $HOME/.config/atr/txt +if [ ! -d $HOME/.config/ai/txt ];then + mkdir -p $HOME/.config/ai/txt fi case $OSTYPE in diff --git a/scpt/follow_all.zsh b/scpt/follow_all.zsh index f5b0724..794123d 100755 --- a/scpt/follow_all.zsh +++ b/scpt/follow_all.zsh @@ -1,6 +1,6 @@ #!/bin/zsh -d=$HOME/.config/atr/txt +d=$HOME/.config/ai/txt mkdir -p $d unset cursor diff --git a/scpt/invite.zsh b/scpt/invite.zsh index 91d83af..aa0a88c 100755 --- a/scpt/invite.zsh +++ b/scpt/invite.zsh @@ -1,6 +1,6 @@ #!/bin/zsh -admin_password=`cat $HOME/.config/atr/api_card.json|jq -r .pds_admin_password` +admin_password=`cat $HOME/.config/ai/api_card.json|jq -r .pds_admin_password` if [ -n "$1" ];then host=$1 else diff --git a/scpt/mastodon.zsh b/scpt/mastodon.zsh index 12cf282..a2fb78f 100755 --- a/scpt/mastodon.zsh +++ b/scpt/mastodon.zsh @@ -9,7 +9,7 @@ esac PATH=$PATH:$HOME/.cargo/bin d=$HOME/.config/msr f=$HOME/.config/msr/notify_log.txt -card=$HOME/.config/atr/scpt/api_card.zsh +card=$HOME/.config/ai/scpt/api_card.zsh if [ ! -d $d ];then mkdir -p $d @@ -49,8 +49,8 @@ function card_env() { updated_at_o=`date --iso-8601=seconds -d '-1 day'` username=`echo $1|cut -d . -f 1` url_user_all="$host/users?itemsPerPage=2000" - pass=`cat $HOME/.config/atr/api_card.json|jq -r .password` - token=`cat $HOME/.config/atr/api_card.json|jq -r .token` + pass=`cat $HOME/.config/ai/api_card.json|jq -r .password` + token=`cat $HOME/.config/ai/api_card.json|jq -r .token` data_tmp=`curl -sL $url_user_all` data=`echo "$data_tmp"|jq ".[]|select(.username == \"$ap\")"` if [ -z "$data" ];then @@ -212,12 +212,12 @@ function card_s(){ a_team=mastodon b_team=bluesky rr=`date +"%H%M"` - f_server=$HOME/.config/atr/txt/card_server.txt - f_server_user_at=$HOME/.config/atr/txt/card_server_user_at.txt - f_server_user_ap=$HOME/.config/atr/txt/card_server_user_ap.txt - f_server_ap=$HOME/.config/atr/txt/card_server_ap.txt - f_server_at=$HOME/.config/atr/txt/card_server_at.txt - f_server_start_time=$HOME/.config/atr/txt/card_server_start_time.txt + f_server=$HOME/.config/ai/txt/card_server.txt + f_server_user_at=$HOME/.config/ai/txt/card_server_user_at.txt + f_server_user_ap=$HOME/.config/ai/txt/card_server_user_ap.txt + f_server_ap=$HOME/.config/ai/txt/card_server_ap.txt + f_server_at=$HOME/.config/ai/txt/card_server_at.txt + f_server_start_time=$HOME/.config/ai/txt/card_server_start_time.txt if [ `cat $f_server` -eq 1 ];then echo shutdown server battle diff --git a/scpt/openai_like.zsh b/scpt/openai_like.zsh index 7eff176..b4cf315 100755 --- a/scpt/openai_like.zsh +++ b/scpt/openai_like.zsh @@ -29,7 +29,7 @@ like_old=`echo $data|jq -r .like` nolike=$(($RANDOM % 30)) like=$(($RANDOM % 10)) like_at=`date --iso-8601=seconds` -token=`cat $HOME/.config/atr/api_card.json|jq -r .token` +token=`cat $HOME/.config/ai/api_card.json|jq -r .token` echo nolike $nolike echo like $like diff --git a/scpt/photo.zsh b/scpt/photo.zsh index 34b3937..a5e416b 100755 --- a/scpt/photo.zsh +++ b/scpt/photo.zsh @@ -4,7 +4,7 @@ url_plc="https://plc.directory/export" host_at=bsky.social url=https://plc.directory url_at=https://$host_at/xrpc/com.atproto.repo.listRecords -dir=$HOME/.config/atr/txt +dir=$HOME/.config/ai/txt file=$dir/user_list.txt dir_git_card_page=$HOME/git/card.syui.ai diff --git a/scpt/t.zsh b/scpt/t.zsh new file mode 100755 index 0000000..0e38096 --- /dev/null +++ b/scpt/t.zsh @@ -0,0 +1,20 @@ +#!/bin/zsh + +f=`grep -R '$HOME/.config/atr' . |cut -d : -f 1|sort|uniq|grep -v t.zsh` +echo $f +n=`echo $f|wc -l` +for ((i=1;i<=$n;i++)) +do + ff=`echo $f|awk "NR==$i"` + echo $i + echo $ff + sed 's#$HOME/.config/atr#$HOME/.config/ai#g' $ff|grep '$HOME/.config' + case $OSTYPE in + linux*) + sed -i 's#$HOME/.config/atr#$HOME/.config/ai#g' $ff + ;; + darwin*) + sed -i "" 's#$HOME/.config/atr#$HOME/.config/ai#g' $ff + ;; + esac +done diff --git a/scpt/user_search.zsh b/scpt/user_search.zsh index cb20ba6..1aa0044 100755 --- a/scpt/user_search.zsh +++ b/scpt/user_search.zsh @@ -4,7 +4,7 @@ url_plc="https://plc.directory/export" host_at=bsky.social url=https://plc.directory url_at=https://$host_at/xrpc/com.atproto.repo.listRecords -dir=$HOME/.config/atr/txt +dir=$HOME/.config/ai/txt file=$dir/user_list.txt