-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.lib
92 lines (74 loc) · 1.94 KB
/
run.lib
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
# $HOME/$twm_dir/run.lib
# Copyright (c) 2019-2024 Ueliton Alves Dos Santos
# Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
restart_script() {
if [ "$RUN" != "aboot" ]; then
pidf=$(ps ax -o pid=,args= |grep "sh.*$twm_dir/twm.sh"|grep -v 'grep'|head -n 1|grep -o -E '([0-9]{3,5})')
until [ -z "$pidf" ]; do
kill -9 $pidf 2> /dev/null
pidf=$(ps ax -o pid=,args= |grep "sh.*$twm_dir/twm.sh"|grep -v 'grep'|head -n 1|grep -o -E '([0-9]{3,5})')
sleep 1s
done
fi
}
twm_play() {
if [ ! -s "$TMP/CLD" ]; then
clan_id
fi
case $(date +%H:%M) in
#/No events time with coliseum
(00:00|00:30|01:00|01:30|02:00|02:30|03:00|03:30)
standard_crono
coliseum_start
;;
(04:00|04:30|05:00|05:30|06:00|06:30|07:00|08:30|09:00|09:30|11:30|12:00|13:00|13:30|14:30|15:30|17:00|17:30|18:00|18:30|19:30|20:00|20:30|23:00|23:30)
standard_crono
;;
#/Valley of the Immortals 10:00:00 - 16:00:00 - 22:00:00
(09:5[5-9]|15:5[5-9]|21:5[5-9])
undying_start
standard_crono
;;
#/Clan coliseum 10:30:00 - 15:00:00
(10:2[8-9]|14:5[8-9])
if [ -n $CLD ]; then
clancoliseum_start
fi
standard_crono
;;
#/Clan tournament 11:00:00 - 19:00:00
(10:5[5-9]|18:5[5-9])
if [ -n $CLD ]; then
clanfight_start
fi
standard_crono
;;
#/King of the Immortals 12:30:00 - 16:30:00 - 22:30:00
(12:2[5-9]|16:2[5-9]|22:2[5-9])
king_start
standard_crono
;;
#/Ancient Altars 14:00:00 - 21:00:00
(13:5[5-9]|20:5[5-9])
if [ -n $CLD ]; then
altars_start
fi
standard_crono
;;
(21:30) #/Clan dmg 09:30:00 - 21:30:00
# _clandmgfight
standard_crono
;;
(*)
if [ "$RUN" = "acl" ]; then
printf "$(G_T "Running in coliseum mode"): -cl\n"
sleep 2s
coliseum_start
arena_duel
messages_info
fi
func_sleep
func_crono
;;
esac
}