-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegram_typer.sh
executable file
·74 lines (54 loc) · 1.3 KB
/
telegram_typer.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
#!/usr/bin/env bash
#results=$(xdotool search --onlyvisible --class "TelegramDesktop")
results=$(xdotool search --onlyvisible --class "Bettergram")
echo $results
text="testing test"
arr=($text)
How_many_times_to_spam=10
MIN_delay=70
MAX_delay=400
#MIN_delay=10
#MAX_delay=20
spam_sent_count=0
function spam {
for id in $results
do
#check for proper window
#xdotool windowfocus $id
#if [ $? -ne 0 ]
#then
# echo "window is fuked trying next one"
# continue
# fi
for line in ${arr[@]}
do
xdotool type --window $id $line
if [ $? -ne 0 ]
then
echo "window is fuked trying next one"
break
fi
milliseconds=$(( $RANDOM % $MAX_delay + $MIN_delay ))
spam_sent_count=$(( $spam_sent_count + 1 ))
#echo "delaying for $milliseconds"
xdotool key --window $id --delay $milliseconds Return
#echo "line is $line"
done
#xdotool type --window 58720262 'helloo there\n'
#check for right windwo
# xdotool windowfocus 58720262 works but focuses sheit
#echo "id is $id"
done
}
catch_end() {
echo ":)"
echo "total spam sent $spam_sent_count"
exit 0
}
trap 'catch_end' SIGINT
while [ $How_many_times_to_spam -gt 0 ]
do
spam
How_many_times_to_spam=$(( $How_many_times_to_spam - 1 ))
done
echo "total spam sent $spam_sent_count"