-
Notifications
You must be signed in to change notification settings - Fork 0
/
twm.sh
119 lines (114 loc) · 3.17 KB
/
twm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
. ~/twm/info.sh
colors
RUN=$(cat $HOME/twm/runmode_file)
cd $HOME/twm
script_ads () {
if [ "$RUN" != '-boot' ] && [ -f "$HOME/twm/ads_file" ] && [ -s "$HOME/twm/ads_file" ] && [ "$(cat $HOME/twm/ads_file)" != "$(date +%d)" ] ; then
if [ "$(cat $HOME/twm/ads_file 2> /dev/null)" != "$(date +%d)" ] ; then
xdg-open "https://apps.disroot.org/search?q=Shell+Script&category_general=on&language=pt-BR&time_range=&safesearch=1&theme=beetroot"
echo $(date +%d) >$HOME/twm/ads_file
fi
else
echo $(date +%d) >$HOME/twm/ads_file
fi
}
script_ads
printf "${BLACK_CYAN}\n Starting...\n👉 Please wait...☕👴${COLOR_RESET}\n"
#. ~/twm/info.sh
script_slogan
sleep 1s
#/termux
if [ -d /data/data/com.termux/files/usr/share/doc ] ; then
termux-wake-lock
LS='/data/data/com.termux/files/usr/share/doc'
else
LS='/usr/share/doc'
fi
#/sources
cd ~/twm
#/twm.sh before sources <<
#. clandmgfight.sh
. requeriments.sh ; . loginlogoff.sh
. flagfight.sh ; . clanid.sh ; . crono.sh ; . arena.sh ; . coliseum.sh
. campaign.sh ; . run.sh ; . altars.sh ; . clanfight.sh
. clancoliseum.sh ; . king.sh ; . undying.sh ; . clandungeon.sh
. trade.sh ; . career.sh ; . cave.sh ; . allies.sh ; . svproxy.sh ; . check.sh
#/twm.sh after sources >>
#/functions
twm_start () {
if echo "$RUN"|grep -q -E '[-]cv' ; then
cave_start
elif echo "$RUN"|grep -q -E '[-]cl' ; then
twm_play
elif echo "$RUN"|grep -q -E '[-]boot' ; then
twm_play
else
twm_play
fi
}
func_unset () {
unset HP1 HP2 YOU USER CLAN ENTER ENTER ATK ATKRND DODGE HEAL BEXIT OUTGATE LEAVEFIGHT WDRED HLHP
}
if [ -f "$HOME/twm/ur_file" ] && [ -s "$HOME/twm/ur_file" ] ; then
printf "${GREEN_BLACK} Starting with last settings used.${COLOR_RESET}\n"
num=6
for i in `seq 6 -1 1` ; do
i=$((i - 1))
if read -t 1 ; then
>$HOME/twm/al_file
>$HOME/twm/ur_file
>$HOME/twm/fileAgent.txt
unset UR
unset UA
unset AL
break &>/dev/null
fi
printf " Hit${GOLD_BLACK} [Enter]${COLOR_RESET} to${GOLD_BLACK} reconfigure${GREEN_BLACK} ${i}s${COLOR_RESET}\n"
done
fi
requer_func
func_proxy
login_logoff
if [ -n "$ALLIES" ] && [ "$RUN" != "-cv" ] ; then
conf_allies
clear
fi
func_cat
messages_info
while true ; do
sleep 1s
twm_start
done
#/sync
: ' comparing local package
if [ ! -z "$RUN" ] ; then
:
else
TWMKEY=$(curl https://codeberg.org/ueliton/auth/raw/branch/main/auth -s -L|base64 -d)
SERVER='https://raw.githubusercontent.com/sharesourcecode/TitansWarMacro/master/'
remote_count=$(curl ${SERVER}sourceinstall.sh -s -L|wc -c)
if [ -e "$HOME/twm/sourceinstall.sh" ] ; then
local_count=$(wc -c < "$HOME/twm/sourceinstall.sh")
else
local_count=1
fi
'
#if awk -v remote="$remote_count" -v local="$local_count" 'BEGIN {if (remote == local) exit 0; else exit 1}' ; then
: '
else
if ! curl -s --head --request GET titanswar.net|grep "200 OK" > /dev/null ; then
printf "${WHITEb_BLACK}Network error! Please check your internet connection.${BLACK_RESET}\n"
exit 1
else
rm $HOME/twm/easyinstall.s*
curl ${SERVER}easyinstall.sh -s -L >$HOME/twm/easyinstall.sh
rm $HOME/easyinstall.s*
cp $HOME/twm/easyinstall.sh $HOME/easyinstall.sh
SYNC=1
chmod +x $HOME/easyinstall.sh
. $HOME/easyinstall.sh
fi
fi
fi
'