Adding new devices/features into scripts.
[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         # Arlo camera
57         #if (( $i % 2 ))
58         #then
59                 # live view
60         #       ./adb shell input tap 532 740
61         #else
62                 # stop live view
63         #       ./adb shell input tap 101 1012
64         #fi
65         # Blossom
66         #if (( $i % 2 ))
67         #then
68                 # start watering
69         #       ./adb shell input tap 538 1597
70         #else
71                 # stop watering
72         #       ./adb shell input tap 496 1533
73         #fi
74         # Dlink siren
75         #./adb shell input tap 994 802
76         # Nest thermostat
77         #if (( $i % 2 ))
78         #then
79                 # start fan
80         #       ./adb shell input tap 524 1668
81         #       ./adb shell input tap 936 1709
82         #else
83                 # stop fan
84         #       ./adb shell input tap 524 1668
85         #       ./adb shell input tap 679 1702
86         #fi
87         # Alexa
88         if (( $i % 2 ))
89         then
90                 # Using Google Translate and 
91                 #       having her speak to Alexa
92                 # Question 1
93                 ./adb shell input tap 907 145
94                 ./adb shell input tap 543 692
95                                 ./adb shell input tap 148 775
96         else
97                 # Question 2
98                 ./adb shell input tap 907 145
99                 ./adb shell input tap 463 1668
100                                 ./adb shell input tap 148 775
101         fi
102         #date +%r
103         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
104         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
105         #echo "Delay: $RAND seconds"
106         #sleep $[$RAND]s
107         
108         # pick a prime number > 120 seconds
109         sleep 131s
110 done