e93a8181d4cd2acd2dff6a98d8070bed14779fc2
[pingpong.git] / automation / clicker.sh
1 #!/bin/bash
2
3 # This script does clicking action automatically
4 # We just need to set up the timer duration
5
6 # Loop variables
7 BEGIN=1
8 END=100
9 INC=1
10
11 # Range of random number (in seconds)
12 RAN_STA=100
13 RAN_END=200
14
15 for ((i=$BEGIN; i<=$END; i+=$INC));
16 do
17         
18         date +"%m/%d/%Y %r"
19         #./adb shell getevent -l - use this command to get the position
20         # TP-Link switch
21         #./adb shell input tap 1002 913
22         # TP-Link bulb on/off
23         #./adb shell input tap 994 560
24         # D-Link switch
25         #./adb shell input tap 987 346
26         # SmartThings
27         #./adb shell input tap 921 1188
28         # WeMo
29         #./adb shell input tap 981 532
30         # WeMo Insight
31         #./adb shell input tap 981 326
32         # Kwikset doorlock
33         #if (( $i % 2 ))
34         #then
35                 # locking
36         #       ./adb shell input tap 153 1211
37         #else
38                 # unlocking
39         #       ./adb shell input tap 520 1211
40         #fi
41         # Hue bulb
42         #./adb shell input tap 923 383
43         # Lifx bulb
44         #./adb shell input tap 506 580
45         # Amcrest camera
46         if (( $i % 2 ))
47         then
48                 # live view
49                 ./adb shell input tap 92 139
50                 ./adb shell input tap 92 139
51         else
52                 # stop live view (go to playback)
53                 ./adb shell input tap 92 139
54                 ./adb shell input tap 92 250
55         fi
56         #date +%r
57         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
58         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
59         #echo "Delay: $RAND seconds"
60         #sleep $[$RAND]s
61         
62         # pick a prime number > 120 seconds
63         sleep 131s
64 done