Cleaning up further.
[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 #END=2
10 INC=1
11
12 # Range of random number (in seconds)
13 RAN_STA=100
14 RAN_END=200
15
16 for ((i=$BEGIN; i<=$END; i+=$INC));
17 do
18         
19         date +"%m/%d/%Y %r"
20         #./adb shell getevent -l - use this command to get the position
21         # Click on screen
22         #./adb shell input tap 500 1500
23         # TP-Link switch
24         #./adb shell input tap 1002 913
25         # TP-Link bulb on/off
26         #./adb shell input tap 994 560
27         # D-Link switch
28         #./adb shell input tap 987 346
29         # D-Link motion sensor
30         #./adb shell input tap 975 840
31         # SmartThings plug
32         #./adb shell input tap 921 1188
33         #./adb shell input tap 533 653
34         # WeMo, WeMo Insight, LiFX bulbs, Hue bulbs with ST-app
35         #./adb shell input tap 533 653
36         # WeMo
37         #./adb shell input tap 981 532
38         # WeMo Insight
39         ./adb shell input tap 981 326
40         # Kwikset doorlock
41         #if (( $i % 2 ))
42         #then
43                 # locking
44         #       ./adb shell input tap 153 1211
45         #else
46                 # unlocking
47         #       ./adb shell input tap 520 1211
48         #fi
49         # Hue bulb
50         #./adb shell input tap 923 383
51         #./adb shell input tap 900 550
52         # Hue bulb intensity
53         #if (( $i % 2 ))
54         #then
55                 # brighter
56         #       ./adb shell input tap 100 650
57         #else
58                 # dimmer
59         #       ./adb shell input tap 100 750
60         #fi
61         # Lifx bulb
62         #./adb shell input tap 506 580
63         # Amcrest camera
64         #if (( $i % 2 ))
65         #then
66                 # live view
67         #       ./adb shell input tap 92 139
68         #       ./adb shell input tap 92 139
69         #else
70                 # stop live view (go to playback)
71         #       ./adb shell input tap 92 139
72         #       ./adb shell input tap 92 250
73         #fi
74         # Arlo camera
75         #if (( $i % 2 ))
76         #then
77                 # live view
78                 #./adb shell input tap 532 740
79         #       ./adb shell input tap 533 653
80         #else
81                 # stop live view
82                 #./adb shell input tap 101 1012
83         #       ./adb shell input tap 533 653
84         #       ./adb shell input tap 533 653
85         #       ./adb shell input tap 533 653
86         #fi
87         # Blossom - turning on/off 1 zone
88         #if (( $i % 2 ))
89         #then
90                 # start watering
91         #       ./adb shell input tap 538 1597
92         #else
93                 # stop watering
94         #       ./adb shell input tap 496 1533
95         #fi
96         # Blossom - change mode active/hibernate
97         #./adb shell input tap 1002 1176
98         # Dlink siren
99         #./adb shell input tap 994 802
100         # Nest thermostat
101         #if (( $i % 2))
102         #then
103                 # start fan
104         #       ./adb shell input tap 524 1668
105         #       ./adb shell input tap 936 1709
106         #else
107                 # stop fan
108         #       ./adb shell input tap 524 1668
109         #       ./adb shell input tap 679 1702
110         #fi
111         # Alexa
112         #if (( $i % 2))
113         #then
114                 # Using Google Translate and 
115                 #       having her speak to Alexa
116                 # Question 1
117         #        ./adb shell input tap 907 145
118         #        ./adb shell input tap 543 692
119         #       ./adb shell input tap 148 775
120         #else
121                 # Question 2
122         #        ./adb shell input tap 907 145
123         #        ./adb shell input tap 463 1668
124         #       ./adb shell input tap 148 775
125         #fi
126         #date +%r
127         #RAND=$[( $RANDOM % $RAN_END ) + $RAN_STA]
128         #RAND=$[`jot -r 1 $RAN_STA $RAN_END`]
129         #echo "Delay: $RAND seconds"
130         #sleep $[$RAND]s
131
132         # TP-Link bulb - change colors & intensity
133         #if (( $i % 2 ))
134         #then
135                 # color 1 - horizontal
136                 #./adb shell input tap 250 1000
137                 # color 3 - vertical
138                 #./adb shell input tap 500 1250
139                 # intensity change (vertical)
140         #        ./adb shell input tap 250 1405
141         #else
142                 # color 2 - horizontal
143                 #./adb shell input tap 750 1000
144                 # color 4 - vertical
145                 #./adb shell input tap 500 750
146                 # intensity change (vertical)
147         #        ./adb shell input tap 850 1405
148         #fi
149         # Hue bulb - change intensity
150         #if (( $i % 2 ))
151         #then
152                 # intensity change (bright)
153         #        ./adb shell input tap 300 550
154         #else
155                 # intensity change (dimmed)
156         #        ./adb shell input tap 800 550
157         #fi
158         # Arlo camera - arm/disarm
159         #if (( $i % 2 ))
160         #then
161                 # Arm
162         #        ./adb shell input tap 500 500
163         #else
164                 # Disarm
165         #        ./adb shell input tap 500 750
166         #fi
167         
168         # pick a prime number > 120 seconds
169         sleep 131s
170         #sleep 13s
171 done
172 #ssh root@192.168.1.1 "kill -9 18572 18576"