forked from Boyquotes/bash_bots
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_bot.sh
More file actions
executable file
·77 lines (64 loc) · 1.62 KB
/
launch_bot.sh
File metadata and controls
executable file
·77 lines (64 loc) · 1.62 KB
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
#!/bin/bash
time="30"
SECS=300
source lib/color.sh
source lib/functions.sh
echo -e $bold
start_test
ask_challenge $challenge
next_step=$[$SECS-$time]
win=false
game_over=false
bad_response=0
step=1
consigne $step
while [[ 0 -ne $SECS ]]; do
if [ $win == true ]
then
echo -e $green"You win, try next level"$reset_color
exit
fi
if [ $game_over == true ]
then
echo -e $red"You lose, Game Over$reset_color"
exit
fi
if [ $verif ]
then
if [ $read_input ]
then
if [ $time == ${bad_response:-0} ]
then
echo -e $red"Game over"$reset_color$bold
game_over=true
break
fi
echo "Quelle est la commande à taper pour faire cela ?"
read
response$step
else if [ $test ]
then
search_grep "$val_test" "$search_in"
if [ -n "$result" ]
then
#next_step
win=true
result=""
val_test=""
search_in=""
else
next_try
fi
else
next_step
fi
fi
else
next_try
fi
if [ $SECS == "$next_step" ]
then
game_over=true
fi
done
echo "Time is up, clown."